Use of Conditional Statements to Test for Process Completion on OpenVMS

In this example, the Process runs a job on OpenVMS. It uses conditional statements to check the completion code from STEP01. If the completion code equals 0, a message is issued to the operator indicating that the command procedure was successful. If the completion code is any value other than 0, a message is issued to the operator indicating that the command procedure failed.

PROC01      PROCESS     SNODE=CD.VMS.NODE
STEP01      RUN JOB     (DSN=DISK1:[USER1.PROC_CD1]DIR.COM
                        SYSOPTS=“NOPRINT LOG WAIT” SNODE
STEP02      IF          (STEP01 EQ 0) THEN
            RUN TASK    (PGM=VMS PNODE  SYSOPTS=“
                        CMD=‘REPLY/USER=USER1/BELL BATCH_JOB_SUCCEED’"
            ELSE
            RUN TASK    (PGM=VMS PNODE  SYSOPTS=“
                        CMD=‘REPLY/USER=USER1/BELL BATCH_JOB_FAILED’"
            EIF