Friday, June 5, 2020

REXX: How to set RC/MAXCC from REXX?

When you run your REXX in batch using ISPSTART, even if your program crashes, the job return code/MAXCC would be zero. This is not the result you want as you might have the following steps which would depend on this RC.

So, how to set the return code from REXX?

We need to make use of the system variable ZISPFRC.

if sysvar("SYSISPF") = "ACTIVE" then do         
   zispfrc = 16                                 
   address "ISPEXEC" "VPUT (ZISPFRC) SHARED"    
end                                             
exit                                            

This piece of code would set the return code of the batch to 16.

No comments:

Post a Comment

Featured Post

REXX Skeleton: Submitting jobs through Rexx

Submitting jobs through REXX and reading the spool through REXX gives us immense potential to automate many manual activities in mainframes....