Presentation is loading. Please wait.

Presentation is loading. Please wait.

JCL Day 1. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 Course Plan Day 1 :Introduction to JCL, JOB & EXEC statement,

Similar presentations


Presentation on theme: "JCL Day 1. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 Course Plan Day 1 :Introduction to JCL, JOB & EXEC statement,"— Presentation transcript:

1 JCL Day 1

2 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 Course Plan Day 1 :Introduction to JCL, JOB & EXEC statement, JES commands Day 2 :DD statements, JCL Procedures & IBM Utilities Day 3 :Introduction to VSAM, GDG & SMS

3 3 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 Pre-requisites MVS Operating system and its subsystem TSO Navigating through ISPF

4 4 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 Topics beyond the scope VSAM file-handling User coded COBOL program execution

5 5 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 Evaluation Mechanism ComponentMarksSchedule Test100After Day 3

6 6 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 References TitleAuthorPublisher OS/390 and z/OS JCL Raul MenendezMurach MVS JCLDoug LoweMike Murach & Associates, Inc MVS/VSAMGary D Brown & S.A.M. Smith SPD IBM Online manuals

7 7 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 Agenda for Day 1  Introduction to JCL  What is JCL  Why we need JCL  How we can use it  Sequence & priority of execution  Job statement  Syntax  Parameters  Exec statement  Syntax  Parameters  COND parameter  JES commands, JCL errors & Abends

8 8 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 J C L JOBCONTROL LANGUAGE What does JCL stand for ?

9 9 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 What is JCL then? Not a Procedural or OO Language JOB CONTROL LANGUAGE Interface between Programs & MVS OS. Why JCL? Sample JCL code

10 10 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 Sample JCL //UseridJ JOB,,NOTIFY=&SYSUID,CLASS=D, // MSGLEVEL=(1,1),MSGCLASS=X //* SAMPLE JCL //STEP1 EXEC PGM=SEQPROC //STEPLIB DD DSN=OPERN.CICS3.LOADLIB,DISP=SHR //SYSPRINT DD SYSOUT=* //INFILE DD DSN=YourMainframeId.JCL.DAY2.FILE1,DISP=SHR //OUTFILE DD DSN=YourMainframeId.JCL.DAY2.FILE2, // DISP=(NEW,CATLG,DELETE), // UNIT=SYSDA,SPACE=(TRK,(10,5),RLSE), // DCB=(LRECL=80,BLKSIZE=8000,RECFM=FB)

11 11 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 Various stages of JCL execution Determine the job Create the JCL Submit the JOB JES interprets JCL and passes it to MVS MVS does the work User Views and Interprets output JES collects the output and information about the JOB System Messages

12 12 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 Various stages of JCL execution Input Conversion Execution Output Hard copy Purge

13 13 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 INPUT SPOOL JCL SYSIN JES MVS

14 14 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 CONVERSION SPOOL JCL SYSIN MVS JES PROCLIB PROC

15 15 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 CONVERSION JOB INTERPRETER - JES2 JES2 ADDRESS SPACE INITIATOR ADDRESS SPACE PAY JCL INTERPRETER PAY CONTROL BLOCKS

16 16 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 CONVERSION JOB INTERPRETER - JES3 JES3 ADDRESS SPACE INITIATOR ADDRESS SPACE PAY JCL INTERPRETER PAY CONTROL BLOCKS

17 17 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 EXECUTION, OUTPUT, HARDCOPY and PURGE Execution: –JES selects a job for execution, based upon job CLASS and job selection PRTY Ex: //ER5077 JOB,,PRTY=8,CLASS=A –Allocation of datasets –SYSIN and SYSOUT OUTPUT, HARDCOPY and PURGE

18 18 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 JCL PROCESSING JCL SYSIN SYSOUT SPOOL JES2 / JES3 JES2 / JES3 INITIATOR1 INITIATOR2 PRINTER INPUT STREAM INITIATOR3

19 19 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 JCL execution JCL INITIATION STEP INITIATION ALLOCATION PROGRAM EXECUTION STEP TERMINATION JOB TERMINATION JCL SYSIN SYSOUT

20 20 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 QUESTIONS ??? JCL is used to write an application program ? Yes/No What are the different stages of JCL processing ?

21 21 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 JCL statements JOB- Job Identification EXEC - Instruction for Execution DD - Source of data to operate

22 22 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 JOB STATEMENT ACCT CLASS NAMENOTIFY MSGLEVEL TYPRUNMSGCLASS PRTYCOND RESTARTUSER REGIONPASSWORD PERFORMTIME

23 23 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 IMPORTANT JOB PARAMETERS Positional Parameters a)Account Information b)Name EX: //ER5077J JOB A123,NAME1 All these parameters are optional as far as JCL is concerned, they are probably required by your installation.

