Skip to main content

Introduction

In this exercise, you'll be working with invalid JCL templates. Your task is to identify and fix at least one error in each JCL to make them executable successfully.

You can also refer to How to create and Submit JCL.

Prerequisite

Before you can execute the JCLs below, create a dataset with RECFM=FB, LRECL=80, BLKSIZE=800 to store the REXX script named RETRC. The script is provided below:

/* REXX RETURN EXPECTED RC */
PARSE ARG RETCD
SAY RETCD
IF DATATYPE(RETCD) <> 'NUM' THEN RETCD = 0
EXIT RETCD

Exercise: Find and fix everything in JCL

Replace <Your ID> with your training ID and <YOUR REXX EXEC> with the REXX EXEC dataset created previously containing the RETRC member.

Task: Identify and fix at least one error in each of the JCL templates provided. Be mindful of the specific issues each template might contain and adjust accordingly.Examine the job log to identify why the step failed and fix the error in the JCL accordingly.

//<YOUR ID>A  JOB ,NOTIFY=&SYSU1D                             
//COMBINE EXEC PGM=IRXJCL,PARM='RETRC 2'
//SYSEXEC DD DSN=<YOUR REXX EXEC>,DISP=SHR
//SYSTSIN DD DUMMY
//SYSTSPRT DD DSN=&SYSU1D..EXERCISE.OUTPUT1,
// DISP=(MOD,CATLG),SPACE=(CYL,(2,2)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)

//<YOUR ID>B  JOB ,MSGLEVEL=0,1                             
//COMBINE EXEC PGM=IRXJCL,PARM='RETRC 2'
//SYSEXEC DD DSN=<YOUR REXX EXEC>,DISP=SHR
//SYSTSIN DD DUMMY
//SYSTSPRT DD DSN=&SYSUID..EXERCISE.OUTPUT2,
// DISP=(MOD,CATLG),SPACE=(CYL,(2,2)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)

//<YOUR ID>C  JOB ,NOTIFY=&SYSUID                             
//COMBINE EXEC PARM='RETRC 2',PGM=IRXJCL
//SYSEXEC DD DSN=<YOUR REXX EXEC>,DISP=SHR
//SYSTSIN DD DUMMY
//SYSTSPRT DD DSN=&SYSUID..EXERCISE.OUTPUT3,
// DISP=(MOD,CATLG),SPACE=(CYL,(2,2)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)

//<YOUR ID>D  JOB ,NOTIFY=&SYSUID
//OUTPUT1 EXEC PGM=IEFBR14
//SYSPRINT DD SYSOUT=*
// DD1 DD DSN=&SYSUID..EXERCISE.OUTPUT6,
// DISP=(MOD,CATLG),SPACE=(CYL,(2,2)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)

//<YOUR ID>E  JOB ,NOTIFY=&SYSUID
//OUTPUT1 EXEC PGM=IEFBR14
//SYSPRINT DD SYSOUT=*
//DD1 DD DSN=&SYSUID..EXERCISE,OUTPUT8,
// DISP=(MOD,CATLG),SPACE=(CYL,(2,2)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)

//<YOUR ID>F  JOB ,NOTIFY=&SYSUID
//OUTPUT1 EXEC PGM=IEFBR14
//SYSPRINT DD SYSOUT=*
//1DD DD DSN=&SYSUID..EXERCISE.OUTPUT9,
// DISP=(MOD,CATLG),SPACE=(CYL,(2,2)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)

//<YOUR ID>G  JOB ,NOTIFY=&SYSUID                             
//COMBINE EXEC PGM=IRXJCL,PARM=RETRC
// 2
//SYSEXEC DD DSN=<YOUR REXX EXEC>,DISP=SHR
//SYSTSIN DD DUMMY
//SYSTSPRT DD DSN=&SYSUID..EXERCISE.OUTPUTA,
// DISP=(MOD,CATLG),SPACE=(CYL,(2,2)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)

Exercise: Identify the Mistake

Review the following JCL snippets. Identify if there’s a problem with positional and keyword parameter usage. If there is an error, explain briefly what is wrong.

  • //JOBX JOB (123),'MYNAME',CLASS=A,MSGCLASS=X
  • //STEP1 EXEC PARM='RUN1',PGM=MYPROG
  • //INPUT DD DISP=OLD,DSN=MY.FILE.DATA

Exercise: Create JCL as per requirement

  • Add a comment line before a JCL step to explain its purpose. Ensure the comment line starts is ignored by the system.
  • Write a JCL statement that exceeds 71 characters and correctly continues it on the next line.
  • Write a JCL that includes a null statement to separate two job steps in the execution sequence, ensuring that the second step is still processed even if the first step fails.