Use of Conditional Logic (i5/OS to z/OS)

This Process copies a file from an Connect:Direct® for i5/OS node to z/OS. STEP02 checks the completion code from STEP01 and executes STEP04 if the completion code is greater than 0. If STEP01 receives a completion code of 0, STEP03 will execute and send a message to terminal DSP03 indicating the file transfer was successful. If STEP01 receives a completion code greater than 0, STEP04 will execute and send a message to terminal DSP03 indicating the file transfer failed.

COPY02  PROCESS  SNODE=CD.SANFRAN.AS400                          -
                 PRTY=8                                          -
                 NOTIFY=USERID                                   -
                 CLASS=4                                         -
                 SNODEID=(USERID,PSWD)
STEP01  COPY     FROM    (                                       -
                 SNODE                                           -
                 DSN=’OS400/FILE001’                             -
                 SYSOPTS="TYPE(MBR)"                             -
                 DISP=SHR                                        -
                )                                                -
        TO      (                                                -
                 PNODE                                           -
                 DSN=OS390.FILE002                               -
                 DCB=(DSORG=PS,BLKSIZE=6160,LRECL=080,RECFM=FB)  -
                 DISP=RPL                                        -
                )
STEP02  IF     (STEP01 > 0) THEN
        GOTO    STEP04
        ELSE
STEP03  RUN TASK  (PGM=OS400) SNODE                              -
                   SYSOPTS=\"\                                   -
                           \CMD(\                                -
                           \SNDBRKMSG\                           -
                           \MSG(’FILE TRANSFER SUCCESSFUL’)\     -
                           \TOMSGQ(DSP03)\                       -
                           \)\                                   -
                           \"\
        EIF
        EXIT
STEP04  RUN TASK  (PGM=OS400) SNODE                              -
                   SYSOPTS=\"\                                   -
                           \CMD(\                                -
                           \SNDBRKMSG\                           -
                           \MSG(’FILE TRANSFER FAILED!!  ’)\     -
                           \TOMSGQ(DSP03)\                       -
                           \)\                                   -
                           \"\