Use of Conditional Statements in a Microsoft Windows Process

This Microsoft Windows Process contains all of the conditional statements.

copy01     process     snode=cdchicago
step01     copy  from  (file=myfile1 pnode)
                 to    (file=yourfile1 snode)
step02     if          (step01 gt 4) then
                       goto step07
           else
step03     runjob      dsn=WINNT
                       sysopts="pgm(testwin.exe)"
           eif
step04     if          (step03 >= 8) then
           exit
           eif
step05     if          (step03 lt 4) then
step06     copy  from  (file=myfile2 pnode)
                 to    (file=yourfile2 snode)
           eif
           exit
step07     run task     pgm=Windows
                        sysopts=“pgm(failjob.exe)”
           exit

copy01 is the process statement defining the Process name as copy01 and the snode as cdchicago.

step01 copies file myfile1 on the pnode to file yourfile1 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 starts the program testwin.exe.

step04 checks the completion code of step03. If step03, not the program testwin.exe, 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, not the program testwin.exe, step06 executes.

step06 copies file myfile2 on the pnode to file yourfile2 on the snode. The Process will then exit.

step07 only executes if step01 fails. The run task step executes the program failjob.exe.