/* REXX */
X = OUTTRAP('SLINE.')
"STATUS <JOBNAME> <JOBID>"
D = OUTTRAP("OFF")
count = 0
DO I = 1 TO SLINE.0
SAY SLINE.I
PARSE VAR SLINE.I JOBHOLDER NAME MESSAGE
STRT_POS = POS("(",NAME,1)
END_POS = POS(")",NAME,1)
LENG_NAM = STRT_POS - 1
STRT_POSID = STRT_POS + 1
LENG_JOBID = END_POS - STRT_POSID
JOBNAM = SUBSTR(NAME,1,LENG_NAM)
JOBID = SUBSTR(NAME,STRT_POSID,LENG_JOBID)
IF MESSAGE = "EXECUTING" THEN
DO
SAY " ONLY JOBS ON OUTPUT CAN BE BROWSED "JOBID" "MESSAGE
END
IF MESSAGE = "ON OUTPUT QUEUE" THEN
DO
COUNT = COUNT + 1
END
IF MESSAGE = "NO JOBS FOUND" THEN
DO
SAY MESSAGE
RETURN
END
END
EXIT
Note: Replace JOBNAME and JOBID in the rexx and execute to see the results.
You may also ignore JOBID to get the list of all jobs with that job.
"STATUS <JOBNAME>"
X = OUTTRAP('SLINE.')
"STATUS <JOBNAME> <JOBID>"
D = OUTTRAP("OFF")
count = 0
DO I = 1 TO SLINE.0
SAY SLINE.I
PARSE VAR SLINE.I JOBHOLDER NAME MESSAGE
STRT_POS = POS("(",NAME,1)
END_POS = POS(")",NAME,1)
LENG_NAM = STRT_POS - 1
STRT_POSID = STRT_POS + 1
LENG_JOBID = END_POS - STRT_POSID
JOBNAM = SUBSTR(NAME,1,LENG_NAM)
JOBID = SUBSTR(NAME,STRT_POSID,LENG_JOBID)
IF MESSAGE = "EXECUTING" THEN
DO
SAY " ONLY JOBS ON OUTPUT CAN BE BROWSED "JOBID" "MESSAGE
END
IF MESSAGE = "ON OUTPUT QUEUE" THEN
DO
COUNT = COUNT + 1
END
IF MESSAGE = "NO JOBS FOUND" THEN
DO
SAY MESSAGE
RETURN
END
END
EXIT
Note: Replace JOBNAME and JOBID in the rexx and execute to see the results.
You may also ignore JOBID to get the list of all jobs with that job.
"STATUS <JOBNAME>"
The above REXX is errored by giving the below error:
ReplyDeleteREADY
%JOBSTAT
IKJ56192I JOB AUTOMAT2(JOB69953) ON OUTPUT QUEUE
14 +++ JOBNAME = SUBSTR(NAME,1,LENG_NAM)
IRX0040I Error running JOBSTAT, line 14: Incorrect call to routine
READY
END