Вы находитесь на странице: 1из 158

Course Title

: Introduction to JCL

Presented By : Sudheer & Thiru

Course Click to edit Master title style Details

Pre-Requisite Target Audience Mode of Training

None Those who work on mainframes Class Room Session

Evaluation Criteria

25

Introduction to JCL

Lesson Plan to edit Master title style Click

Module No.

Topic

1.
2. 3. 4. 5. 6. 7.

Introduction to JCL
JCL Statements JOB Statements EXEC Statements DD Statements Procedures Utility Programs

25

Introduction to JCL

Click to edit Master title style

Introduction to JCL

25

Introduction to JCL

Historical Background Click to edit Master title style

In the early period of computer usage the systems were largely batch-

oriented and the input to the system was through punched cards . These cards had 80 columns in which statements could be punched and had to be read through a complex procedure. Although these are no longer in use and terminals are used for inputting, the basic 80 column format remains unchanged . The most common cards are JOB, EXEC and DD. The set of cards that are required to execute a job is called a batch and hence the term Batch Processing.

25

Introduction to JCL

Historical Background Click to edit Master title style

// DD // EXEC // JOB

25

Introduction to JCL

What is JCL? edit Master title style Click to

It is a language using which the user interfaces with the operating system

and describes the program steps to be run. Defines the files (datasets) from which inputs have to be taken and results written on to. Indicates accounting information (Who is the user, How much resources he is using etc.,) Defines the resource limits the user has to operate within (No. of CPU secs, size of memory allocation etc.) Directs the print output to the defined printer.
25

Introduction to JCL

What is JCL? edit Master title style Click to

USER 2

JCL

JCL USER 1

OPERATING SYSTEM

JCL USER 3

25

Introduction to JCL

Job Step Click to edit Master title style

A Job is the execution of one or more related programs in sequence.

Each program to be executed by a job is called a job step.

25

Introduction to JCL

Job Step Click to edit Master title style

// TEXT #2 JOB(2237,4), PHASE 1,CLASS=A //STEP1 EXEC Execute CALC PGM=CALC Program Execute SORT Program

//STEP2

EXEC

PGM=SORT

//STEP1

EXEC

Execute STATS PGM=STATS Program


25

Introduction to JCL

10

Execution ofto edit Master title style Click JCL code


Every installation has a supervisor program which interprets the incoming JCL statements. This program is called Job Entry Subsystem (JES). There are two versions of this subsystem. They are JES2 and JES3. These could be a Supervisor Program or a Scheduler. JES3 has a structure //* command parameter. JES2 has format /* command. JES is responsible for managing jobs in an MVS System (Job Management). In order to support a user workload, MVS requires assistance. That assistance comes in the form of a subsystem namely JES. MVS shares its workload with JES which manages the work or job before and after execution.
25

Introduction to JCL

11

Click to edit Master title style

JobJob Control Statements Control Statements

25

Introduction to JCL

12

Job Control Statements Click to edit Master title style


JCL statements are to be written in 80-column format. Columns 1 to 3 contain the Identifier field. Columns 4 (3) to 12 contain the Name field. Column 12 onwards is the Operation field indicating the type of control statement. Not applicable to NULL,COMMENT and DELIMITER statements. Must be preceded and followed by at least one blank space. The Parameter field starts after the Operation field with a blank space preceding it. It cannot have blank spaces in between and can continue up to Column 71. The Comment field starts after the parameter field preceded by a space 25 and extends up to Column 80.

Introduction to JCL

13

Job Control Statements Click to edit Master title style

IDENTIFIER FIELD

NAME FIELD

OPERATION FIELD

PARAMETER FIELD

COMMENT FIELD
25

Introduction to JCL

14

Identifier Field edit Master title style Click to

The Identifier field indicates the type of statement to the system. // in the first 2 columns indicates that the statement is a JCL statement. / * in the first 2 columns indicates that it is a delimiter of the preceding statements. / / * in the first 3 columns indicates that it is a comment statement which has to be ignored by the system.

25

Introduction to JCL

15

Identifier Field edit Master title style Click to

//

* //*

Column 1

25

Introduction to JCL

16

Identifier Field edit Master title style Click to


