Use of Conditional Logic (z/OS to VSE)

The following Process issues a VSE/Power command based on the return code of the previous COPY step. If the transfer is successful, the VSE/Power command releases GSVSE01. If the transfer fails, GSVSE02 is released. This Process is designed to be submitted from the z/OS node.

TESTVSE  PROCESS      SNODE=CD.VSE.NODE             -
                      PNODE=CD.OS390.NODE
STEP01   COPY  FROM  (DSN=JSMITH.CNTL.JCL(VSAMDEL)  -
                      DISP=SHR                      -
                      UNIT=SYSDA)                   -
                      CKPT=0K                       -
               TO    (DSN=JSMITH.CNTL.JCL(XXXX)     -
                      DISP=RPL                      -
                      LIBR=(SUBLIB=JCL,TYPE=JCL)    -
                      DCD=(DSORG=VSAM)
     IF (STEP01 NE 0) THEN
         RUN TASK    (PGM=DMRTPOWR                  -
                      PARM=(F’5’                    -
                            F’3’                    -
                           (’R RDR,GSVSE01’))       -
                      SNODE
                      EXIT
     ELSE
         RUN TASK    (PGM=DMRTPOWR                  -
                      PARM=(F’5’                    -
                            F’3’                    -
                           (’R RDR,GSVSE02’))       -
                      SNODE
                      EXIT
     EIF