WAIT={YES | NO | ASYNC | ASYNCWAIT}
This parameter defines the job to wait for the file transfer to finish before proceeding. If you specify WAIT=YES in the parameters of a batch job, the batch job does not continue processing until the transfer is completed. If the transfer is not completed successfully, the step ends and a code is returned indicating the reason for the failure. Do not specify WAIT=YES when multi-tasks are performed (that is, when you are using a distribution list).
- YES: the transfer request waits until the transfer is completed.
- NO: the transfer request is completed when the request is scheduled.
- ASYNC: used for directory transfers. The job waits until all transfers are scheduled. However, the job does not wait for transfers to be completed.
- ASYNCWAIT: used for directory transfers only. Transfers are submitted asynchronously and the job is not completed until all transfers are completed.
//BATCHJOB JOB 555,'USER NAME',MSGCLASS=X,NOTIFY=USERID,REGION=4M //* //OSIUB000 EXEC PGM=OSIUB000,PARM='SERVER=CFSERVER' //STEPLIB DD DISP=SHR,DSN=FUSION.LOADLIB //SYSUDUMP DD SYSOUT=* //SYSPRINT DD SYSOUT=* //SYSIN DD * ************************************************************** * Send and wait till it is done * ************************************************************** PROCESS,REPORT,TRANSFER,SEND DSN=USER1.SALES.REPORT REMOTE_FILE=C:\FILES\RPT1 TYPE=BINARY EFFECT=CR NODE=WINSRV1 WAIT=YES REMOTE USER=Administrator RPASS=password RETRY=1 ************************************************************** PROCESS,BATCH,TRANSFER,SEND DSN=USER1.JCL(PCBATCH) REMOTE_FILE=C:\FILES\JCL1 TYPE=BINARY EFFECT=CR NODE=WINSVR1 REMOTE USER=Administrator RPASS=password RETRY=1
In this example, a single step includes two transfers. If the first transfer fails, this step terminates, and all transfers following it will not be executed.
Use this method when the second transfer is dependent on the outcome of the first transfer. A transfer that is not dependent upon the outcome of a previous transfer, accomplished by specifying the WAIT parameter, cannot be included in the same step (as a transfer that includes the parameter). This ensures that the job is executed regardless of the outcome of the previous transfer.
For how this parameter can be used with the z/OS IF/THEN/ELSE/ENDIF JCL parameters to initiate additional transfers at the end of a transfer based upon the success or unsuccessful completion of the previous step, see Appendix F. WAIT Parameter for IF/THEN/ELSE/ENDIF.