WAIT={YES | NO | ASYNC | ASYNCWAIT}

Default NO
Allowable Values YES, NO, ASYNC, ASYNCWAIT
Minimum Not Applicable
Maximum Not Applicable

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).

The valid values are as follows:
  • 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.
    Note: A maximum of 500 transfers can be submitted asynchronously. If more than 500 transfers are submitted as a result of the directory transfer, transfers over 500 are submitted with WAIT=YES.
Note: Pay attention to the following points, when using ASYNC or ASYNCWAIT on a directory receive transfer:
  • You can not receive multiple files to a PDS. The PDS can become corrupted if multiple transfers are written to the PDS at the same time. You must use WAIT=YES when writing to a PDS.
  • When receiving multiple files to a LIBRARY, the library must exist. It cannot be created by the transfer.
See the following example:
//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.