Service aids, utilities, and other programs obtaining their input from an allocated file such as SYSIN, must have the input in a created data set or a job stream data set that is created with a DD * or a DD DATA statement. After the data set has been created and allocated, the CALL command can be used to execute the program that accesses the SYSIN data. Figure 11 illustrates the allocation and creation of input data sets.
//examp1 exec pgm=ikjeft01,dynamnbr=20
//systsprt dd sysout=a
//systsin dd *
PROFILE PREFIX(yourid)
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**
/*
Figure 11. Allocating and Creating Input Data Sets
In the preceding example, the second allocate statement allocates the SYSIN data for PROG1, and specifies that the data is defined by the DD statement named INPUTDD. The third allocate statement allocates the SYSIN data for PROG2, and specifies that the data is defined by the DD statement named INPUTDD2. DD statements INPUTDD and INPUTDD2 use in-stream data as input.
Note: Allocating the input file to a terminal results in an I/O error message. Termination occurs when the program tries to get input from the terminal.
© 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 ]