Use of Conditional Statements in a VSE Process

The following VSE Process contains all of the conditional statements. A description of each step follows.

COPY01  PROCESS      SNODE=CD.CHICAGO
STEP01  COPY  FROM  (DSN=ABC.FILEA                                   -
                     DCB=(DSORG=PS, BLKSIZE=800, LRECL=80, RECFM=FB  -
                          VOL=SER=PACK01 DISP=(SHR) PNODE)           -
              TO    (DSN=JKL.FILEA                                   -
                     VOL=SER=PACK02                                  -
                     SPACE=(1993, (15)) DISP=(NEW) SNODE
STEP02  IF  (STEP01 GT 4) THEN
             GOTO STEP07
        ELSE
STEP03  RUN JOB     (DSN=USERJOB) SNODE
        EIF
STEP04  IF  (STEP03 >= 8) THEN
             EXIT
        EIF
STEP05  IF  (STEP03 LT 4) THEN
STEP06  COPY  FROM  (DSN=ABC                                         -
                     DCB=(DSORG=PS, BLKSIZE=800, LRECL=80, RECFM=FB  -
                     VOL=SER=PACK01 DISP=(SHR) PNODE)                -
              TO    (DSN=MNO                                         -
                     VOL=SER=PACK02                                  -
                     SPACE=(2008, (15)) DISP=(NEW) SNODE
        EIF
        EXIT
STEP07  RUN TASK    (PGM=DMNOTIFY,                                   -
                     PARM=(‘FAIL’,ABC.FILEA))                        -
                     PNODE

COPY01 is the PROCESS statement defining the secondary node as CD.CHICAGO.

STEP01 copies file ABC.FILEA on the PNODE to file JKL.FILEA on the SNODE.

STEP02 checks the completion code of STEP01. If STEP01 fails, STEP07 executes. If STEP01 ended with a completion code of 4 or less, STEP03 executes.

STEP03 submits the job, USERJOB, on the SNODE.

STEP04 checks the completion code of STEP03. If STEP03 fails with a completion code of 8 or greater, the Process terminates. Otherwise, STEP05 executes.

STEP05 checks the completion code from STEP03. If less than 4, indicating the step completed without errors, the COPY statement in STEP06 executes and the Process terminates.

STEP06 copies file ABC on the SNODE to file MNO on the PNODE.

STEP07 only executes if STEP01 fails. The program DMNOTIFY runs, sending a message indicating the operation failed to the console operator.