Hello,
Running this:
//TSO1 EXEC PGM=IKJEFT1B,DYNAMNBR=20
//SYSEXEC DD DISP=SHR,DSN=MYDUMB.TEST.REXXLIB
//SYSPRINT DD SYSOUT=*
//SYSOU1 DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
SETRC 17
/*
The SETRC REXX code:
Produces this:
IEF236I ALLOC. FOR MYREXXRC TSO1
IGD103I SMS ALLOCATED TO DDNAME SYSEXEC
IEF237I JES2 ALLOCATED TO SYSPRINT
IEF237I JES2 ALLOCATED TO SYSOU1
IEF237I JES2 ALLOCATED TO SYSTSPRT
IEF237I JES2 ALLOCATED TO SYSTSIN
IEF237I 80A2 ALLOCATED TO SYS00001
IEF285I SYS1.UADS KEPT
IEF285I VOL SER NOS= C1101B.
IEF142I MYREXXRC TSO1 - STEP WAS EXECUTED - COND CODE 0017
Maybe incorporating this will do what you want. . .