The Name field should follow the identifier. It should begin in Column 3. It can have a maximum of 8 characters. Valid characters are A - Z, 0 - 9 and national characters (# $ @)). It should start either with an alphabet or a national character.

25

Introduction to JCL

17

Name Field to edit Master title style Click

//CGI001A

//#1STEP

//AB004

25

Introduction to JCL

18

Operation Field Click to edit Master title style

Operation field should be preceded and followed by at least one blank space.

It follows the Name field.


This indicates the type of statement and its purpose. It is preferable to start this field from Column 12.

25

Introduction to JCL

19

Operation Field Click to edit Master title style

JOB EXEC DD IF JCLLIB

25

Introduction to JCL

20

Parameter Field Click to edit Master title style


Parameter field should follow the Operation field. It should be preceded and followed by a blank space. The list of parameters are separated by commas. No blank spaces in between parameter lists.

Preferably started from Column 17 and can be extended up to column 71.


25

Introduction to JCL

21

Parameter Field Click to edit Master title style

(1024,14),JONES,CLASS=A

PGM=IEFBR14

DSN=&&TEMP,DISP=OLD

25

Introduction to JCL

22

Positional Parameters Click to edit Master title style


Positional parameters must appear first in the parameter list.

Should appear in the correct order.


Missing parameters must be indicated by a comma. If the missing positional parameter is the last parameter, or if all following positional parameters are also absent, subsequent replacing commas need not be coded. The enclosing parentheses can be omitted if a sub parameter consists of a single value. Nothing needs to be coded if all positional parameters are absent.
25

Introduction to JCL

23

Positional Parameters Click to edit Master title style

//IMR04A JOB (234792,78),JONES,MSGCLASS=A

// IMR069 JOB ,VICTOR,CLASS=H

//SYSIN

DD

DATA

//ABC008X JOB (45992,100,40),NOTIFY=IMR004

25

Introduction to JCL

24

Keyword Parameters Click to edit Master title style

Keyword parameters may be coded in any order in the operand field.

It should follow the positional parameters after a comma.

Absence of this parameter need not be indicated.

25

Introduction to JCL

25

Keyword Parameters Click to edit Master title style

//INFILE DD //OUT1 DD

DSN=CPVJPO.JCL.J1,DISP=OLD DSN=&&TEMP,DISP=OLD

//COB2 EXEC PGM=IGYCRCTL,REGION=1024K

25

Introduction to JCL

26

Comment Fieldedit Master title style Click to

Comment filed can be coded if there is at least 1 operand field. It should follow the Parameter list. It should be preceded by at least one blank space. It can be extended up to Column 80.

Note : Comment field is different from the Comment line.

25

Introduction to JCL

27

Comment Fieldedit Master title style Click to

//Name Operator //ST1 EXEC

Operand PGM=ADDPGM

Comment This is step 1

//IN1

DD

DSN =CPV.COB ,DISP=(,CATL) This is the input

25

Introduction to JCL

28

Continuation of JCLJCL Statementstitle style Click Continuation ofMaster to edit statements

Any JCL statement can be extended up to Column 71. If we wish to continue this statement, we normally interrupt this statement after a complete parameter field.

The next line will have // in the first 2 columns and then the previous statement can be continued anywhere between Columns 4 and 16.
It is a good practice to start the continuation line at column 12.

25

Introduction to JCL

29

Continuation of JCL statementsstyle Click to edit Master title

Col 1 //OUT1 // //

Col 12 DD DSN=CG1004A.JCL.J5,DISP=NEW, SPACE=(TRK(1,1)), UNIT=SYSDA

//CG1005X JOB(45992),SMITH,CLASS=A,MSGLEVEL=1, // REGION=1040K

25

Introduction to JCL

30

Continuation of Comment field style Click to edit Master title


If you wish to continue the comment field after Column 80 : First interrupt the comment field at or well before Column 71. Have a non-blank character in Column 72. Code // in the first 2 columns of the next line. Continue the comment field anywhere after Column 3.
25

Introduction to JCL

31

Continuation of comment field style Click to edit Master title

Col1 //TESTSP EXEC SORT5 This step will // execute a sort procedure

Col 72 *

25

Introduction to JCL

32

Comment line edit Master title style Click to

/ / * in the first 3 columns indicates that it is a comment statement

It can be extended up to Column 80.

25

Introduction to JCL

33

Comment line edit Master title style Click to

//* This JCL will execute 2 steps //* This step will sort an input file and //* store the result in another file.

25

Introduction to JCL

34

Example of Job Control Statements Click to edit Master title style

Columns 12 3 4 12 / / JOBNAME JOB / / / / JOB1 First JOB JOB 71 72 73 80 <Parameter Fields> Comment field A2312,JOHNNY * This is my

25

Introduction to JCL

35

Click to edit Master title style

Job Statement

25

Introduction to JCL

36

Click to Job Statement edit Master title style

Each Job must begin with a single JOB statement. Installations usually establish a fixed JOB statement format that must be used.

25

Introduction to JCL

37

Job Statement edit Master title style Click to

//JOBNAME JOB POSITIONAL PARAMETERS,KEYWORD PARAMETERS //RT452216 JOB (45992.522), SMITH,CLASS=A

//JOBNAME JOB (ACCOUNTING INFORMATION),NAME,CLASS=LETTER

Often specified by installation

Often specified by installation

Always specified by installation

25

Introduction to JCL

38

Job Name to edit Master title style Click

The JOBNAME identifies the job to the Operating system.

It can range from one to eight alphanumeric (A-Z, 0-9) or national characters (@,#,$).

The first character must begin in column 3 and be alphabetic (A-Z)

or national characters.

25

Introduction to JCL

39

Job Statement edit Master title style Click to

CORRECT //GDB406 //A8463 //B8750#12

INCORRECT //6J //SUPERCOMP //RUN#6

25

Introduction to JCL

40

Positional Parameter in Job Statement Click to edit Master title style

ACCOUNTING INFORMATION PROGRAMMERS NAME

25

Introduction to JCL

41

Positional Parameter in Job Statement Click to edit Master title style

ACCOUNTING INFORMATION This must be defined by an installation. All sub-parameters must be separated by commas. If it contains any special characters, it should be enclosed within apostrophes.
25

Introduction to JCL

42

Accounting information Click to edit Master title style

(acct-number,additional-acct-information)

//JOBNAME //JOBNAME

JOB 2011 JOB (20746.30,56 + 97/22,6.94)

25

Introduction to JCL

43

Programmers Name Click to edit Master title style

One to twenty character name. If it contains special characters, it must be enclosed within apostrophes. A legitimate apostrophe is coded as two consecutive apostrophes.

25

Introduction to JCL

44

Programmers Name Click to edit Master title style

//JOBNAME //JOBNAME //JOBNAME

JOB (4562,200), SMITH JOB KING JOB 6452,OREILLY

25

Introduction to JCL

45

KEY-WORD Parameters in Job Statement Click to edit Master title style

Most of the keyword parameters have installation standard values which should be used when coded. If standards are not followed, it is automatically replaced by the system.

25

Introduction to JCL

46

KEY-WORD Parameters in Job Statement Click to edit Master title style

CLASS MSGCLASS MSGLEVEL TYPRUN RESTART PRTY

NOTIFY ADDRSPC COND TIME REGION

25

Introduction to JCL

47

Class Click to edit Master title style


The installation will specify which of the 36 possible job classes to use.

Job classes range from A-Z, 0-9.


Installation establishes a default job class that is in effect if CLASS is omitted. JOB CLASS also determines the overall priority of a job along with the PRTY parameter. Jobs within the same JOB CLASS are queued together in the input queue to await execution.
25

Introduction to JCL

48

Class Click to edit Master title style

CLASS = class //JOBNAME JOB (4596,2781),CLASS=A

25

Introduction to JCL

49

Msgclass Click to edit Master title style


It specifies Job Scheduler Output Class. The Output Class is a single character, A to Z or 0 to 9. The installation sets the default if omitted. Job Scheduler messages include all messages not printed by the actual job steps being executed, that is, JCL statements and error messages, device allocations, data set dispositions and accounting information.

25

Introduction to JCL

50

Msgclass Click to edit Master title style

MSGCLASS=class //FIRST JOB (3498,2217060),AAA,CLASS=A,MSGCLASS=A

25

Introduction to JCL

51

Msgclass Msglevel=(jcl,allocations) title style Click to edit Master


The values for JCL and allocations are as follows : JCL Meaning 0 Print only JOB statement 1 Print all JCL in the input stream and all the JCL in any catalogued procedures invoked, including the internal representation of statements after symbolic parameter substitutions. Also print all JES2 and JES3 statements. 2 Print only the JCL in the input stream and any JES2 and JES3 control statements. Allocations Meaning 0 Print only JCL messages but no allocation, JES or operator messages unless the job terminates abnormally. 1 Print all allocation, JES and operator messages.
25

Introduction to JCL

52

Msglevel=(jcl,allocations) title style Click to edit Master

//JOBNAME JOB CLASS=A,MSGCLASS=D,MSGLEVEL=(0,0) //JOBNAME JOB MSGCLASS=H,MSGLEVEL=2 //JOBNAME JOB MSGLEVEL=( ,1)

25

Introduction to JCL

53

TYPRUN StatementMaster title style Click to edit

TYPRUN=SCAN, checks the JCL for syntax errors and suppresses execution of the job. TYPRUN=HOLD, holds a job in the input queue for later execution. The job is held until the operator releases it. TYPRUN=JCLHOLD, also holds the job till the operator releases it, but differs from TYPRUN=HOLD, in that the JCL is not checked until the operator releases the job.

25

Introduction to JCL

54

TYPRUN StatementMaster title style Click to edit

TYPRUN=SCAN/HOLD //FIRSTJOB ,SMITH,CLASS=M,TYPRUN=SCAN

25

Introduction to JCL

55

Restart Click to edit Master title style

MVS allows programs that abnormally terminate, or even those that run to completion, to be restarted so that the entire job does not need to be returned in the event of an error.

To do this, code a RESTART parameter on the JOB statement to name the step from which to restart and submit the job.

25

Introduction to JCL

56

Restart Click to edit Master title style

RESTART = stepname //RT45367 JOB(45992),SMITH,CLASS=A,RESTART=STEP6 //RT452216 JOB CLASS=A,RESTART=RUN.LKED //RT452216 JOB CLASS=B,RESTART=*

25

Introduction to JCL

57

PRTY Click to edit Master title style

Specifies the priority with which jobs are selected from the queue to be executed. It may range from 0 - 15. If omitted, installation default is assigned. Priority is within job class.

25

Introduction to JCL

58

PRTY Click to edit Master title style

PRTY=number //RT452216 JOB (45992),SMITH,CLASS=M,PRTY=7

25

Introduction to JCL

59

NOTIFY Click to edit Master title style

It requests the system to send a message to your time-sharing terminal when the batch job completes.
If not online, when the job completes, the message will be saved and displayed when you next log on.

25

Introduction to JCL

60

NOTIFY Click to edit Master title style

NOTIFY=user-id

//RT452216 JOB (45992),SMITH,CLASS=A,NOTIFY=GDB10

25

Introduction to JCL

61

ADDRSPC to edit Master title style Click


ADDRSPC=REAL locks the job or step into central storage during execution. ADDRSPC=VIRT allows the job or step to be paged . Default is VIRT.

Can be coded in JOB and EXEC statements.


If coded in both, JOB statement entry overrides EXEC statement entry. The installation will control the use of ADDRSPC=REAL because of its adverse effect on the systems performance. It is rarely used for such things as time dependent programs and those that dynamically modify channel programs during I/O operations.
25

Introduction to JCL

62

ADDRSPC to edit Master title style Click

ADDSPC=REAL/VIRT //RT452218 JOB (45992),SMITH,ADDRSPC=REAL

25

Introduction to JCL

63

COND Click to edit Master title style


Can be coded in JOB and EXEC statements.

When a condition is to be checked on all the job steps, COND is coded in the JOB statement. On the other hand, COND is coded on the EXEC statement if the conditions are specific to certain steps only. Helps in executing the job depending upon the return code which is generated by the system after the execution of job steps.

Return codes can range from 0 to 4095.


0 - No error 4 - Possible errors detected but execution should be successful 8 - Serious error detected; execution likely to fail 12 - Severe error, execution impossible 16 - Fatal error; execution cannot continue

25

Introduction to JCL

64

COND Click to edit Master title style


When COND parameter is coded on the JOB statement, the tests it specifies are applied to all job steps and any successful test causes all subsequent steps to be bypassed. The tests are made at the end of each step against the return code of the step and any successful test causes all subsequent steps to be bypassed. A COND parameter on the EXEC statement nullifies any COND parameters on JOB statements. .

25

Introduction to JCL

65

COND Click to edit Master title style

COND=(number,comparison), ......) //RT45227 JOB CLASS=A,COND=(4,LT)

25

Introduction to JCL

66

TIME

Click to edit Master title style

The TIME parameter sets a CPU time limit for an entire job when it is coded on the JOB statement. Minutes may range from 1 to 1440 and seconds less than 60.

If the elapsed CPU time within a job exceeds the time limit for that job, the entire job is abnormally terminated with a return code of 322.
TIME coded on the EXEC statement overrides the limits set by job statement entry.
25

Introduction to JCL

67

TIME Click to edit Master title style

TIME=(minutes,seconds)/NOLIMIT/MAXIMUM //RT452216 JOB (45992),SMITH,CLASS=A,TIME=9 //RT452216 JOB CLASS=B,TIME=(2,7)

25

Introduction to JCL

68

REGION Click to edit Master title style

REGION coded on the JOB statement sets the limit for all steps, overriding any region size on EXEC statement.
n in the REGION parameter is the number of 1024-byte. If a job requires more storage than was specified by REGION, the job is abnormally terminated with an 804 completion code.

25

Introduction to JCL

69

REGION Click to edit Master title style

REGION=nM/nK //RT452216 JOB (45992),SMITHCLASS=C,REGION=66K

25

Introduction to JCL

70

Click to edit Master title style

EXEC Statement

25

Introduction to JCL

71

EXEC Statement Click to edit Master title style

Each job step begins with an EXEC statement that either names the

program to be executed or invokes a cataloged procedure. A job can contain several EXEC statements. There may be as many as 255 EXEC statements in a job. Each one of these is followed by DD statements defining the data sets required by the job step.

25

Introduction to JCL

72

EXEC Statement Click to edit Master title style

//Stepname EXEC Procedure PGM=program,Key-word Parameters //Step1 //Step2 EXEC EXEC SORT5 PGM=L1, PARM=12345

//Step3

EXEC

PGM=IEFBR14

25

Introduction to JCL

73

STEP NAME to edit Master title style Click and PGM


STEP NAME Step name names the job step. It is optional and contains 1 to 8 character alphanumeric (A-Z,0-9) or national (#@$) characters that you select. It must begin in column 3 with an alphanumeric or national character (A-Z,@,# or $). Step names within a job should be unique so that you can reference them in other JCL statements.

A step name is required if subsequent JCL statements refer to the job step or if you wish to restart the job from that step.
25

Introduction to JCL

74

STEP NAME to edit Master title style Click and PGM

Program Name Names the program or procedure to execute.

Programs can reside in a system library named SYS1.LINKLIB, in temporary libraries and in private libraries.
If the program is not found in the libraries, the system abnormally terminates the job with an 806 completion code.

25

Introduction to JCL

75

STEP NAME to edit Master title style Click and PGM

//STEP5 //COMP //LKED

EXEC EXEC EXEC

PGM=P1 PGM=IGYCRCTL PGM=IEWL

25

Introduction to JCL

76

PROGRAMS to edit Master title style Click IN SYSTEM/PRIVATE LIBRARIES

A system library named SYS1.LINKLIB contains all the IBMsupplied system programs, such as compilers, linkage editor and service programs. A program in SYS1.LINKLIB is executed by naming the program on the EXEC statement.

Private program libraries are created as output from the linkage editor.
Programs within a library must have unique names.

A private program is executed by either including a special JOBLIB DD statement or STEPLIB DD statement.
25

Introduction to JCL

77

PROGRAMS to edit Master title style Click IN SYSTEM/PRIVATE LIBRARIES

//ABC123 JOB (2347)GOLD,CLASS=A //JOBLIB DD DSN=TRGID.LINK,DISP=SHR //STEP1 EXEC PGM=IEFBR14 // : // : // : //EXECUTE EXEC PGM=P1

25

Introduction to JCL

78

JOBLIB Statement Master title style Click to edit


The JOBLIB statement is placed immediately after the JOB statement and is effective for all the job steps. It cannot be placed in a catalogued procedure.

In the example given we have defined 2 private libraries ABC001.PGMLIB and ABC001.LINKLIB
Programs in these steps are first searched in the private libraries given in the order in which it is defined. If not found, the system searches SYS1.LINKLIB for the program.
25

Introduction to JCL

79

JOBLIB Statement Master title style Click to edit

//TRG5A //JOBLIB // //STEP1 // : // : // : //STEP2 // : // : //STEP3

JOB (234578),TEC,CLASS=A DD DSN=ABC001.PGMLIB,DISP=SHR DD DSN=ABC001.LINKLIB,DISP=SHR EXEC PGM=COMP1

EXEC

PGM=LINK1

EXEC

PGM=IEBGENER
25

Introduction to JCL

80

STEPLIB StatementMaster title style Click to edit

STEPLIB DD statement, similar in form and function to the JOBLIB statement, is placed after an EXEC statement. It is effective for that step only. It can be placed in a catalogued procedure. If JOBLIB and STEPLIB DD statements are both included in a job, the STEPLIB statement overrides the JOBLIB statement.

25

Introduction to JCL

81

STEPLIB StatementMaster title style Click to edit

//TRG5A //JOBLIB //STEP1 //STEPLIB // : // : //STEP2 //STEPLIB // : // : //STEP3

JOB (234578),TEC,CLASS=A DD DSN=ABC001.ALINKLIB,DISP=SHR EXEC PGM=COMP1 DD DSN=ABC001A.TESTLIB,DISP=SHR

EXEC PGM=LINK1 DD DSN=XYZ001.PGMLIB,DISP=SHR

EXEC

PGM=PRINTX

25

Introduction to JCL

82

KEY-WORD PARAMETERS IN EXEC STATEMENT Click to edit Master title style

The Key-word parameters are coded on the EXEC statement following the program or procedure. It is applied only on the step being executed. The PGM parameter must appear first.

25

Introduction to JCL

83

KEY-WORD PARAMETERS IN EXEC STATEMENT Click to edit Master title style

PARM

ACCT
COND DPRTY REGION TIME ADDRSPC PERFORM
25

Introduction to JCL

84

PARM statement Master title style Click to edit

It is used to pass control information to the job step when the step is initiated. This can be extremely useful for passing run-time information to an application program. There may be 1 to 100 characters of data in the PARM.

If the value consists of several sub-values separated by commas, or if it contains special characters, enclose the value in apostrophes. Code the legitimate apostrophe as two consecutive apostrophes.
Programs supplied by IBM such as the compilers and linkage editors, expect the value to represent various run options. If we have to pass values to a COBOL program, it should have the Linkage Section through which it receives the value.
25

Introduction to JCL

85

PARM statement Master title style Click to edit

PARM = Value

//STEP1 EXEC //STEP2 EXEC

PGM=ONE,PARM=(K=6,I=3,J=4) COB2UCLG,PARM.GO=STRING

25

Introduction to JCL

86

ACCT Parameter Master title style Click to edit

Any accounting information for job steps must be defined by the installation. It may have one or more sub-parameters separated by commas. If it contains any special characters, enclose the sub-parameters in apostrophes. If coded in the EXEC statement, it overrides the JOB statement.

25

Introduction to JCL

87

ACCT Parameter Master title style Click to edit

ACCT = (accounting information) //STEP10 //COMP EXEC EXEC PGM=ONE, ACCT=(3784,45-96) PGM=L1,ACCT=24573

25

Introduction to JCL

88

COND ParameterCOND PARAMETER Click to edit Master title style

If the step name is not given in the condition, the number is compared against the return code from each prior step. If the condition is true the step is bypassed. If the step name is given in the condition, the number is compared against the return code of a specific step. If more than one condition is specified all of them are checked. A maximum of 8 conditions can be checked in any one step.

25

Introduction to JCL

89

COND Parameter Master title style Click to edit

COND=(number,comparison) (or) COND=(number,comparison,stepname) //STEPA EXEC PGM=ONE,COND=(4,GT) //STEPAA EXEC PGM=TWO,ACCT=14578,COND=(8,EQ,STEPA) //STEPB EXEC PGM=TWO,PARM=4567,COND=((4,GT),(6,LT))

25

Introduction to JCL

90

COND Parameter and its Sub parameters Click to edit Master title style

If a step is not executed, it does not return a return code. If a subsequent step tries to test the return code from a step that was not executed, the test is simply not performed. If a step abnormally terminates, no return code can be issued and all subsequent steps are bypassed, unless the EVEN or ONLY subparameters are used. COND=EVEN permits the job step to execute even if previous steps abnormally terminate. COND=ONLY causes the step to execute only if the previous step abnormally terminates.
25

Introduction to JCL

91

COND Parameter and its Sub Parameters Click to edit Master title style

COND=ONLY/EVEN //STEP5 //STEP7 EXEC EXEC PGM=GO,COND=ONLY PGM=PGM3,COND=EVEN

25

Introduction to JCL

92

REGION statement Master title style Click to edit


Specifies the amount of storage a job step can use. REGION on EXEC statement sets the limit for a specific step.

REGION on JOB statement overrides REGION on EXEC.


If a job step requires more storage than was specified by REGION, the job is abnormally terminated. REGION=0K or REGION=0M will request for all available storage.
25

Introduction to JCL

93

REGION statement Master title style Click to edit

REGION=nK/nM

//COMPU
//CALC

EXEC
EXEC

PGM=GO,REGION=1000K
PGM=PGM1,REGION=1M

25

Introduction to JCL

94

TIME statement Click to edit Master title style


This sets a CPU time limit for a specific step. CPU time is the time taken by a job while executing instructions. It does not include wait time or system time. Minutes may range from 1 to 1440 (24 hours), seconds must be less than 60.

If the elapsed CPU time within a step exceeds the time limit for that step, the entire job is abnormally terminated with a 322 completion code.
25

Introduction to JCL

95

TIME statement Click to edit Master title style

TIME=minutes TIME=(minutes,seconds)

TIME=NOLIMIT
TIME=MAXIMUM //STEP5 //STEP8 EXEC PGM=FIRST,TIME=(10,3) EXEC PGM=LAST,TIME=8

25

Introduction to JCL

96

ADDRSPC statement Click to edit Master title style

Prevents a job step from being paged. ADDRSPC=REAL locks the step into central storage during creation. ADDRSPC=VIRT allows the step to be paged. This is the default.

25

Introduction to JCL

97

ADDRSPC statement Click to edit Master title style

ADDRSPC=VIRT/REAL

//STEP10

EXEC

PGM=ABC,ADDRSPC=REAL

25

Introduction to JCL

98

IF statement edit Master title style Click to


IF/THEN/ENDIF provides a simple means of selectively executing job steps.

The THEN and ENDIF are always required. The ELSE is optional.
JOB, JCLLIB or JOBLIB statements cannot follow a THEN or ELSE. Mnemonic operators that can be used are NOT, EQ, NE, GT, LT, GE, NL, LE, NG, AND, OR. The NOT operator can be coded outside of the left parenthesis to reverse the result of relational expression.

25

Introduction to JCL

99

IF statement edit Master title style Click to


The NOT has the highest priority, the comparisons the second highest, and the AND and OR have the lowest. You can use parenthesis to specify the hierarchy you want. If step name is given along with RC, the test is made with the return code of the previous step. If step name is not given, the test is made with the highest return code from all previous steps. It is possible to nest IF/THEN/ENDIF statements up to 15 levels.

25

Introduction to JCL

100

IF statement edit Master title style Click to


// // // IF (relational-expression) THEN {JCL statements to execute if the relational expression is true} ELSE {JCL statements to execute if the relation expression is false} ENDIF

// IF (STEPA.RC GE 4 AND STEPA.RC LE 6) THEN //STEP1 EXEC PGM=ONE // : // : // ENDIF

25

Introduction to JCL

101

Click to edit Master title style

DD Statement

25

Introduction to JCL

102

DD statement edit Master title style Click to


A DD (Data Definition) Statement is used to identify the source of input and the placement of output. The DD statement must immediately follow the EXEC statement.

Syntax:
//ddname DD positional/keyword parameters

Rules for coding DD statement: The ddname identifies the name of the data definition statement. A valid ddname must be assigned to each dataset used. DD name must be 1 to 8 alpha numeric or National (@, $, #). The first character must be alphabetic or national.

25

Introduction to JCL

103

DD statement edit Master title style Click to


Each DD name within a step should be unique. When we execute a COBOL program through JCL the physical file name in the SELECT statement of the COBOL program should be used as DD name in the JCL.

25

Introduction to JCL

104

DD statement edit Master title style Click to


Positional parameters may be coded in the operands field. The following positional parameters may be coded

//ddname DD //ddname DD //ddname DD

* DATA DUMMY

Keyword parameters may also be coded in the operands field. The following are the most commonly used. DSN DISP UNIT SPACE VOLUME LABEL DCB

25

Introduction to JCL

105

DSN Parameter Click to edit Master title style


The DSN parameter names the data set. Data sets can be temporary or non-temporary. A temporary data set is created and deleted within the job, whereas nontemporary data sets can be retained after the job completes. A data set is marked temporary by either omitting the DSN parameter or by coding DSN=&&name. If the data set is already defined in any previous steps, it can be referred back.

Data set names that are referred back will take the format as below : DSN=*.stepname.ddname

25

Introduction to JCL

106

DSN Parameter Click to edit Master title style


A non-temporary data set is denoted by coding DSN=data set name where data set name can be qualified or non-qualified. Non-qualified Names: Non-qualified names are comprised of 1 to 8 alphanumeric or national Characters. The first character must be alphabetic or national. It is impossible to catalogue these datasets Example: DSN=FILE1 Qualified Names: Qualified names consists of two or more non-qualified names, each separated From the next by a period. The first name is called the highest qualifier of that name. The maximum length of the data set name including the periods is 44 25 characters.

Introduction to JCL

107

DSN Parameter Click to edit Master title style


Example:
DSN=DEVVHEG.DATA.REPORT The DSN parameter for partitioned data sets must include the member name to refer to an individual member within a data set. TEMPORARY DATASETS Datasets can be temporary or Permanent. A Temporary data set is created during a job execution and deleted after a job completion. Temporary datasets can be coded in two different ways 1) By omitting the DSN parameter In this case the system assigns a unique name to it, and reference is made to it by referencing the step name and ddname. This is called refer back.

25

Introduction to JCL

108

DSN Parameter Click to edit Master title style


Example:
//JOB1 //STEP1 //DATA1 //DATA2 DD //STEP2 //DATA1 //DATA2 EXEC PGM=PROGRAM2 DD *.STEP1.DATA2,DISP=SHR DD DSN=ABC.DEF.GHI,DISP(NEW,CATLG,DELETE) JOB A123, THIRU EXEC PGM=PROGRAM1 DD DSN=A.B.C,DISP=SHR

2) By Coding the DSN parameter In this case the dataset name must start with two ampersands (&&) followed by 1 to 8 characters alphanumeric or national characters. The first character must be alphabetic or national. Example:
//JOB1
//STEP1 //DATA1

JOB A123, THIRU


25

EXEC PGM=PROGRAM1 DD DSN=&&TEMPDATA


109

Introduction to JCL

DISP Parameter Click to edit Master title style


DISP parameter has 3 positional parameters as values. DISP = (status, normal-disposition, abnormal-disposition) Status indicates the current status of the dataset. It can take values like : NEW - Creates a data set MOD - Either extends an existing data set or creates a new data set if it does not exist. The read/write mechanism is positioned after the last record in the data set when the data set is opened when use MOD. OLD - Designates an existing data set. It can be an input data set to be read or an output data set to be rewritten. SHR - Permits old data sets to be shared. SHR is identical to OLD except that several jobs may read the data set concurrently in multiprogramming environments. SHRing is used for all 25 input data sets.

Introduction to JCL

110

DISP Parameter Click to edit Master title style


NORMAL DISPOSITION
The normal disposition field in the DISP parameter is used to indicate what to do with the dataset upon normal termination of the job. The following sub parameters can be coded PASS The data set is to be passed to a subsequent job step with in a same job. Both temporary and non-temporary data sets can be passed. KEEP This KEEP sub parameter indicates that the data set is to be retained or kept upon successful execution of the job. DELETE This sub parameter indicates that the dataset being referenced is to be deleted after successful termination of the Job.
25

Introduction to JCL

111

DISP Parameter Click to edit Master title style


CATLG The CATLG sub parameter is used to specify that the dataset is to be retained and recorded in the system catalogues after successful termination of the job. The dataset name, unit, volume are recorded. If CATLG is attempted for temporary datasets, the DISP is changed to PASS. UNCATLG The UNCATLG sub parameter is used to remove the entry of the dataset from the system catalogs. ABNORMAL DISPOSITION: The abnormal disposition field tell the system what to do with the dataset upon Abnormal termination of the Job. The following subparameteres can be used DELETE KEEP
CATLG
25

UNCATLG

Introduction to JCL

112

UNIT Parameter Click to edit Master title style


UNIT parameter conveys information about the input or output devices that will be used by the job Syntax: UNIT=device-address UNIT=device-type UNIT=device-group-name SPECIFICATION OF DEVICE ADDRESS: Each I/O device attached to a computer assigned a hardware address when a System is generated. Device addresses are expressed as three hexadecimal Digits. This kind of specification rarely used. Example: //JOB1 //STEP1 //DATA1 JOB A123, THIRU EXEC PGM=PROGRAM1 DD DSN=FILE1, UNIT=S04
113

25

Introduction to JCL

UNIT Parameter Click to edit Master title style


SPECIFICATION OF DEVICE TYPE: A device type is identified by the model number assigned to that device. Syntax: //JOB2 //STEP1 //DATA1

JOB A123, THIRU EXEC PGM=PROGRAM2 DD DSN=FILE2, UNIT=3380

SPECIFICATION OF DEVICE GROUP: A device group name is symbolic name which is assigned to a group of devices when the system is generated. Devices are often grouped together based on their function. For example, you can have all direct access storage devices are under one group SYSDA, tape devices are under one group SYSTAPE, and temporary 25 storage devices are under one group SYSTEMP and so on.

Introduction to JCL

114

VOLUME Parameter Click to edit Master title style


The VOL parameter requests a specific volume, multiple volumes and specific volumes of a multi-volume cataloged data set.
A volume is the portion of a storage device served by one read/write mechanism, such as a tape reel or disk pack. Each volume has a label. The volume label contains the volume serial number and is read by the system to ensure that an expected volume is actually mounted.

25

Introduction to JCL

115

VOLUME Parameter Click to edit Master title style

VOl=SER=(volume, . . . . ,volume)
VOL=SER=XT4321 VOL=SER=PACK02

25

Introduction to JCL

116

LABELClick to edit Master title style Parameter Parameter LABEL


The LABEL parameter indicates the type of label, the relative file number on the tape, and whether the data set is to be protected from input or output and its retention period. For files on a tape the proper data set sequence number must be specified. Type may be SL(Standard Labels) or NL(No labels) etc. RETPD / EXPDT is to assign a date after which the data set can be modified / deleted.

25

Introduction to JCL

117

LABELClick to edit Master title style Parameter


Syntax: LABEL=(sequence-number,type-of-label,pw,RETPD=nnnn / EXPDT=yyddd)

Sequence-number Tape datasets can be identified by their sequence number. The sequence number is a 4 digit number and describes the datasets position relative to other dataset that may exist on the volume. This number can range from 1 to 9999, Where number 1 indicates the first dataset on the tape. If this parameter is not Coded it defaults to 1.
Type-of-label Type of label can be SL (Standard IBM Label), NSL (Non Standard Label, also called user defined label), SUL ( LABEL=RETPD=140 LABEL=EXPDT=20230

25

Introduction to JCL

118

SPACEClick to edit Master title style Parameter


The Space Parameter is used to allocate storage for new data sets on direct Access storage. Syntax:
SPACE=(CYL,(Primary,Secondary,Directory),RLSE,CONTIG,MXIG,ROUND) SPACE=(TRK,(Primary,Secondary,Directory),RLSE,CONTIG,MXIG,ROUND) SPACE=(BLK,(Primary,Secondary,Directory),RLSE,CONTIG,MXIG,ROUND)

Space may be requested in tracks, cylinders or blocks. Primary is the number indicating the amount of storage space requested. Secondary is the number indicating the amount of storage space requested in case of primary space allocated is insufficient. The Secondary space can be allocated 15 times. Directory is the number indicating the amount of storage space for recording of name and location of members created with in the partition dataset. One directory block contains 256 bytes.
25

Introduction to JCL

119

SPACEClick to edit Master title style Parameter


RLSE is used to release all unused space when a data set is closed. CONTIG is used to request that the primary space to be allocated only on contiguous tracks and cylinders. This parameter applies to only primary space. CONTIG is rarely used. MXIG allocates the primary space as the largest contiguous free area on a volume, but only if that area is as large or larger than the amount requested. MXIG is rarely used. ROUND lets you request space in units of block size, but allocates the space on cylinder boundaries, as if CYL had been coded. The SPACE parameter is ignored for non-direct-access volumes such as tapes.
25

Introduction to JCL

120

DCB Parameter Parameter Click to DCB Master title style edit


The Data Control Block (DCB) is a keyword parameter coded on the DD Statement.
Syntax

DCB=(RECFM=format, LRECL=record-length, BLKSIZE=block-size)

The RECFM parameter is used to specify to the operating system, the record format of the dataset being created. Record format can be of a fixed length (F OR FB), variable length (V OR VB), or undefined (U) length. The LRECL parameter is used to specify the length of the record for fixed and variable length records. For fixed length records, LRECL is set to equal to the record length since all the records are in same length. For Variable length records, LRECL is set to equal to the size of largest record 25 plus four bytes. The first four bytes of the each record will have control information

Introduction to JCL

121

DCB Parameter Click to edit Master title style


LRECL shows the length of a record in terms of bytes. BLKSIZE is used to specify the block size. The block size should be same as record length or multiples of record length for fixed length records. The block size should be same as record length plus four bytes or multiples of record length plus four bytes for variable length records.

BLKSIZE can not be larger than the track size of the direct access volume on which the data will reside.

25

Introduction to JCL

122

DUMMY Data Sets Master title style Click to edit


The dummy parameter is coded on the DD statement to test the execution of a program with out actually reading or writing to a dataset. It causes the operating system to simulate the presence of a file without it actually being there. Syntax: //DDNAME DD DSN=NULLFILE OR //DDNAME DD DUMMY A data set is assigned a dummy status by coding either DUMMY as the first parameter in DD statement or DSN=NULLFILE. If a DUMMY or NULLFILE is read, then the operating system passes an end-of-file indicator to the program that it is being executed. If write 25 requests are issued to these imaginary files, they are simply ignored.

Introduction to JCL

123

DUMMY Data Sets Master title style Click to edit


//SYSPRINT DD DUMMY [Any output produced by SYSPRINT is suppressed] //SYSIN DD DUMMY [Any attempt to read data from SYSIN results in an immediate end-of-file exit] //OUT DD DUMMY [The file OUT is not considered for any operation]

25

Introduction to JCL

124

CONCATENATING Data Sets Click to edit Master title style


Several input data sets can be read in sequence as if they were a single data set, by concatenating them. Data sets are concatenated by coding a DD statement for each data set in the order they are to be read. All datasets concatenated together must have the same type of record format and LRECL. All dataset concatenated together must exist on the same type of device. All datasets concatenated together must be of the same type. For example partitioned dataset can be concatenated only with partitioned dataset. Up to 255 sequential data sets can be concatenated together and 16 partitioned datasets can be concatenated together.
25

Introduction to JCL

125

CONCATENATING Data Sets Click to edit Master title style


//JOB1 //STEP1 //IN // // JOB A123, THIRU EXEC PGM=PGM1 DD DSN=JAN.DATA,DISP=SHR DD DSN=FEB.DATA,DISP=SHR DD DSN=MAR.DATA,DISP=SHR

25

Introduction to JCL

126

SYSPRINT, SYSABEND, SYSUDUMP DD names DCB Parameter Click to edit Master title style
SYSPRINT is a special DD name that directs the output either to a file or to various output devices. SYSUDUMP is a DD name which provides a formatted dump of the program area in hexadecimal, including the contents of registers, a trace back of sub-routines called, and information about all the data sets used.

The SYSABEND DD name additionally dumps the system nucleus the resident portion of the Operating System. This parameter is only used for system programmers.
A dump results only if the step abnormally terminates.
25

Introduction to JCL

127

SYSPRINT, SYSABEND, SYSUDUMP DD names Click to edit Master title style


//SYSPRINT DD DSN=TRG5.SYSINFO(M3),DISP=OLD [write the system output into the member M3 of a PDS]
//SYSUDUMP DD SYSOUT=A [writes the dump of the user region of your jobs private address space] //SYSABEND DD SYSOUT=A [writes the dump of the user region as well as system areas outside the User region associated with your JOBSTEP]

25

Introduction to JCL

128

INPUT Click to of data Stream edit Master title style


SYSIN is used as a DD name for lines of data in the input stream. /* marks the end of the lines. This cant be coded in catalogued procedure.

The lines of data cannot contain // or /* in columns 1 and 2 if DD * is used. If the lines contain // and /*in columns 1 and 2, code DATA in place of *.
//ddname // // /* //ddname // // /* DD * : :

DD : :

DATA

25

Introduction to JCL

129

SYSOUT ParameterParameter title style Click to SYSOUT Master edit


The SYSOUT parameter is used to direct the output that is generated during the execution of a job to an output device. A set of output devices may be groped together under a specific class name. If * is given, it refers back to the device in MSGCLASS.

Syntax:
//ddname Examples: //JOB1 //STEP1 //FILE1 //SYSPRINT DD SYSOUT=CLASS JOB A123,THIRU,CLASS=K,MSGCLASS=A EXEC PGM=PGM1 DD DSN=ABC.DEF.GHI,DISP=SHR DD SYSOUT=*
25

Introduction to JCL

130

NULL Statement Click to edit Master title style

NULL statement indicates the end of the job. Any statement after this statement is ignored.
// [two slashes indicate the NULL Statement]
//MYJOB // : // : //MYFILE // JOB . . . . .

DD . . . . . .

25

Introduction to JCL

131

Click to edit Master title style

PROCEDURES

25

Introduction to JCL

132

Catalogued and In stream Procedures Click to edit Master title style


JCL statements that have potential use by several users are often placed in a procedure and given them a name.
There are two types of Procedures Catalogued procedures are stored as members of partitioned data sets. In-stream procedures are identical to catalogued procedures except that they are placed with in the job, immediately after the JOB statement and it ends with a PEND statement. In-stream procedures are used to test JCL before placing it in a catalogued procedure. They are also used for procedures of limited use. There can be a maximum of 15 in-stream procedures per job.
25

Introduction to JCL

133

Catalogued and In stream Procedures Click Procedures to edit Master title style

Syntax: //Procedure-name PROC symbolic-parameters //STEP1.. //STEP2..


Example: //ADDPROC //STEP1 //SYSPRINT //SYSUT1 /SYSUT2

PROC EXEC PGM=IEBGENER DD SYSOUT=* DD . . . . . . . . . DD . . . . . . . . .


25

Introduction to JCL

134

Invoking a Catalogued Procedure Click to edit Master title style


Invoking the Proc in the JCL with a single EXEC statement along with the procedure name. Syntax:
// EXEC procedure name

Example:
// EXEC ADDPROC

25

Introduction to JCL

135

Limitations of Procedures title style Click to edit Master

Procedures can contain all but the following JCL statements : JOB, delimiter (/*) or null (//) statements JOBLIB statements DD * or DATA statements

Any JES2 or JES3 control statements

25

Introduction to JCL

136

JCLLIB Statement Master title style Click to edit


Catalogued procedures are normally kept in a System Library named SYS1.PROCLIB, but other libraries may be concatenated to it. The JCLLIB Statement allows the user to store catalogued procedures in their own library as members of a PDS. The PDS must be catalogued and have DCB attributes of LRECL=80 and RECFM=F or FB. Then the user names the library with a JCLLIB Statement. There can be only one JCLLIB per job and it is placed after the JOB statement but before the first EXEC statement. One or more libraries are listed in the order the user wants them to be searched.
25

Introduction to JCL

137

JCLLIB Statement Master title style Click to edit

//JCLLIB order=(data-set-name, data-set-name, . .,data-set-name)


//RT452216 JOB (45992),SMITH,CLASS=A //JCLLIB ORDER=(A0000.LIB1.TEST,A0000.LIB1.PROD) //STEP1 EXEC DOIT

25

Introduction to JCL

138

Symbolic Parameters SYMBOLIC Master Click to editPARAMETERS title style


Symbolic Parameters are used to override parameters on the DD statement. Can be used in Both Catalogued and In-stream Procedures. Symbolic Parameter on a DD statement is coded by preceding the parameter that will be assigned a value with an ampersand (&). Rules for Coding Symbolic Parameters: A symbolic Parameter consist of one to eight alphanumeric or national (#@$) characters including the ampersand (&). The first character must be an ampersand. The next character must be alphabetic or national. Symbolic Parameters must be coded in the operands field only. They can not be coded for the keywords on the exec statement. Examples of 25 keywords on the exec statement are PGM, COND, TIME and PARM. How ever they may be coded for the values associated with it.

Introduction to JCL

139

Symbolic Parameters Click to edit Master title style

If a positional parameters are coded as symbolic then a period should be inserted between them. This period is in addition to any periods that would be required for the correct syntax of the statement that is being coded.

Symbolic Parameters cannot be concatenated with other symbolic parameters to produce yet another symbolic parameters. However they can be concatenated with each other, each retaining the value originally assigned to it.

25

Introduction to JCL

140

Symbolic Parameters Click to edit Master title style


//JOB1 JOB A123, PGM=THIRU //PROCLIB JCLLIB ORDER=(DEVVHEG.TRAINING.LIB),DISP=SHR //PROCSTP PROC1 SPCTYPE=CYL, // FORMAT=FB, // USERID=DEVVHEG, // UNIT=SYSDA // //PROC1 PROC //STEP1 EXEC PGM=PROGRAM1 //DD1 DD DSN=&USERID..DATA.REPORT, // DISP=(NEW,CATLG,DELETE), // UNIT=&UNIT, // SPACE=(&SPCTYPE,(1,1),RLSE), // DCB=(RECFM=&FORMAT,LRECL=100,BLKSIZE=0)

25

Introduction to JCL

141

Assigning Values to Symbolic Parameters Click to edit Master title style


Symbolic parameters must always be given values,either on the proc statement as part of the procedure or on the EXEC statement when you are invoking the procedure.
Values can also be assigned to symbolic parameters using the set statement. Any values coded on the EXEC or SET statement override the values on the PROC statement for the duration of the run. If more than one value is assigned to a symbolic parameter on a PROC or EXEC statement, only the first is used. Symbolic parameters may be coded in any order on PROC or EXEC statements.

25

Introduction to JCL

142

Assigning Values toMaster title style Click to edit Symbolic Parameters


Values containing special characters must be enclosed in apostrophes. It can be of any length, but it cannot be continued onto another line.
We can nullify symbolic parameters by coding the keyword and equal sign without a value

25

Introduction to JCL

143

Overrides Parameter Click to edit Master title style


Parameters on DD statement in procedures can be overridden or an entire DD statement can be added The stepname is placed in front of the DD name to override or to add DD statements in procedures. If the DD name of the submitted statement matches a DD name within the procedure, parameters on the DD statement are overridden. If the names do not match,the submitted statement is added DD statements must be overridden in the order they appear in the procedure and added DD statements must follow any overriding statement. But the parameters in the DD statement can be in any order, those appearing the procedure are overridden, those not appearing are added

25

Introduction to JCL

144

Overrides Parameter Click to edit Master title style


The changes made to a catalogued procedure by overriding DD statements are effective only for the run and do not change the catalogued procedure permanently A stepname prefixed to a DD name has no effect if a catalogued procedure is not invoked Concatenated DD statements within a catalogued procedure must be overridden individually in the same order they appear in the procedure.

25

Introduction to JCL

145

Overrides Parameter Click to edit Master title style


Example for Override Parameter: //PROC123 //STEP1 //DD1 //STEP2 //DD2 PROC EXEC PGM=PROGRAM1 DD DSN=FILE1,DISP=SHR EXEC PGM=PROGRAM2 DD DSN=FILE2,DISP=SHR

//JOB1 JOB A123,THIRU //PROCLIB JCLLIB ORDER=A.B.C,DISP=SHR //PROC1 EXEC PROC123 //STEP1.DD1 DD DSN=FILE3,DISP=OLD //STEP2.DD2 DD DSN=FILE4,DISP=SHR
25

Introduction to JCL

146

Generation Generation Data Group ClickData Group to edit Master title style

A GDG is a Data Group is a group of datasets which are related to each other chronologically and functionally. All the datasets with a GDG will have the same name. The generation number of a dataset with a GDG is automatically assigned by the operating system when it is created. The Syntax of the generation number is GaaaaVnn Where G is for generation, aaaa is absolute sequence number can range From 0000 to 9999, V is version and nn is a version number can range from 00 to 99
25

Introduction to JCL

147

Generation Data Group Click to edit Master title style


Parameters of a GDG DEFINE GDG ( NAME (gname) LIMIT (limit) [EMPTY | NOEMPTY] [OWNER(owner id)] [SCRATCH | NOSCRATCH])

25

Introduction to JCL

148

Click to edit Master title style

UTILITY Programs

25

Introduction to JCL

149

Standard IBM Utility Programs style Click to edit Master title


A set of coded and tested programs that perform a variety of useful functions.

Utility programs are controlled by two types of statements :


JCL Statements and Utility Control Statements Utility Control statements do not start with //. It must be coded in columns 2 through 71. It is coded immediately after //SYSIN DD Statement. //SYSIN DD DUMMY is coded if no editing is required.

25

Introduction to JCL

150

Standard IBM Utility Programs style Click to edit Master title


SORT, IEBGENER, IEFBR14, IDCAMS

These utilities are executed by the same general JCL statements //stepname EXEC PGM=program-name //SYSPRINT DD SYSOUT=A { prints the utility messages } //SYSUT1 DD . . . {If needed, describes an input data set} //SYSUT2 DD . . . {If needed, describes an output data set} //SYSIN DD * {control statements} /*

25

Introduction to JCL

151

SORT Utilityto edit Master title style Click


SORT program is used to SORT/MERGE the records in one or more files and the output is stored in a new file. SORTLIB is a PDS that contains modules required by the SORT/MERGE program. Normally, SYS1.SORTLIB SORTIN gives the input file for a SORT/MERGE operation. SORTOUT gives the output file for a SORT/MERGE operation. SORTWKnn-sort work files- n should be a consecutive number beginning with 01. One or two files are usually adequate. The total DASD space allocated to SORTWKnn data sets should be about twice the sum of the input file size.
25

Introduction to JCL

152

SORT Utilityto edit Master title style Click

SORT and MERGE control statements SORT FIELDS=(Position,Length,Format,Sequence) FIELDS=(Position,Length,Sequence),FORMAT=Format

MERGE FIELDS=(Position,Length,Format,Sequence) FIELDS=(Position,Length,Sequence),FORMAT=Format


The INCLUDE and OMIT statements INCLUDE COND = (Position,Length,Format,Comparision Operator,Field or Constant) OMIT

25

Introduction to JCL

153

SORT Utilityto edit Master title style Click

The INREC and OUTREC statements INREC OUTREC FIELDS = ( [constant , ]position, length[,align,])

The SUM statement SUM FIELDS = ( position , length , format) NONE

25

Introduction to JCL

154

IEBGENER Utility Master title style Click to edit


IEBGENER is used to copy the sequential data set from one device to another.
//stepname EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=A //SYSUT1 DD . . . . . [SYSUT1 describes the input data set. It may be concatenated] //SYSUT2 DD . . . . . [SYSUT2 describes the output data set. The DCB parameters are copied from the SYSUT1 data set if the DCB parameter is not coded] //SYSIN DD DUMMY [Since there are no control statements SYSIN is made a dummy data set]
25

Introduction to JCL

155

IEBR14 Utility edit Master title style Click to

IEFBR14 is used to create, catalogue, uncatalogue or delete a data set. A new data set can be created by specifying DISP=(NEW,KEEP) or DISP=(NEW,CATLG) An existing data set can be deleted or uncatalogued by specifying DISP=(OLD,DELETE) or DISP=(OLD,UNCATLG)
//STEPNAME1 EXEC PGM=IEFBR14 //DDNAME1 DD DSN= ABCDATA.DATA.SET,DISP=(MOD,DELETE)

25

Introduction to JCL

156

IDCAMS Utility edit Master title style Click to

The IDCAMS (also know as Access Method Services) is a versatile Utility that can be invoked in batch mode with JCL or interactively with TSO commands. This utility can be used to perform the following functions o Create/delete GDG Bases or VSAM objects o Load and Unload VSAM datasets o Listing Catalogue Information o Copy datasets o Modify attributes of datasets

//DEFVSAM JOB //STEP1 EXEC PGM= IDCAMS


25

Introduction to JCL

157

Utility Click to edit Master title style Programs


A FEW UTILITY PROGRAMS
IEBCOPY IEHMOVE IEBPTPCH IEBUPDTE IEBCOMPR IEHLIST
25

Introduction to JCL

158

Вам также может понравиться