MainframeMaster

COBOL Tutorial

READERS - JES Input Readers and INTRDR

Progress0 of 0 lessons

Overview

READERS (JES input readers) bring jobs into the mainframe system. The internal reader (INTRDR) is a special destination that lets programs submit JCL dynamically. This is how one job can generate and submit another job.

📬 Analogy

Imagine a mailbox (reader) where you drop letters (JCL). The internal reader is like a mail chute inside the building—your program drops a letter and the post office (JES) picks it up immediately.

Submit JCL via INTRDR

One pattern is to OPEN a file routed to the internal reader and WRITE each line of the JCL. Your program then closes the file; JES ingests the job.

JCL Allocation Example

jcl
1
2
3
//SUBMIT JOB ACCT,'SUBMIT VIA INTRDR' //STEP1 EXEC PGM=MYCOBOL //INTRDR DD SYSOUT=(A,INTRDR)

The DD routes output lines to the internal reader. The COBOL program writes JCL lines to DD INTRDR.

COBOL Program (Conceptual)

cobol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
IDENTIFICATION DIVISION. PROGRAM-ID. SUBMITTER. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT JCL-OUT ASSIGN TO INTRDR. DATA DIVISION. FILE SECTION. FD JCL-OUT RECORD CONTAINS 80 CHARACTERS. 01 JCL-LINE PIC X(80). PROCEDURE DIVISION. OPEN OUTPUT JCL-OUT MOVE '//JOB1 JOB (ACCT),CLASS=A,MSGCLASS=X' TO JCL-LINE WRITE JCL-LINE MOVE '//STEP1 EXEC PGM=IEFBR14' TO JCL-LINE WRITE JCL-LINE CLOSE JCL-OUT STOP RUN.

Site-specific assignments may differ. Coordinate with system programming for required DD setup and authorities.

Non-Code Example

  • Nightly billing job creates end-of-day archive JCL
  • Program writes the JCL to INTRDR
  • Archive job appears in JES queue and runs automatically

Best Practices and Pitfalls

Best Practices

  • Gate submission behind approvals or configuration flags
  • Log the job text and Job ID returned by JES (if available)
  • Validate generated JCL to avoid stuck jobs in the queue
  • Use job classes and routing that match the workload

Common Mistakes

MistakeProblemFix
Missing authoritySecurity violation or job rejectedRequest access to INTRDR, follow standards
Malformed JCLJob abends or stays in input error queueValidate before submit; include test path
Submitting too many jobsQueue congestion and WLM issuesThrottle submissions; use proper classes

Quick Reference

ConceptDefinitionExample
ReaderJES component that ingests jobsTerminal/RJE/INTRDR
INTRDRInternal reader destinationSYSOUT=(A,INTRDR)
Program submissionWrite JCL lines to INTRDROPEN OUTPUT, WRITE records

Test Your Knowledge

1. What is a JES input reader?

  • A COBOL intrinsic function
  • A JES component that accepts job input (JCL)
  • A DB2 precompiler tool
  • A dataset compression utility

2. What is the internal reader (INTRDR)?

  • A dataset used to store reports
  • A pseudo printer destination that submits JCL back to JES
  • A COBOL keyword
  • A CICS transaction

3. How can a COBOL program submit a job?

  • By writing JCL lines to a file assigned to SYSOUT with writer INTRDR
  • By performing COMPUTE
  • By using GO TO
  • It is impossible

4. Why use the internal reader?

  • To interactively request operator replies
  • To automate job submission from programs
  • To format report headings
  • To allocate VSAM

5. Is READERS a COBOL verb?

  • Yes
  • No

Frequently Asked Questions