z/OS JCL Assignment Pack

Please note that Chapter-based exercises are copyright by Mike Murach & Associates, Inc., 2002.

Chapter 3 How to use ISPF to manage your JCL 3

METROPOLITAN COMMUNITY COLLEGE CPT 115—IBM MVS Job Control Language Assignment 1—PUNCH AND RUN 4

Chapter 4 The basics of Job Control Language 5

METROPOLITAN COMMUNITY COLLEGE CPT 115—IBM MVS Job Control Language JCL PROBLEM 2 7

Chapter 5 How to use JCL and JES facilities to manage program execution 9

Chapter 6 How to use JCL facilities to allocate other types of DASD data sets 10

Chapter 7 How to manage tape data sets 11

Chapter 8 How to manage SYSOUT data sets 12

Chapter 9 How to use JCL procedures 13

METROPOLITAN COMMUNITY COLLEGE CPT 115—IBM MVS Job Control Language JCL PROBLEM 3 14

METROPOLITAN COMMUNITY COLLEGE CPT 115—IBM MVS Job Control Language JCL PROBLEM 3 (REVISED) 15

Chapter 10 How to process jobs conditionally 16

Chapter 11 How to use RESTART and other program execution facilities 17

Chapter 12 How to manage generation data groups 18

Chapter 13 How to use the SMS facilities for data set allocation 19

Chapter 15 How to use JCL for VSAM data sets 20

Chapter 16 How to use Access Method Services (AMS) 21

METROPOLITAN COMMUNITY COLLEGE CPT 115—IBM MVS Job Control Language JCL PROBLEM 5 22

Chapter 17 How to use JCL procedures to compile and test programs 23

Chapter 18 How to use the OS/390 utility programs 24

Chapter 19 How to use the sort/merge utility 25

METROPOLITAN COMMUNITY COLLEGE CPT 115—IBM MVS Job Control Language JCL PROBLEM 4 26

Chapter 20 How to use TSO, CLIST, and REXX 27

Chapter 21 How to use UNIX System Services 28


Chapter 3
How to use ISPF to manage your JCL

Exercises

1. Find out the procedures used at your installation to log on to and access ISPF, including your TSO user-id and password.

2. Use the ISPF editor to create a library member that contains the following JCL statements to run an IBM utility program named IEBGENER (find out from your supervisor or instructor the details for coding the JOB card and the library and member name to use):

//jobname JOB 36512,'your name here'

// EXEC PGM=IEBGENER

//SYSPRINT DD SYSOUT=*

//SYSUT1 DD *

This is a sample test file.

This is a sample test file.

This is a sample test file.

This is a sample test file.

This is a sample test file.

