I am sure everyone who has programmed using IBM i has encountered QCMDEXC. Most of us have used the QCMDEXC API, or the QCMDEXC procedure in SQL to execute CL commands from another program or a SQL statement. Included within the latest round of Technology Refreshes for 7.4 and 7.3 is a QCMDEXC scalar function.
A scalar function has to be executed as part of a SQL statement, a Select for example, rather than called directly. Like all the other scalar functions I know, it will return “1” when it executed successfully, and “-1” when it did not.
I have to admit I had to think for a while of a situation I could use this in. Then I remembered one where this could be a perfect fit.
Many years ago I came across a couple of programs that were part of a month end job to release and hold job queues that were used by the month end. There was a file that contained a list of job queues, the library they are found in, and what was called the “flag” field. All the flag was used for if it was not “1” the job queue was not processed.
I have built a SQL table to mimic that file:
Read more »