Use of Conditional Statements in a UNIX Process

This Connect:Direct® for UNIX Process contains all of the conditional statements.

copy1     process     snode=chicago
step01    copy  from  (file=abc pnode)
                to    (file=def snode)
step02    if          (step01 gt 4) then
          goto step07
          else
step03    runjob      sysopts="myjob"
          eif
step04    if          (step03 >= 8) then
          exit
step05    if          (step03 lt 4) then
step06    copy  from  (file=xyz pnode)
                to    (file=uvw snode)
          eif
          exit
step07    run task    sysopts=“verify”
          exit
          pend

copy01 is the process statement defining the secondary node as chicago.

step01 copies file abc on the pnode to file def on the snode.

step02 checks the completion code of step01. If step01 fails (return code greater than 4), step07 executes. If step01 completes with a return code of 4 or less, step03 executes.

step03 submits a job, myjob, on the pnode.

step04 checks the completion code of step03. If step03 fails with a 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 error, step06 executes.

step06 copies file xyz on the pnode to file uvw on the snode. The Process will then exit.

step07 only executes if step01 fails. The program verify runs, sending an Operation Failed Message to the console operator.

pend marks the end of a Process.