Thanks. Since I can do ADDRESS JOBTRAC directly from OPS/REXX, I used your code and created:
000100 /* REXX */
000200 z = opscledq()
000300
000400 address 'JOBTRAC'
000500 "get job(*) vers(NEXT) status(EX)"
000600
000700 maxRC = RC
000800 say maxRC
000900
001000 do queued()
001100 parse pull w1 w2 rest
001110 say w1 w2 rest
001200 if w1 = 'RC' then
001300 do
001400 select
001500 when w2 = '0000' then say 'Jobs Executing'
001600 when w2 = '0004' then say 'No Jobs Active'
001700 otherwise
001800 do
001900 say 'Other Issue'
002000 say w1 w2 rest
002100 end
002200 end
002300 end
002400 end
If it detects any active jobs, we get:
RC 0000 CUUS GET SRA8439C 03/11 00065 083 EX . X
If it does not detect any active jobs, we get:
RC 0004 CUUS GET * . NEXT . EX . X
Thus my OPS/REXX program can simply run this check as necessary to detect if any jobs are active (executing) in Jobtrac.
Thanks for your help in getting the parms needed to pass to ADDRESS JOBTRAC to get the desired data.
Original Message:
Sent: 03-11-2020 09:21 AM
From: Carlos Mario Silveira Filho
Subject: Get List Of Jobs Currently Active In Jobtrac via OPS/REXX
Hi Tim,
Understood. I believe you will have to use an IMOD and call this IMOD from an OPS/REXX program.
The reason why it needs to be an IMOD is due to the control of the loop of GET/NEXT commands.
The sample REXX program that can be called from OPS would be:
/* REXX */
X = SRVCALL(,'ISRV','GETEXEC','PASS',DATA,'STACK=Y')
DO QUEUED()
PULL REC
SAY REC
END
RETURN
As you can see above the SRVCALL routine calls an IMOD named GETEXEC.
A sample code of this IMOD (this is just a sample you have to adapt to your needs) would be:
#DESC IMOD TO DISPLAY EXECUTING JOBS UNDER JOBTRAC
#SOURCE
i = 0
RETC = '0000'
DO FOREVER
IF RETC <> '0000' THEN leave
ADDRESS JOBTRAC "GET JOB(*) VERS(NEXT) STATUS(EX)"
DO QUEUED()
PULL LINE
SAY LINE
IF POS('JOBN',LINE) > 0 THEN JOBNAME = WORD(LINE,2)
IF POS('STAT',LINE) > 0 THEN STATUS = WORD(LINE,2)
IF POS('JES#',LINE) > 0 THEN JOB# = WORD(LINE,2)
IF POS('RC',LINE) > 0 THEN RETC = WORD(LINE,2)
END
IF STATUS = 'EX' THEN do
i = i + 1
line.i = 'JOB: 'JOBNAME JOB# 'IS EXECUTING'
STATUS = 'XX'
end
END
do queued()
pull dummy
end
do j = 1 to i
queue line.j
end
Regards,
Mario
Original Message:
Sent: 03-10-2020 03:39 PM
From: TIM RASMUSSEN
Subject: Get List Of Jobs Currently Active In Jobtrac via OPS/REXX
I use the ADDRESS JOBTRAC all the time in various OPSMVS REXX programs. I am specifically asking how I can do the "K=E" command via my OPS/REXX program which is normally performed by a MF Operator logging on to TSO, going into the Jobtrac panels and typing "K=E". I want to do that programmatically.
Original Message:
Sent: 03-10-2020 03:33 PM
From: Carlos Mario Silveira Filho
Subject: Get List Of Jobs Currently Active In Jobtrac via OPS/REXX
Hi Tim,
Yes, you can use the ADDRESS JOBTRAC environment from OPS/REXX programs.
See the link below for details about the interface. It requires some setup on the GSS address space (CA Common Services):
https://techdocs.broadcom.com/content/broadcom/techdocs/us/en/ca-mainframe-software/automation/ca-ops-mvs-event-management-and-automation/13-5/integrating/integrating-with-ca-jobtrac.html
For details about the commands that can be used from REXX, please, consult the CA Jobtrac documentation, in special the section "Using REXX" of the Extended Scheduling Services Guide.
Regards,
Mario
Original Message:
Sent: 03-10-2020 10:43 AM
From: TIM RASMUSSEN
Subject: Get List Of Jobs Currently Active In Jobtrac via OPS/REXX
We currently have an OPS/MVS REXX program which issues a WTOR asking MF Operations to check if there are any batch jobs currently active in Jobtrac via TSO JOBTRAC "k=e" command. When there are no more jobs active, they respond to WTOR and the process continues.
Is there a method to use ADDRESS JOBTRAC commands in that OPS/REXX program to do the same thing programmatically?
------------------------------
Tim Rasmussen
------------------------------