Hello Steve,
Yes, it is possible. Let's suppose you have a global variable named GLOBAL.RC where you have a numeric return code assigned. So you can create a REXX program as simple as:
EDIT CAI.OPS.REXX(CHKRC) - 01.00
Command ===>
***************************** Top of Data
retcode = opsvalue('GLOBAL.RC','O')
exit retcode
**************************** Bottom of Data
Then create a JCL step to execute this REXX program:
//CMD EXEC PGM=OI,PARM='CHKRC' <- name of the member where the REXX program is
//STEPLIB DD DISP=SHR,DSN=CAI.OPS130.CCLXLOAD
//OPS$OPSS DD DUMMY <- OPS subsystem id OPSS
//SYSPRINT DD SYSOUT=*
//SYSEXEC DD DISP=SHR,DSN=CAI.OPS.REXX
This step you end with the return code as set in the global variable GLOBAL.RC so that you can use JCL COND or IF statements to control the execution of subsequent steps.
You may need to include some more code to check if the global variable exists before using it and any other logic required by your application.
Regards,
Mario
Carlos Mario Filho
Principal Support Engineer