Technical Blog Post
Abstract
How to use DGADWAIT in a process.
Body
The utility DGADWAIT (DMRTWAIT) and MAXDELAY can be used together to delay the termination of the DMBATCH job and return a condition code that relates to the termination of the submitted process. This is basically what CDPOST and CDWAIT use to do prior to Connect:Direct for z/OS V4.7.
The DMBATCH batch job would have a MAXDELAY coded on the SUBMIT command, causing the batch job to wait on the submitted process to complete and return a desired return code based on the success or failure of the process.
//JOBNAME JOB (ACCT INOF),'****************',NOTIFY=&SYSUID,CLASS=T,
// MSGCLASS=X,MSGLEVEL=(1,1)
//*
//DMBATCH EXEC PGM=DMBATCH,REGION=1024K,PARM=(YYSLYNN)
//STEPLIB DD DISP=SHR,DSN=YOUR.CD.LINKLIB
//DMNETMAP DD DISP=SHR,DSN=YOUR.CD.NETMAP
//DMPUBLIB DD DISP=SHR,DSN=YOUR.CD.PROCESS
//DMMSGFIL DD DISP=SHR,DSN=YOUR.CD.MSG
//NDMLOG DD SYSOUT=*
//NDMCMDS DD SYSOUT=*
//CDCMDS DD SYSOUT=*
//DMPRINT DD SYSOUT=*
//SYSIN DD *
SIGNON ESF=YES
SUBMIT PROC=SOMEPROC MAXDELAY=00:30:00
SIGNOFF
/*
Then in the process you use RUN TASK steps executing the DGADWAIT (DMRTWAIT) utility with conditional logic to determine what return code you would like to return to the DMBATCH batch job.
SOMEPROC PROCESS SNODE=CD.REMOTE.NODE
STEP1 COPY FROM (DSN=SOME.INPUT.FILE -
DISP=(SHR) PNODE) -
TO (DSN=SOME.OUTPUT.FILE -
DISP=(NEW,CATLG,DELETE) -
SNODE)
IF (STEP1 NE 0) THEN
RC08 RUN TASK (PGM=DMRTWAIT PARM=(0,08)) PNODE
ELSE
RC0 RUN TASK (PGM=DMRTWAIT PARM=(0,0)) PNODE
EIF
NOTE: DMRTWAIT can be coded on the PGM= parameter because it is an alias of DGADWAIT.
NOTE: This example is with basic coding, additional parameters could be required to execute the process properly.
UID
ibm11124043