Joined: 26 Apr 2004 Posts: 4650 Location: Raleigh, NC, USA
From the User's Guide:
You can also use the CDWAIT and CDPOST programs to synchronize the operation of batch job streams and the execution of a Process. Normally, after a job stream executes a DMBATCH step to submit a Process, the next step in the job is given control immediately. This control transfer normally occurs before the Process completes. Subsequent steps in the job stream, therefore, cannot do any processing that depends on the successful completion of the Process.
By using CDWAIT in place of DMBATCH and modifying the Process slightly, you place the job stream in a wait status until CDPOST is executed with RUN TASK from the Process. Executing CDPOST brings CDWAIT out of the wait state and enables it to complete. You can also set a return code that CDWAIT completes with, indicating success or failure.
Two parameters are passed in the CDWAIT parameter list in the format mm:ss,xxxxxxx, where mm:ss is the number of minutes and seconds to wait for the cross-memory post to be received (2 minutes in the example) and xxxxxxx represents the input parameters for DMBATCH (YYLLYYY
in the example).
If CDWAIT is not posted within the time period specified in the parameter, it completes with a return code of 209. CDWAIT calls DMBATCH to process the input (SYSIN) commands and then waits for CDPOST. CDWAIT passes its ASCB and ECB address to CDPOST. CDPOST uses
cross-memory services to POST CDWAIT.
CDWAIT may issue the following return codes:
Return Code Cause of Return Code
201 NO PARMLIST SPECIFIED
202 2ND PARM NOT SPECIFIED
203 TOO MANY PARMS
204 1ST PARM LENGTH WRONG
205 2ND PARM LENGTH WRONG
206 ASCB-ECB RECORD NOT FOUND
207 ASCB FIELD NOT FOUND OR WRONG
208 ECB FIELD NOT FOUND OR WRONG
209 TIMER EXPIRED BEFORE TASK DONE
Note: The amount of Connect:Direct activity, the relative loading of the network, and activity on the remote node can introduce queuing and performance delays. Therefore, a Connect:Direct Process may not complete within the time window you specify in CDWAIT. In this situation, do not use CDWAIT and CDPOST.