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" in topic 2.7.3. 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.
The data set or message that you receive will be prefixed by the user ID that you supply on the JOB statement. To use an alternate prefix as the data set name, include the following command at the beginning of the SYSTSIN data stream:
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 12 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 12. Receiving a Data Set in the Background
Figure 13 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
/*
Figure 13. Receiving a Message in the Background
© Copyright IBM Corp. 1988, 2000
Return to library: [ OS/390 | TPF | VM | VSE | IBM Hardware | S/390 Redbooks | RS/6000 SP ]
Glossary - IBM Dictionary of Computing
How to: [ Order publications | Contact OS/390 ]