24 24 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 IMPORTANT JOB PARAMETERS Keyword Parameters EX: //ER5077J JOB,,CLASS=A CLASS specifies the job class that is the nature of the job. Installation will specify which of the 36 possible classes to use which is from A to Z and 0 to 9. Installation establishes a default class that is in effect if CLASS is omitted. CLASS

25 25 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 A typical JOB Class assignment ClassCharacteristics AExecute within 15 min of submission BExecute within 30 min of submission CExecute within 60 min of submission DExecute Overnight HWill be held until released by operator LExecute within 15 min of submission TRequires Tape Processing

26 26 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 IMPORTANT JOB PARAMETERS Keyword Parameters EX: //ER5077J JOB,,MSGCLASS=A MSGCLASS specifies the job scheduler message output class. Job scheduler messages include all messages not printed by the job steps being executed but the JCL messages and system messages Installation establishes a default class that is in effect if MSGCLASS is omitted. MSGCLASS

27 27 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 IMPORTANT JOB PARAMETERS Keyword Parameters EX: //ER5077J JOB,,MSGLEVEL=(1,1) MSGLEVEL(statements,messages) specifies the printing of JCL statements and allocation messages. EX: MSGLEVEL(0,1) will print only JOB statement, and all the allocation, JES, SMS and operator messages By default it is MSGLEVEL(1,1) MSGLEVEL

28 28 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 IMPORTANT JOB PARAMETERS Keyword Parameters //ER5077J JOB,,NOTIFY=&SYSUID //ER5077J JOB,,NOTIFY=ER5077 Requests the system sends a message to the TSO user id specified when the job completes processing NOTIFY

29 29 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 IMPORTANT JOB PARAMETERS Keyword Parameters EX: //ER5077J JOB,,TYPRUN=SCAN TYPRUN checks the JCL and holds the job in the input queue. TYPRUN = SCAN checks the JCL for syntax errors and suppresses execution of the job TYPRUN = HOLD holds the JCL in the input queue for later execution.It is held until the operator releases it. TYPRUN = JCLHOLD(JES2 only) similar to HOLD but the difference is it is checked while it is not with the HOLD option. TYPRUN = COPY(JES2 only) lists or duplicates the lines placed in the JOB statement to the class assigned in the MSGCLASS parameter and suppresses execution. TYPRUN

30 30 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 SOME OTHER Keyword JOB PARAMETERS PRTY=Priority : is related to the CLASS parameter. It assigns priority to jobs which belong to the same class.priority numbers range from (0-14) or (0-15) depending on installations. TIME=(min,sec) : signifies how much CPU time the JOB can take to run. RESTART=STEPNAME :Forces the JOB execution to start from a particular STEP.

31 31 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 SOME OTHER keyword JOB PARAMETERS REGION=96K :To override the default amount of workspace assigned for the job. COND=(4,LT) :Permits the execution of a steps to depend on the return code from the previous steps. ADDRSPC=REAL : It is used to specify whether the program is to use REAL or VIRTual ADDRess SPaCe. Default is Virtual. If Real is coded then the REGION parameter is also to be coded.

32 32 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 EXEC STATEMENTS PGMCOND PROCPARM ACCTREGION ADDRSPCTIME PERFORM

33 33 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 IMPORTANT EXEC PARAMETERS positional parameters EX: //STEP1 EXEC PGM=IEFBR14 The PGM parameter identifies the name of the program that is to be executed. EX: //STEP1 EXEC PROC=MYPROC The PROC parameter identifies the name of the procedure that is to be called. PGM & PROC

34 34 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 IMPORTANT EXEC PARAMETERS keyword parameters EX: //STEP1 EXEC PGM=IEBUPDT,PARM=‘LET,MAP,XREF’ The PARM parameter is used to supply information to a program as it executes. PARM

35 35 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 IMPORTANT EXEC PARAMETERS keyword parameters EX: //STEP1 EXEC PGM=IEBUPDT,ADDRSPC=VIRT The ADDRSPC parameter is to indicate to the system that the job step is to use either VIRT (virtual) or REAL (real) storage. By default it is virtual. ADDRSPC

36 36 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 IMPORTANT EXEC PARAMETERS keyword parameters EX: //STEP3 EXEC PGM=IEBUPDT,COND=(8,LE,STEP1) The COND Permits the execution of steps to depend on the return code from the previous steps. The question should be is 8 less than the RC code of STEP1. If Yes then Bypass STEP3 If No Execute STEP3 The COND parameter is also a JOB parameter. COND

37 37 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 COND parameter in detail Format : COND=( 0/4/6/8/12/16, GT/GE/LT/LE/EQ/NE, step name, EVEN/ONLY ) RC comparison code (0 - 4095) Condition EVEN : step will be executed even if previous steps terminate abnormally ONLY : step will be executed only if previous steps terminate abnormally. Only code in the exec statement not in job statement

