CALL command in the background
Service aids, utilities, and other programs obtaining their input from an allocated file such as SYSIN must have the input in a data set or a job stream data set (one which contains the JCL to run the job and the data itself). After the data set is created, you can use the CALL command to execute the program that accesses the SYSIN data. Figure 1 illustrates the allocation and creation of input data sets. Information about command processing in the foreground and background is described in z/OS TSO/E User's Guide.
Figure 1. Allocating
and creating input data sets in the background
//EXAMP1 EXEC PGM=IKJEFT01,DYNAMNBR=20
//SYSTSPRT DD SYSOUT=A
//SYSTSIN DD *
profile prefix(user1)
allocate file (sysprint) dataset(*)
allocate file(sysin) altfile(inputdd)
call (prog1)
allocate file(sysin) altfile(inputdd2) reuse
call (prog2)
free all
//INPUTDD DD *
**input to prog1**
//INPUTDD2 DD *
**input to prog2**
/*
Note: Allocating the input file to a terminal results in an I/O error
message. Abnormal termination occurs when the program tries to get
input from the terminal.