Closing the internal reader data set

While your program is writing records to the internal reader data set, the internal reader facility is writing them into a buffer in your address space. Issue the CLOSE macro to close the internal reader data set, and to send the contents of the buffer to JES.

Filling the buffer in your address space sends the records to the JES for processing. JES considers a closed data set to be a completed job stream and treats it as input. You can also send an internal reader data set to the JES for processing by coding one of the following:
  1. Code /*EOF as the last record in the job.

    This control statement delimits the current job and makes it eligible for immediate processing by the JES2 input service. The internal reader data set remains open.

  2. Code /*DEL as the last record in the job.

    This control statement cancels the job, and requests the output from the job. The job is immediately scheduled for output processing. The output will consist of any JCL submitted so far, followed by a message indicating that the job has been deleted before execution.

  3. Code /*PURGE as the last record in the job.

    This control statement is used only by JES2 internal readers. It cancels the current job and schedules it for purge processing; no output is generated for the job.

  4. Code /*SCAN as the last record in the job.

    This statement also applies only to JES2 internal readers. It requests that the current job be scanned for JCL errors, but not executed.

You can put several groups of output records into the internal reader data set simply by starting each group with another JCL JOB statement. The following example illustrates this.
//JOBA     JOB   D58ELM1,MORRIS
//GENER    EXEC  PGM=IEBGENER
//SYSIN    DD    DUMMY
//SYSPRINT DD    SYSOUT=A,DEST=2NDFLOOR
//SYSUT2   DD    SYSOUT=(M,INTRDR)
//SYSUT1   DD    DATA
//JOBB     JOB   D58ELM1,MORRIS,MSGLEVEL=(1,1)
//REPORT1  EXEC  PGM=SUMMARY
//OUTPUT   DD    SYSOUT=*
//INPUT    DD    DSN=REPORTA,DISP=OLD
//JOBC     JOB   D58ELM1,MORRIS,MSGLEVEL=(1,1)
//REPORT2  EXEC  PGM=SUMMARY
//OUTPUT   DD    SYSOUT=A,DEST=3RDFLOOR
//INPUT    DD    DSN=REPORTB,DISP=OLD
/*EOF

In the preceding example, the IBM-supplied utility program IEBGENER is executed by job A. It reads from SYSUT1, and submits to the internal reader, jobs B and C, which are report-producing programs. Note that the message class for jobs B and C will be M, the SYSOUT class on the internal reader DD statement. Also, the OUTPUT data set from job B, because it specifies “*” (defaulting to the job's message class), will be class M.

The /*EOF control statement following the JCL indicates that the preceding jobs can be sent immediately to the job entry subsystem for input processing. Coding the CLOSE macro would have the same effect.

See z/OS JES2 Initialization and Tuning Guide or z/OS JES3 Initialization and Tuning Guide for more information about setting up and using internal readers.