RUN TASK Using DMRTDYN (z/OS)

This Process, SAMPLE1, is submitted from a Connect:Direct® for z/OS® node. Through the RUN TASK statement, DMRTDYN determines if the data set exists at the SNODE. If this data set exits, the LOCATE step receives a return code of 0, and the next step, DELETE, deletes the data set. STEP01 executes, regardless of the return code received from the LOCATE step. (STEP01 copies from the PNODE to the SNODE.)

SAMPLE1  PROCESS    PNODE=&PNODE                                          -
                    SNODE=&SNODE                                          -
                    HOLD=NO
LOCATE   RUN TASK  (PGM=DMRTDYN,                                          -
                    PARM=(C"LOCATE DSN=&HLQ2..SAMP.OUT"))                 -
                    SNODE
         IF  (LOCATE = 0)  THEN
DELETE   RUN TASK  (PGM=DMRTDYN,                                          -
                    PARM=(C"ALLOC DSN=&HLQ2..SAMP.OUT DISP=(OLD,DELETE)"  -
                          F’-1’                                           -
                          C"UNALLOC DSN=&HLQ2..SAMP.OUT"))
         EIF
STEP01   COPY  FROM  (DSN=&HLQ1..SAMPLE.IN)                               -
               TO    (DSN=&HLQ2..SAMP.OUT                                 -
                      DISP=RPL)

The command used to submit SAMPLE1 follows:

SUBMIT PROC=SAMPLE1                             -
         &PNODE=CD.LOCAL                        -
         &SNODE=CD.REMOTE                       -
         &HLQ1=$LOCAL                           -
         &HLQ2=$REMOTE