8

2 Jcl Jcl Fundamentals Case Study Ver3.0

Embed Size (px)

Citation preview

Page 1: 2 Jcl Jcl Fundamentals Case Study Ver3.0
Page 2: 2 Jcl Jcl Fundamentals Case Study Ver3.0

Job Control Language

Exercises & Case Study Ver. 3.0

For Internal Use Only Page 2 of 8

JCL EXERCISES

& CASE STUDY

DOCUMENT CONTROL

Version Date Author Comments

1.0 01 August 2006 TCS Initial

2.0 20 June 2008 TCS –IBM COE Updated as per SAMARTH

Competency Model

3.0 01 July 2009 TCS –IBM COE Changed the Errors that were

Identified

Page 3: 2 Jcl Jcl Fundamentals Case Study Ver3.0

Job Control Language

Exercises & Case Study Ver. 3.0

For Internal Use Only Page 3 of 8

Table of Contents

1. THE REQUIREMENT STATEMENT: .......................................................................... 4

2. PROCESS STEPS: ..................................................................................................... 4

A. PROCESS STEPS FOR JCL EXERCISES: ............................................................... 4

1. JOB STATEMENT ..................................................................................... 4

2. EXEC STATEMENT .................................................................................. 5

3. DD STATEMENT ..................................................................................... 5

B. PROCESS STEPS FOR JCL CASE STUDY ............................................................. 6

1. CASE STUDY 1 .............................................................................................. 6

2. CASE STUDY 2 .............................................................................................. 7

3. CASE STUDY 3 .............................................................................................. 7

Page 4: 2 Jcl Jcl Fundamentals Case Study Ver3.0

Job Control Language

Exercises & Case Study Ver. 3.0

For Internal Use Only Page 4 of 8

JOB CONTROL LANGUAGE

1. The Requirement Statement: This exercise is aimed at providing a complete knowledge on all the important and frequently used commands, options and facilities of Job Control Language (JCL). You are requested to have this exercise beside you when you are on a terminal connected to a Z/OS system and make use of this in your practical session strictly in the sequence of steps given.

Note: - Process Step A (Exercises) needs to be done as a Class Room discussion and should be completed within 2.5 hours and Process Step B (Case Study) needs to be done on Mainframes and needs to be completed within 5.5 hours.

2. Process Steps:

A. Process Steps for JCL Exercises:

1. JOB STATEMENT Find out the JCL errors if any in the following statements. Correct the errors.

1. // JOBNAME1 JOB 1267, ‘NAME’ ,CLASS=X, TIME=(,65) 2. JOBNAME2 JOB 3456, NAME, MSGLEVEL=(3,0) 3. //JOBNAME3 6789 ‘NAME’ TYPERUN=CHECK 4. //JBNAME4 JOB1234, ‘NAME’, TIME=50SEC, PRTY=17 5. //JOBSNAME51 JOB TIME 65, TYPRUN =HOLD 6. //JOBNAME JOB 1234,’ANYNAME’, CLASS=E, TIME=2 7. //JOBXX JOB (TCS,TRG,D1,T000), ‘TRAINING’ MSGLVL=(1,1), //MSGCLASS=X, TIME=(,10),NOTIFY=123 8. //*JOB12 JOB (ACCT-DATA),’ABCDE’,TIME=(1,0)

For the following questions, please write down the required JCL, and record your assumptions 1. Write down the JOB card with job name ALPHA, account number 843, by a programmer LINLEE in class F. All the JCL statements, procedure statements, allocation messages should appear on the job output listing, output messages should be routed to class A. 2. Write down the JOB card with job name LOS, by a programmer J.M.BUSKIRK. The CPU time required by the job is 270 secs. Procedure statements should not appear on the job log; submit the job in class P. Omit accounting information. 3. Write down the JOB card with job name MART, account number 1863. Restart the job from STEP4. Write a comment line on the job card as “This is the job statement”. 4. Write down the Job card with job name RUN1, accounting information d83, b1062J12, SZC by a programmer JUDY PERLMAN. Allocation messages should not appear on the job output listing. Route output messages to class R. Submit the job in class 3. Notify the user D83JCS1 at EOJ.

