Background:
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.
- Tell the system what program to execute
- Tell the system about the program inputs and outputs
- 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.
- // starting in column 1
- JCL is UPPERCASE
Only exception is lowercase in quotes for unix file names, unix parameters, etc. - The 2 most important JCL operations are:
EXEC
- used to tell system what program to execute
DD
- 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.
Example:
PAYROLL program is coded to -
read from file names
employee
payrate
taxrate
write to file names
paystub
totcash
CASH program is coded to -
read from file names
totcash,
cashbefr
write to file name
cashaftr
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.
- 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
Challenge:
Edit, modify, and submit JCL with correct spelling of the DDNAME needed by SORT utility program
- Submit JCL to execute a system program utility, SORT.
- Review JCL JOBNAME output to identify DDNAME spelling expected by SORT.
- Edit, modify, and submit JCL to verify successful execution.
- Edit, modify, and submit JCL to write data output based upon specfic sort criteria
where SORT program writes output to P2.OUTPUT(#05).
Reminder - substitute your ID for Z#####


Enter 's' to left of member name CH05JCL.

Enter ISPF commands as displayed below to remove ==MSG> lines and hilite JCL reserved words.

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 unique JOB number is assigned. In the example, the unique number is JOB00691.
Your unique JOB number will be different.


Enter ' ? ' to the left of JOBNAME SORT05 with the unique JOB number from above to display sections of the JOB output.

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 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.



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.