I do this by performing a WRKACTJOB SBS(subsystem) to spoolfile. I then copy the spoolfile to a physical file. A simple loop will then record number of active jobs within it. Carl
Unconfigured Ad Widget
Collapse
Announcement
Collapse
No announcement yet.
Active Jobs in a Subsystem
Collapse
X
-
Active Jobs in a Subsystem
You can use the QWDRSBSD API. I provided an example below which I quickly put together (which means please test prior to use). However please note the API documentation: "This number includes held jobs but excludes jobs that are disconnected or suspended because of a transfer secondary job or a transfer group job"
Code
-
Active Jobs in a Subsystem
What does your SNDPGMMSG look like? I made it work by adding a character variable, then converting the number to character. See code below. I initially got zeros until I remembered that we defined our own QINTER subsystem in QGPL. The 'QINTER *LIBL ' parm was finding the one in QSYS, which wasn't active. I changed the parm to 'QINTER QGPL ' and it appears to work fine. Lots faster than WRKACTJOB, too.
Code
Comment
Comment