/*

//SYSUT2 DD SYSOUT=*

//SYSIN DD DUMMY

3. Submit the job created in exercise 2 for processing. It creates a SYSOUT file (SYSUT2) that contains the line “This is a sample test file.” 5 times. It also creates a second SYSOUT file (SYSPRINT) that contains output messages generated by the program.

4. Use SDSF to view the results of your job (use the Outlist utility if SDSF is not available). If the job did not execute because of a JCL error, use the ISPF editor to correct the mistake and resubmit the job.

METROPOLITAN COMMUNITY COLLEGE
CPT 115—IBM MVS Job Control Language
Assignment 1—PUNCH AND RUN

OBJECTIVE:To familiarize the student with the process of submitting jobs to the IBM system.

Code the following JCL to create and print an in-stream data set using the IEBGENER utility program.

Code the JOB statement following your installation's standards.

Code the following JCL statements:

//STEP1 EXEC PGM=IEBGENER

//SYSPRINT DD SYSOUT=*

//SYSUT1 DD *

(Type in a paragraph containing:

your name

work experience

what you hope to learn from this class)

//SYSUT2 DD SYSOUT=*

//SYSIN DD DUMMY

Chapter 4
The basics of Job Control Language

Exercises

1. Code a JOB statement for a job named EXJOB1. Include the following additional information in the JOB statement:

a. accounting information: 36512

b. programmer name

c. the job should notify your user-id when it completes

d. a message class of A

e. a message level specification that prints JCL statements as well as all messages

2. Code an EXEC statement to run a program named CHK1150 in a job step named CHKPR1.

3. Add a PARM parameter to the EXEC statement from exercise 2 that passes “CK=5” to program CHK1150.

4. Code a DD statement that allocates an existing, cataloged data set named PRD.PAY.MASTER. The ddname for the statement is PAYMAST.

5. Using the following system flowchart and data set requirements, code the JCL necessary to execute the specified job. Allocate 20 cylinders of primary space and 10 cylinders of secondary space on volume TSO001 to each output file. Delete the spec, detail, and summary files once they’ve been used to produce the reports.

System flowchart

Data set requirements

Step name Program ddname Data set name

FPR0100 FPR0100 FLDPLOT MM01.FPR.PLOT

SPECFILE MM01.FPR.SPECFILE

DETAIL MM01.FPR.DETAIL

SUMMARY MM01.FPR.SUMMARY

FPR0200 FPR0200 SPECFILE MM01.FPR.SPECFILE

DSGNRPT SYSOUT

FPR0300 FPR0300 DETAIL MM01.FPR.DETAIL

DETLRPT SYSOUT

FPR0400 FPR0400 SUMMARY MM01.FPR.SUMMARY

SUMMRPT SYSOUT

METROPOLITAN COMMUNITY COLLEGE
CPT 115—IBM MVS Job Control Language
JCL PROBLEM 2

OBJECTIVE: To familiarize the student with creating a library, storing a member in the library and printing a member of the library.

Note: The IEBUPDTE utility program is not covered in the current OS/390 and z/OS JCL textbook. It was used to maintain libraries (partitioned data sets or PDSs) via batch jobs. This function is now mostly performed via ISPF. The IEBGENER program is covered in detail in Chapter 18.

Code a two step job, the first step will add a member to a temporary partitioned data set (a library). The next step will print that member.

1. In the first step:

a. Execute the program IEBUPDTE

b. Pass the program a PARM parameter of NEW

c. Allocate a SYSPRINT file

d.Allocate a SYSUT2 file to create a temporary PDS. Use three tracks of primary storage and two directory blocks. Do not catalogue the data set but pass it to the next step. Use SYSDA as the unit device. Record length is 80.

e. Allocate a SYSIN instream file using the following cards

./ADD NAME=JCLxxx,LIST=ALL

(Here type in the records on p. 64 in the textbook.

Use the following format:

1-11 Social Security Number

12-20 First Name

21 Initial

22-30 Last Name

31-35 Employee Number

Type in one additional record containing your name

and numbers.)

./ ENDUP

2. In the second step:

a. Execute the program IEBGENER

b. Allocate a SYSPRINT file

c. Allocate a SYSUT2 printer file

d. Allocate a SYSIN file and DUMMY it out

e. Allocate a SYSUT1 file that refers to the temporary PDS created in step 1. Include the

member name as part of the data set name.

*** In the references to JCLxxx replace the xxx with your

initials.

Chapter 5
How to use JCL and JES facilities
to manage program execution

Excercises

1. Code a JOB statement that specifies job execution class Q and scheduling priority 8, such that the job will be held in the job queue until the operator releases it for execution.

2. Code an EXEC statement that executes a program named KZB0100 and limits the region to 6MB.

3. Code a JOB statement that limits the job’s total execution time to 4 hours and the number of pages of SYSOUT data to 5000.

Refer to the JCL statements below to answer the three questions that follow.

1-->

//jobname JOB 36512,'X XXXXXXX',NOTIFY=userid

2-->

//STEP1 EXEC PGM=EGAX401

3-->

//SYSOUT DD SYSOUT=A

4-->

//STEP2 EXEC PGM=EGAX402

5-->

//SYSOUT DD SYSOUT=A

6-->

4. Code a DD statement that allocates PROD.LOADLIB as a job library, then indicate the position in the job stream above where you would insert the DD statement.

5. Code a DD statement that allocates TEST.LOADLIB as a step library for program EGAX401, then indicate the position in the job stream above where you would insert the DD statement.

6. Code a DD statement that allocates a formatted system dump of the user region of the job’s private address space if STEP2 abends, then indicate the position in the job stream above where you would insert the DD statement.

Chapter 6
How to use JCL facilities to allocate
other types of DASD data sets

Exercises

1. Code two DD statements to process a temporary data set. The first DD statement should use the ddname X401EXTR and should allocate 20 cylinders of primary space and 10 cylinders of secondary space on a SYSDA unit named TSO001. The second DD statement, which would appear in a subsequent job step, should use the same ddname. It should allocate the passed temporary data set and delete it when the step completes.

2. Code a DD statement for a dummy data set using the ddname X401PARM.

3. Code the DD statements required to concatenate three partitioned data sets named MM01.COBLIB.PRIVATE, TEST.COBLIB, and SYS1.COBLIB using the ddname SYSLIB.

4. Code a DD statement that allocates three SYSDA-class DASD volumes named TSO001, TSO002, and TSO003 for a new data set named EGAX.SAMPLE. Provide for up to 250 cylinders of primary space and 100 cylinders for secondary allocations.

5. Examine the following SPACE parameters:

SPACE=(CYL,(20,5),,CONTIG)

SPACE=(CYL,(20,5),RLSE)

SPACE=(CYL,(20,5),,ALX)

SPACE=(CYL,(20,5),,MXIG)

a. Which of the parameters above releases any unused space so other data sets can use it?

b. Which requests a contiguous space allocation?

c. Which allocates the largest extent available on a volume?

d. Which allocates the five largest extents available on a volume?

6. Code a DCB parameter to refer back to a previous DD statement defined in a previous job step named UP1. The previous ddname is UPFILE.

7. Code an IEFBR14 job step that deletes a cataloged data set named X401.TEMP.SAMPLE.

Chapter 7
How to manage tape data sets

Exercises

1. Code a DD statement that creates a tape data set named X401.JOURNAL on a single non-specific private tape volume. Specify a block size of 16,384.

2. Code a DD statement to allocate the first data set on a labelled tape whose volume serial number is 555123. The data set is sequential with fixed-length 80-byte records blocked in 16,000-byte blocks.

Chapter 8
How to manage SYSOUT data sets

Exercises

1. Modify the following job stream so that all of its SYSOUT data sets except PRDETL use a default OUTPUT statement that prints 2 copies of each data set using SYSOUT class B. The PRDETL data set should reference an OUTPUT statement named OUT1 that prints 4 copies using SYSOUT class B.

//MM01E8A JOB 36512,'X XXXXXXX',NOTIFY=userid

//STEP1 EXEC PGM=PR3310

//SYSOUT DD SYSOUT=A

//PRLIST DD SYSOUT=A

//PRSUM DD SYSOUT=A

//PRDETL DD SYSOUT=A

2. Code a DD statement to create a SYSOUT data set that uses SYSOUT class D, that is limited to 2000 lines, and that is held in the output queue until released by the operator. Use the ddname HOLDOUT.

3. Code a DD statement to create a SYSOUT data set that uses SYSOUT class C, that starts printing after the first 700 pages are produced, and that is routed to remote printer H220. Use the ddname INSTRPT.

4. Modify the job stream shown in exercise 1 so that it uses JES2 or JES3 control statements to print 2 copies of the PRLIST and PRSUM data sets and 4 copies of the PRDETL data set.

Chapter 9
How to use JCL procedures

Exercises

1. Assume the following procedure is cataloged under the name DUMP:

//STEP1 EXEC PGM=IEBGENER

//SYSPRINT DD SYSOUT=*

//SYSUT1 DD DUMMY

//SYSUT2 DD DUMMY
//SYSIN DD DUMMY

Code a job stream that invokes the procedure, overriding the SYSUT1 DD statement so that it refers to a cataloged data set named MM01.ENGR.SAMPLE.

2. Code a procedure named CMPROC1 that consists of the following step:

//CM1000 DD PGM=CM1000

//CMMAST DD DSN=MSYS.CM.MASTER,DISP=SHR

//CMTRANS DD DSN=MSYS.CM.TRANS,DISP=SHR

//CMRPT DD SYSOUT=A

Instead of identifying a specific data set for the CMTRANS DD statement, allow the user to specify the name of the transaction file to be processed by coding the parameter TRANS=name on the EXEC statement that invokes the procedure, like this:

// EXEC CMPROC1,TRANS=MM01.CM.TRANS

3. Code a JCLLIB statement that allocates MM01.PROCLIB as a private procedure library, then indicate the position in the job stream below where you would insert the JCLLIB statement.

1-->

//MM01E8C JOB 36512,'X XXXXXXX',NOTIFY=userid

2-->

//STEP1 EXEC PRINT

3-->

4. Suppose that the DD statement for a data set named EGA.CUSTOMER.EXTRACT resides in the member named X401EXTR in a private procedure library. Code an INCLUDE statement that includes this DD statement in a job stream.

METROPOLITAN COMMUNITY COLLEGE
CPT 115—IBM MVS Job Control Language
JCL PROBLEM 3

OBJECTIVE: to familiarize the student with use of in-stream procedures.

Recode problem 2 making the IEBGENER step an in-stream procedure.

Follow the instructions given in Exercise 2, page 275 in the previous edition of the text. To wit: Code a procedure named PRINT that invokes the IEBGENER utility to print a cataloged data set. Allow the user to specify the name of the data set to be printed by coding the parameter DSN=name on the EXEC statement that invokes the procedure, like this:

// EXEC PRINT,DSN=SYDOE.ENGR.SAMPLE

The job will contain the following:

1.The code for the in-stream procedure.

2.The code to execute the IEBUPDTE program to create a temporary PDS and put member JCLxxx in it. (Same as problem 2).

3.The code to execute the in-stream procedure that will print member JCLxxx of the temporary PDS.

METROPOLITAN COMMUNITY COLLEGE
CPT 115—IBM MVS Job Control Language
JCL PROBLEM 3 (REVISED)

OBJECTIVE: to familiarize the student with use of symbolic parameters and the DDNAME parameter in procedures.

Make the following changes to the proc in PROBLEM 3:

1.  Include both the IEBUPDTE and IEBGENER steps in the in-stream procedure. (Remember that procs cannot contain in-stream data).