Execute DMRTDYN in a RUN TASK Environment (VM)

This Process calls DMRTDYN to determine if a file exists. If it does not exist, the user receives a nonzero return code, and a call is made to allocate the file.

DMRTDYN  PROCESS  SNODE=SC.VM.USER1
LOCATE1  RUN TASK (PGM=DMRTDYN                                     -
                   PARM=(C’ALLOC’,                                 -
                         C’ DSN=’’PROFILE EXEC’’’,                 -
                         C’ DISP=(SHR) LINK=(IVVB,WIVVB,RR,191)’,  -
                         C’ DD=F1’)) PNODE
         IF(LOCATE1 NE 0) THEN
LOCATE2  RUN TASK (PGM=DMRTDYN                                     -
                   PARM=(C’ALLOC’,                                 -
                         C’ DSN=’’PROFILE EXEC’’’,                 -
                         C’ DISP=(NEW) LINK=(IVVB,WIVVB,RR,191)’,  -
                         C’ DD=F1’)) PNODE
         EIF
LOCATE3  RUN TASK (PGM=DMRTDYN                                     -
                   PARM=(C’UNALLOC ’                               -
                         C’ DD=F1’)) PNODE