Page 5: 2 Jcl Jcl Fundamentals Case Study Ver3.0

Job Control Language

Exercises & Case Study Ver. 3.0

For Internal Use Only Page 5 of 8

2. EXEC STATEMENT

Find out the JCL errors if any in the following statements. Correct the errors.

1. //STEPNAME EXEC PGM=PROGNAME,PARM=‘12/08/87’ 2. //COMPILE EXEC COBCLGPROC,TIME=,2 3. //EXEC PROGRAM=GA20, COND=ABEND 4. //EXEC PGM = SN50, REGION=513K 5. COMPILESTEP PROC=COBCLG,PARM=JANUARY.

For the following questions, please write down the required JCL, and record your assumptions 1. Write down the EXEC statement with step name STEP4 to execute a program DREC. Pass values 3018 to the program as parameters. 2. Write down the EXEC statement with no step name to execute a program ENTRY. Program should not execute for more than 150 secs CPU time. 3. Write down the EXEC statement with step name FOR to execute a procedure PROC480. CPU time to be accounted to DB1528. 4. Write down the EXEC statement with step name STEP6 to execute a program DISKUTIL. The job step should be bypassed if STEP4 gets a return code less than 4. 3. DD STATEMENT

Find out the JCL errors if any in the following DD statements and correct the errors:

1. //OUT1 DD DSN=ABC.TXNS,DISP=SHR 2. //DD SYSOUT=* 3. //INDD DD DSN=LTVS.SOURCE.COBOL.DISP=(DELT.OLD) 4. //XYZ DD DSN=IOB.RAS.COBOL,DISP=(,CATLG), //UNIT=3380, VOL=SER=TATA01, SPACE=(TRK,(1,1,5) //DCB=(RECFM=FB,LRECL=80,BLKSIZE=6160)

1. Write the DD statement to allocate a new PDS (partitioned data set) called UTI-PAY-COBOL to store 80 source programs (average size of code is 1000 lines) on a disk pack DEV001. Allocation should be made only in terms of blocks. 2. Write the DD stmt to create a sequential dataset (give valid name) on a tape with tape serial# being tat100 as second file. Data has a record length of 132 bytes. 3. Write the DD stmt to read a sequential dataset (give any valid name) on disk (on work01 pack), in

a) Exclusive mode b) Shared mode.

4. Write the DD statement to append data on to an existing catalogued sequential dataset UTI.NEW.TXNS.

Page 6: 2 Jcl Jcl Fundamentals Case Study Ver3.0

Job Control Language

Exercises & Case Study Ver. 3.0

For Internal Use Only Page 6 of 8

B. Process Steps for JCL Case Study

1. Case Study 1 Allocate a PDS TRxxxx.JCL.CASE (Attributes are RECFM = FB, LRECL=80, BLKSIZE=800,

DIRBLOCKS = 2, SPACE = 10 Primary Tracks) using ISPF option 3.2. . Each JCL should be created as a separate member in this PDS. Copy the sample JCL named: JCL1 from TRG1T.ILP.JCLCASE to this dataset using ISPF 3.3 option Specify UNIT=TEMPDA wherever you code DD statements in this Case Study. Case I

1. Change DSN=******** to DSN=TRxxxx.TRIAL.FB and change the DISP and DCB parameters as mentioned below. Dataset Specifications: TRxxxx.TRIAL.FB Recfm= FB, Length = 80 bytes, Block Size = 800, Sequential Dataset 2. Submit the JCL. Ensure proper completion of the job by checking the return code. Verify whether the dataset has been catalogued or not.

Case II

1. Change DSN=TRxxxx.TRIAL.FB to DSN=TRxxxx.TRIAL.FBA and change the DISP and DCB parameters mentioned below. Dataset Specifications: TRxxxx.TRIAL.FBA Recfm= FBA, Length = 133 bytes, Block Size = 1330, Sequential Dataset 2. Submit the JCL. Ensure proper completion of the job by checking the return code. Verify whether the dataset has been catalogued or not. 3. Edit the dataset and enter some data starting from the first column. Save the dataset and come out of Edit Session. Then open the dataset again in the browse mode and note the output.

