RECEIVE Command
You can use the RECEIVE command in a background job to receive a message or data set. However, if your installation uses security labels, there will be security constraints placed on the use of the RECEIVE command. These constraints are explained in Security Considerations for Sending and Receiving Data Sets. To use RECEIVE in the background, you must specify the RECEIVE command and the responses to any prompts that you would anticipate when using RECEIVE in the foreground. Supply the responses in the same order as they would appear in the foreground. The commands are executed as if PROFILE NOPROMPT was entered.
PROFILE PREFIX(prefix)Be sure that any alternate prefix you use is a valid catalog alias.
Messages are written to the data set defined in the SYSTSPRT DD statement.
Figure 1 shows a batch job for receiving a data set in the background.
//JOBNAME JOB USER=USERID,PASSWORD=PASSWD
//STEP1 EXEC PGM=IKJEFT01,REGION=512K
//SYSTSPRT DD SYSOUT=A
//SYSTSIN DD *
RECEIVE
RESTORE
**responses to anticipated prompts**
r
/*
Figure 2 shows a batch job for receiving a message in the background.
//JOBNAME JOB USER=USERID,PASSWORD=PASSWD
//STEP1 EXEC PGM=IKJEFT01,REGION=512K
//SYSTSPRT DD SYSOUT=A
//SYSTSIN DD *
RECEIVE
/*