Setting up and using an internal reader

The internal reader is a software substitute for a card punch and a card reader, a tape drive, or a TSO/E terminal. Instead of entering a job into the system (through JES) on punched cards, or through tape, you can use the output of one job or step as the input to another job, which JES will process directly.

The internal reader facility is useful for several kinds of applications:
  • You can use it to generate another job or a series of jobs from an already-executing job. An online application program may submit another job to produce a report, for example, so it does not have to do it itself.
  • A job that produces a series of jobs can put its output to an internal reader for immediate execution. For example, a job that updates data bases and starts other applications based upon some input parameters or real-time events, can use the internal reader for its output.
  • The operator can start utility programs to read jobs from disk or tape files and submit them to the system. The IBM-supplied procedure ‘RDR’ is an example of a program that does this (see z/OS JES2 Initialization and Tuning Guide).
  • The operating system itself uses internal readers for submitting the JCL to start up started tasks or TSO/E logons.

Following is a discussion of the batch job internal reader, which is the facility you can use to submit a job from within another job.

The process of setting up and using an internal reader involves five tasks:
  • Creating and allocating a data set
  • Opening the data set
  • Putting records into the data set
  • Closing/deallocating the data set
  • Passing the data set/records to the job entry subsystem for processing

Started tasks that run under the MSTR subsystem have the ability to set up an internal reader. To accomplish this they must first successfully invoke the Request Job ID SSI call, and then perform allocation. For more information on the Request Job ID call (SSI function code 20), see z/OS MVS Using the Subsystem Interface.