Job Control Language, JCL
Part Two - Challenge #05


You will learn about the input/output relationship between program execution and JCL

In challenge #04 you submitted JCL for execution and viewed the output.

In challenge #05 you will learn the basics of JCL.

Focusing on the purpose of JCL can make JCL easy to learn.
Purpose of JCL:
  • Tell the system what program to execute
  • Tell the system about the program inputs and outputs
z/OS Application Program Execution
  • A program reads, writes, and updates file names.
  • A program has internally coded file names.
  • A program is without any information about the physical data sources.

How does a program find the physical data sources to read, write, or update using the
internal file name?

The answer is JCL.

JCL Syntax
  • // starting in column 1
      Only exception is lowercase in quotes for unix file names, unix parameters, etc.
  • The 2 most important JCL operations are:
       - used to tell system what program to execute
       - used to identify program inputs and outputs

JCL DD, Data Definition, operation is used to associate a program file name with a physical data source.


PAYROLL program is coded to -
  read from file names
  write to file names

CASH program is coded to -
  read from file names
  write to file name

JCL below has JCL DD operations with ddnames spelled exactly as the program file names from above.

What is a JCL ddname?

  • A ddname is on a DD operation 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 operation starts a new step
  • A step includes an EXEC operation followed by DD operations
  • A stepname is coded immediately after // on the EXEC operation
  • A subsequent EXEC operation 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

The program determines JCL the ddname.

If a program file name does not have an associated JCL ddname, then the program execution will fail reporting no ddname found for the program file name.

JCL DD Operation Summary
  • Begins with //
  • DDNAME immediately after // on the same line
      where DDNAME must match the program coded internal file name
  • DD is after the DDNAME on the JCL line
  • Parameters used to describe input/output physical resource is after DD on the JCL line
      More about DD parameters later


Edit, modify, and submit JCL with correct spelling of the DDNAME needed by SORT utility program
Below describes the screen shots requiring action by you to complete the challenge
  1. Submit JCL to execute a system program utility, SORT.
  2. Review JCL JOBNAME output to identify DDNAME spelling expected by SORT.
  3. Edit, modify, and submit JCL to verify successful execution.
  4. Edit, modify, and submit JCL to write data output based upon specfic sort criteria
      where SORT program writes output to P2.OUTPUT(#05).
Enter dslist command from ISPF as follows to display Data Sets Matching Z#####.JCL
  Reminder - substitute your ID for Z#####
In the command column enter 'e' to the left of the partitioned data set name Z#####.JCL as displayed below.
A partioned data set has member names.

Enter 's' to left of member name CH05JCL.
ISPF EDIT is now able to modify member name CH05JCL in the partitioned data set Z#####.JCL.

Enter ISPF commands as displayed below to remove ==MSG> lines and hilite JCL reserved words.
Take note of line 000005 with '//DDNAME DD' syntax.

Big Hint: EXEC PGM=SORT does not expect a file name with spelling of 'DDNAME' in the SORT program.

Line 000005 DD DSN=&SYSUID..P2.OUTPUT(#05),DISP=SHR are the correct parameters describing SORT program physical resource for the sorted output.

The objective is to determine the correct DDNAME spelling.

Enter commands as seen below to submit JCL to execute the SORT program, then jump to SDSF status display.
A message that JOB SORT05 submitted is displayed.

A unique JOB number is assigned. In the example, the unique number is JOB00691.

Your unique JOB number will be different.
A message that JOB SORT05 ended with MAXCC=0016 is displayed.
The commands =sd ; st previously entered will display the SDSF STATUS panel.

Enter ' ? ' to the left of JOBNAME SORT05 with the unique JOB number from above to display sections of the JOB output.
JESMSGLG, JESJCL, and JESYSMSG are DDNAMEs generated by the system.

Program SORT expected DDNAME SYSOUT and wrote execution information in SYSOUT.

Enter ' s ' to the left of DDNAME SYSOUT to select what program SORT wrote about the execution.
The messages that begin with ICE are messages written by program SORT.

The ICE message that ends with ' A ' indicates an action is required for a successful execution.

Program SORT was looking for a specific DDNAME and wrote NOT FOUND.
  The SORT required DDNAME is on the same message line.

The JCL needs modification based upon the SORT message.

Last, use dslist command to jump to Z#####.JCL partitioned data set name.
Edit Z#####.JCL
Select member name CH05JCL
Given the hints, correct the JCL to allow SORT program to write the sorted output to data set name Z#####.P2.OUTPUT member name #05

NOTE: System variable &SYSUID. in JCL is automatically substituted with your ID.

Correct JCL, submit, and view the new SORT05 JOBNAME output for success.

The challenge created member #05 in data set name P2.OUTPUT from SORT program output produced by JCL JOBNAME SORT05.

Congratulations! You are done with challenge #05 and you ready for the next challenge.

Next: Challenge #06