even if there are multiple OSF servers up in the System.M C040000 PSYS 20207 11:14:42.00 00000000 *$HASP715 ADDRESS SPACES WAITING FOR RETURN JOBID 466
D 466 00000000 ASID JOBNAME
D 466 00000000 -------- --------
E 466 00000000 01DD OPSOSF
Component : OPS/MVS
In general it's important to usually set OSFGETJOBID to YES for example in order to use the OPSUBMIT function to submit a batch job directly from an OPS/REXX program or to use a SEND EMAIL Rexx to send email from within a Rexx. In addition, starting servers as SUB=MSTR requires to have OSFGETJOBID set to YES.
That said, below the steps to perform in order to correctly implement the supplied STOPJES2 Rexx:
1) Code a new Rexx exec (lets call it JES2DOWN)
/* JES2DOWN rexx that sets OSFGETJOBID then redrives STOPJES2 logic*/
SET = OPSPARM('SET','OSFGETJOBID','NO') /* This turns off the JOBID*/
"OI STOPJES2" /* This re-drives stopping JES2 without a JOBID assigned*/
/* to the 'OI' request to bring JES2 down*/
2) Assign the new JES2 UP/DOWN action to perform in the JES2 STCTBL_ACT
JES2 UP/DOWN TSOCMD("OI JES2DOWN")
3) if present, remove the OSFGETJOBID setting from within the SSMSHUT Rexx because it doesn't need to be done twice.