Relationship Between Programs and JCL
Part Two - Challenge #04


z/OS has a clever mechanism for a program to use different physical data sources without changing the program.
That mechanism is Job Control Language, JCL. Understanding JCL is required to claim average knowledge of z/OS.

Job Control is the best description of JCL. Therefore, think Job Control when learning about the syntax of JCL.

The previous challenge submitted JCL for processing and introduced JCL terminology and syntax.

Challenge #4 will:

  • elaborate on JCL terminology
  • demonstrate JCL terminology during the challenge
  • use JCL terminology to describe the challenge

To elaborate on JCL terminology, consider a PAYROLL program and a CASH program
where the programs open several filenames to read, process, and write.

PAYROLL program
  open filenames employee, payrate, taxrate as input
  open filenames paystub, totcash as output
  read filenames employee, payrate, taxrate
  process payroll program logic
  write filenames paystub, totcash

CASH program
  open filenames totcash, cashbefr as input
  open filenames cashaftr as output
  read filenames totcash, cashbefr
  process cash program logic
  write filename cashaftr

Observe the JCL below has JCL ddnames with same name as program filenames above

What is a JCL ddname?

  • A ddname is on a DD statement where DD is JCL syntax for Data Definition
  • The program requests access to inputs and outputs using filenames
  • A program filename needs a ddname where the filename = ddname
  • DD parameters describe the input/output data source to be accessed by the program

What is a JCL step?

  • Each EXEC statement starts a new step
  • A step includes the EXEC statement and the following DD statements
  • A stepname is coded immediately after // on the EXEC statement
  • A subsequent EXEC statement is the end of the previous step and start of a new step

Description of a few DD parameters describing the data input/output resources

  • DSN=value - where value is a data set name
  • PATH=value - where value is a unix filename
  • DISP=value - where value is data set name or unix filename disposition, such as NEW, OLD, SHR, CATLG
  • *   - an asterisk(*) where what follows the DD * is in-stream data or control statements the program would recognize

Additional information will be presented about JCL features and functions in later challenges.
For now, let's start with a challenge based upon the background information.


Outline of challenge activity:

  1. Edit source data set
  2. Select data set member
  3. Submit JCL procedure to compile COBOL program source code into machine executable module
  4. Edit JCL data set and copy in new JCL member to execute COBOL program
  5. Submit JCL to execute COBOL program
  6. Locate messages in output describing why COBOL program execution failed
  7. Identify and correct problem

The problem is a matter of failure to open a program filename.
The program filename fails to find the corresponding JCL ddname.

Once the problem is corrected, program execution writes messages to P2.OUTPUT(#04)

Fewer Screen Shots: The instructions assume learned ability to navigate ISPF, ISPF Editor, and SDSF panels from the previous challenges. Instructions below assume you know where and how to enter the commands.

1. Edit source data set

e Z99999.SOURCE

2. Select member name, cblrdwr, in the source data set

s cblrdwr

  • The first few lines are JCL that execute a JCL "procedure"
      The IGYWCL JCL procedure will be located and expanded once submitted
      Expansion of IGYWCL executes the COBOL compiler program, then executes a system utility to create an executable module.
  • Following the DD * is COBOL program source code
      Quickly browse the COBOL syntax and comments
      Instructions will refer back to this syntax later in the challenge
      Reminder - F8 to page down, F7 to page up - when SCROLL ===> CSR - page up and down relative to cursor position

Optional: to hilite COBOL reserved words, enter hilite cobol

4. Submit JCL to compile COBOL program source code, jump to SDSF, and proceed to SDSF status panel

submit; =sd; st

  • Review CBLRDWR output
      Use s and/or ? in the NP column to review ouput
      JCL JOB should complete successfully RC 00
      If curious, the output is expansion of IGYWCL JCL procedure to compile the COBOL program source code

5. Submit JCL to execute program CBLRDWR

tso submit jcl(job04)

  • Review JOB04 output
      Use s and/or ? in the NP column to review ouput
      JCL JOB failed RC = U4038

6. Locate messages in output describing why COBOL execution failed

  • Carefully read JOB04 SYSOUT ddname output section
    SYSOUT ddname provides problem description and key to corrective action

7. Identify and correct problem

  • JOB04 JCL follows for review
      What follows //RECIN DD * is opened and read by PGM=CBLRDWR
      The physical output location is DSN=&SYSUID..P2.OUTPUT(#04)
        where &SYSUID. is a system symbolic that is replaced with your ID at time of execution
        where DISP=SHR means the data set exists and can "shared"
  • CBLRDWR COBOL source code follows for your review
      Asterisk in column 7 of COBOL source is a comment
      Carefully read the comment statements
      Linkage exists between COBOL program source code and JCL

Correct the JOB04 JCL DDNAME to match COBOL output internally assigned filename
=3.4 to jump to Data Set List Utility panel
  Edit, correct, and submit JCL(JOB04)

Once problem is identified, correct the problem in JCL JOB04 and verify correction by submitting JOB04.
Successful execution of JCL JOB04 writes P2.OUTPUT(#04)

The solution is very simple and proves an understanding of the relationship between a z/OS program and JCL.

Next: Challenge #05