38 38 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 COND parameter examples (in JOB statement) //ER5077J JOB,,COND=(4,LT) //STEP1 EXEC PGM=IEFBR14 //STEP2 EXEC PGM=IFBR14 //STEP3 EXEC PGM=IEFBR14 STEP1 executes with RC = 0 STEP2 executes with RC *S806 that is it is greater than 4 Job terminates

39 39 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 COND parameter examples (in EXEC statement) //ER5077J JOB,,CLASS=A //STEP1 EXEC PGM=IEFBR14 //STEP2 EXEC PGM=IEFBR14,COND=(0,EQ,STEP1) STEP1 executes with RC = 0 STEP2 does not execute

40 40 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 COND parameter examples (in EXEC statement) // ER5077J JOB,,CLASS=A //STEP1 EXEC PGM=IEFBR14 //STEP2 EXEC PGM=IEFBR14,COND=ONLY STEP1 executes with RC = 0 STEP2 does not execute //ER5077J JOB,,CLASS=A //STEP1 EXEC PGM=IFBR14 //STEP2 EXEC PGM=IEFBR14 //STEP3 EXEC PGM=IEFBR14,COND=ONLY STEP1 abends with RC = *S806 STEP2 does not execute ( if a single step abends all other steps are bypassed if no COND statement is there ) STEP3 executes with RC = 0

41 41 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 COND parameter examples (in EXEC statement) //ER5077J JOB,,CLASS=A //STEP1 EXEC PGM=IEFBR14 //STEP2 EXEC PGM=IEFBR14,COND=EVEN STEP1 executes with RC = 0 STEP2 executes with RC = 0 //ER5077J JOB,,CLASS=A //STEP1 EXEC PGM=IFBR14 //STEP2 EXEC PGM=IEFBR14 //STEP3 EXEC PGM=IEFBR14,COND=EVEN STEP1 abends with RC = *S806 STEP2 does not execute ( if a single step abends all other steps are bypassed if no COND statement is there ) STEP3 executes with RC = 0

42 42 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 IMPORTANTEXECPARAMETERS keyword parameters (IF/THEN/ELSE/ENDIF) EX: // IF STEPA.RC GE 4 THEN //jcl statements // ELSE //jcl statements // ENDIF The IF/THEN/ELSE/ENDIF statement construct provides a simple means of selectively executing job steps. It is available in Release 4 or later, of MVS/ESA and eliminates the need to struggle with the COND parameter.

43 43 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 IF/THEN/ELSE/ENDIF parameter examples //ER5077A JOB 2933100P,ABC,MSGCLASS=A,CLASS=A //STEP1 EXEC PGM=IEFBR14 // IF STEP1.RC GT 0 THEN //STEP3 EXEC PGM=IEFBR14 //DD1 DD DSN=ER5077.TRUE.PS,DISP=(NEW,CATLG), // VOL=SER=INUSR2, // SPACE=(TRK,(1,1)), // DCB=(LRECL=80,BLKSIZE=800,RECFM=FB) // ELSE //STEP4 EXEC PGM=IEFBR14 //DD2 DD DSN=ER5077.FALSE.PS,DISP=(NEW,CATLG), // VOL=SER=INUSR2, // SPACE=(TRK,(1,1)), // DCB=(LRECL=80,BLKSIZE=800,RECFM=FB) // ENDIF /* STEPNAME PROCSTEP RC STEP1 00 STEP3 FLUSH STEP4 00

44 44 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 COMMON keyword PARAMETERS in JOB & EXEC TIME REGION PERFORM COND ADDRSPC ACCT

45 45 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 JOB ENTRY SUBSYSTEM JES2 / JES3 JES2 or JES3 statements can be included to communicate with JES concerning... INPUT OUTPUT PROCESSING

46 46 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 JES2 Control Statements $COMMANDOUTPUTSIGNOFF JOBPARAMPRIORITYSIGNON MESSAGEROUTEXEQ NETACCTSETUPXMIT NOTIFY

47 47 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 JES2 Control Statements NOTIFY - direct job’s notification messages to a user. PRIORITY or PRTY -Assign a selection priority for your job. Within a job class, a job with a higher priority is selected for execution sooner. JES2 Control statements are preceded with /* in col1 & col2.

48 48 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 Errors JCL syntax errors. JOB will not be submitted JCL allocation errors. JES2-subsequent steps will not get executed. JES3-detects errors in the beginning.

49 49 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 Abend Failures An ABEND failure occurs under the following conditions: A program while executing, attempts to perform an instruction or operation which the system recognizes as being impossible or unacceptable.

50 50 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 Causes of Abend Failures  Logic error  Resource unavailability  Exceeding limits (Time or Space on DASD)  Hardware Malfunction  User ABENDS  Operator intervention  Operating System failure

51 51 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 Thank You!


Download ppt "JCL Day 1. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/OS02/003 Version No: 1.0 Course Plan Day 1 :Introduction to JCL, JOB & EXEC statement,"

Similar presentations


Ads by Google