Use of Conditional Statements in VMESA

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

COPY01  PROCESS      SNODE=CD.CHICAGO
STEP01  COPY  FROM  (DSN=ABC.FILEA PNODE)      -
              TO    (DSN=JKL.FILEA)
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 SNODE)            -
              TO    (DSN=MNO PNODE)
        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 an OPERATION FAILED message to the console operator.