Case III

1. Now change DSN=TRxxxx.TRIAL.FBA to DSN=TRxxxx.TRIAL.VB and change the DISP and DCB parameters mentioned below. Dataset Specifications: TRxxxx.TRIAL.VB Recfm= VB, Length = 132 bytes, Block Size = 1320, Sequential Dataset 2. Submit the JCL. Ensure proper completion of the job by checking the return code. Verify whether the dataset has been catalogued or not. 3. Notice that there is a change in the way the block size is specified. (For VB: Block Size = Multiple of Record Length + 4. This is because when you open a VB DataSet in EDIT mode the record length is the original record length -4)

Page 7: 2 Jcl Jcl Fundamentals Case Study Ver3.0

Job Control Language

Exercises & Case Study Ver. 3.0

For Internal Use Only Page 7 of 8

4. Edit the dataset and note what is different.

Case IV

1. Change DSN=TRxxxx.TRIAL.VB to DSN=TRxxxx.TRIAL.VBA and change DCB and DISP parameters. Dataset Specifications: TRxxxx.TRIAL.VBA Recfm=VBA, Length = 133 bytes, Block Size = 1330, Sequential Dataset 2. Submit the JCL. Ensure proper completion of the job by checking the return code. Verify whether the dataset has been catalogued or not.

2. Case Study 2

1. Copy the sample JCL named: JCL2 from the dataset TRG1T.ILP.JCLCASE 2. This JCL contains Errors. Make the JCL error free. 3. Submit a report on the errors you found and how you corrected it along with the corrected JCL. Hint: Use TYPRUN=SCAN for finding Some Errors. TYPRUN=SCAN works only when there are errors in your JCL.

3. Case Study 3

1. Copy the sample JCL named: JCL4 from TRG1T.ILP.JCLCASE (or) refer Appendix A.

The program RUNRC should give the return codes as per the following table:

Data to be passed in SYSIN card Return Code

0000 0

0001 4

0002 8

0003 Abend

The SYSIN card in the JCL should contain the values given in the Table above. All the Return Codes must be checked by giving the appropriate value in the SYSIN data.

CASE STEP 2 STEP 3 STEP 4

SYSIN RC EXECUTION SYSIN RC EXECUTION SYSIN RC EXECUTION

CASE 1 0000 0 YES 0001 4 YES ---- - NO

CASE 2 0000 0 YES 0000 0 YES ---- - YES

CASE 3 0002 8 YES ---- - NO ---- - NO

CASE 4 0000 0 YES 0003 ABEND YES ---- - NO

The values of SYSIN card of STEP2 should be set to match the return code specified in the table. Give Condition statement in STEP3 and STEP4 such that execution of STEP3 and STEP4 occurs according to the table given above.

Page 8: 2 Jcl Jcl Fundamentals Case Study Ver3.0

Job Control Language

Exercises & Case Study Ver. 3.0

For Internal Use Only Page 8 of 8

APPENDIX A

//TRGXXXJ JOB NOTIFY=&SYSUID

//STEP1 EXEC PGM=RUNRC

//STEPLIB DD DSN=TRG1T.ILP.JCLCASE.LOADLIB,DISP=SHR

//SYSIN DD DUMMY

//*

//STEP2 EXEC PGM=RUNRC

//STEPLIB DD DSN= TRG1T.ILP.JCLCASE.LOADLIB,DISP=SHR

//SYSIN DD *

0000

/*

//STEP3 EXEC PGM=RUNRC,COND=(4,LT,STEP2)

//STEPLIB DD DSN= TRG1T.ILP.JCLCASE.LOADLIB,DISP=SHR

//SYSIN DD *

0003

/*

//STEP4 EXEC PGM=IEFBR14,COND=(4,LT,STEP2)

//STEPLIB DD DSN=TRGM13.CICS.TEST,DISP=(NEW,CATLG,DELETE),

// SPACE=(TRK,(1,2,1),RLSE),

// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)

//SYSIN DD *

//SYSPRINT DD SYSOUT=*

//SYSOUT DD SYSOUT=*

//