+ All Categories

JCLggg

Date post: 04-Jun-2018
Category:
Upload: rohit-jaiswal
View: 219 times
Download: 0 times
Share this document with a friend
55
Transcript
Page 1: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 1/55

Page 2: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 2/55

• JCL  or Job Control Language is used to

communicate with the computer’s operating system.

•  A JOB  is a unit of work the computer is to

 perform.•  A JOB STREAM consists of JCL

statements  , programs that are to be

executed, and data that are to be processed.The data included in the job stream are

called I NPUT STREAM DATA .

Page 3: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 3/55

JCL statements :-

• JOB statement :- The first statement in a job

 stream must be a job statement whose

 function is to identify the job to the system.

• EXEC statement :- The job statement is

usually followed by an exec statement. The

exec statement names the program or the

 procedure that is to be executed.

• DD statement :- Following the exec statementare the DD statements (data definition)

 statements. The DD statements describe the

data used by the program.

Page 4: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 4/55

• The other JCL statements are delimiter, null,

comment, proc & pend.

•  An EXEC statement and its DD statements

make up a job step .

•  A job may consist of any no. of job steps.

• The job, exec & DD statements have a common

 format which is :-

 //name operation operand comments

Page 5: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 5/55

 JCL conventions on a Live

Project•  Job executes procedures, procedures have

various steps to execute various programs,

which use parameters and parameter files.

Page 6: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 6/55

Page 7: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 7/55

Page 8: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 8/55

 Naming conventions :-

Page 9: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 9/55

Jobs will be held in datasets with .cntl or

.jcl extension

e.g. ORSDEVP.REL#15.JCL

Procedures will be held in datasets with

.proclib or .proc extension

e.g. ORSTEST.REL#15.PROCLIB

Parameters used will be held in datasetswith .parm or .parmlib extensions

e.g ORSLIVE.REL#1.PARMS

Page 10: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 10/55

Parameters :-

Page 11: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 11/55

• There are two kinds of parameters in

the operand field :- positional  andkeyword  parameters.

• The operating system recognizes

 positional parameters by their position in the operand field.

•  Keyword parameters can be coded in

any order.

•  positional parameters must be codedin a specific order before any

keyword parameter.

Page 12: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 12/55

Consider the job statement :-

Positional parameters :-

- e.g.. accounting

information &

 programmers name.

- accounting informationmust precede the

 programmers name.

- if a positional

 parameter /sub parameter is omitted a

comma  must be coded in

its place.

Keyword parameters :-

- e.g.. class & msglevel.

- MSGLEVEL=(1,1)

indicates print all the input

 JCL & the JCL fromcatalogued procedures &

 print all allocation

messages.

- TYPRUN=SCAN causesthe job’s JCL to be checked

 for syntax errors &

 prevents the job from

executing.

C lli i

Page 13: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 13/55

Controlling step execution -

the COND parameter.

• The COND parameter offers a method of testing the returncodes issued by the previous steps to determine whether a

 step will be executed.

• The format of a simplified version of the COND parameter

is COND =(value,operator) .

• Value is a no. between 0 and 4095 and operator could be

 gt,ge,eq,ne,lt,le.

• The COND parameter causes the value entered to betested against the return codes from the previous steps,

using the operator provided.

 If the test condition is true,the step is skipped.If the testcondition is alse,the ste is executed.

Page 14: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 14/55

Symbolic parameters :-

• Symbolic parameters offer a convenient way of changing

a procedure to fit your requirement.• Consider the example procedure-proglod, sysctl, sym,etc.

are all symbolic parameters.

• Symbolic parameter names may consist of from one to

 seven alphanumeric or national characters preceded by

an ampersand. The first character however must be

alphabetic / national.

• Exec statement keyword parameters may not be used asnames of symbolic parameters.For e.g.. &REGION. This

restriction does not extend to DD statement keyword

 parameters.For e.g. &DSN can be used as symbolic

 parameter.

Page 15: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 15/55

Example procedure :-

Page 16: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 16/55

Page 17: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 17/55

Page 18: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 18/55

Page 19: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 19/55

Linkage parameter :-

 Linkage parameters are used in COBOL programs.•  Linkage parameters are passed on to the COBOL

 programs through JCL by coding ‘ parm= ‘ parameter

in the exec statement.

• Whenever linkage parameters have to be used,

L inkage section has to be coded in the COBOL

 program after the data division and the procedure

division should specify the use of linkage section.•  //DD400S01 EXEC

 PGM=DD400900,PARM='& PROCTYPE&DBNME 

&DICTNME'

Page 20: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 20/55

Page 21: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 21/55

Generation Data Groups(GDG) :-

•  A generation data group is a collection,or

 group,of cataloged data sets having the samename and related to one another chronologically.

 Each of these datasets is called a generation data

 set or,simply, a generation .

•  Each generation data set is distinguished by

others by the generation number .

• The main advantage of using a GDG is that the

 same JCL can be reused without change.• Generation group index contains information on

how many generations are to be retained and what

to do when the index gets full.

Page 22: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 22/55

Defining a generation group

index using IDCAMS :-

• IDCAMS  is the name of the access method

 services utility program that performs functions

vital to the virtual storage access method(VSAM).•  IDCAMS requires a region of 300K  , a SYSPRINT

DD  statement for messages and a SYSIN DD

 statement for control statements.

• The command format :-DEF INE GDG (PARMS) .

Page 23: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 23/55

Define GDG parameters :-

Parameter Abbrv MeaningNAME GDD name.

LIMIT LIM The no. Of generations permitted for this gdg.

The max is 255.

EMPTY EMP  If empty is specified, all data sets are to be

  removed from the index when the limit is

  reached.

NOEMPTY  NEMP NOEMPTY is the default.

OWNER  User identification (optional).

SCRATCH SCR  If scratch is specified,the dataset is scratched

when the dataset is removed from the index.

NOSCRATCH  NSCR   NOSCRATCH is the default.

TO (date) Dataset retention period.

FOR(days) Dataset retention period.

Page 24: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 24/55

Page 25: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 25/55

Creating and accessing a generation :-

• The generation number may be relative or absolute.

•  If the DS name in the group is

 DDSNUS.DEVTDV.DD460302,

then to access the current generation,you code

 DSN=DDSNUS.DEVTDV.DD460302(0).To access the previous generation, you code

 DSN= DDSNUS.DEVTDV.DD460302(-1) the generation

before would be

 DSN= DDSNUS.DEVTDV.DD460302(-2).

•  If you want to create a new generation, you code

 DSN= DDSNUS.DEVTDV.DD460302(+1).

Page 26: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 26/55

• The absolute no. used by the system is in the form

GXXXXVYY,where xxxx is a generation no. from0000 to 9999 and yy is a version no. from 00 to 99.

• Thus the generation specified as DSN=

 DDSNUS.DEVTDV.DD460302(0) might appear to

the system, for e.g.. ,as

 DDSNUS.DEVTDV.DD460302.G0006V00. Then

the data set with a relative no. of (-1) would be DDSNUS.DEVTDV.DD460302.G0005V00, (+1)

would be DSNUS.DEVTDV.DD460302.G0007V00.

Page 27: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 27/55

Deleting a generation group

index using IDCAMS...

Page 28: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 28/55

Lib i

Page 29: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 29/55

Libraries :-

 Another name for a library is a partitioned data set(PDS).

•  Libraries can be created,accessed & modified using

utility programs like

 IEFBR14,IEBGENER,IEBPTPCH,IEBUPDTE,

 IEBCOPY,etc.

•  IEFBR14,IEBGENER & IEBCOPY are the most

 frequently used utilities on any project.

Page 30: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 30/55

IEFBR14 :-

• Strictly speaking it is not a utility program

because it does nothing. It clears register 15 and

 BR(branch) 14.

•  It is used to create or delete a library based on the DD statement parameters.

• The following slide consists of an example of

 IEFBR14.

Page 31: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 31/55

Page 32: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 32/55

IEBGENER :-• IEBGENER   uses four data sets described by

SYSPRINT, SYSIN, SYSUT1 & SYSUT2.• SYSPRINT  is the DDNAME of the data set that

 IEBGENER uses to write messages.

• SYSIN  is the DDNAME of the data set that

contains the control statements to tell IEBGENER

how the input data set should be modified while it

is being copied.

• SYSUT1  is the DDNAME of the input data set that IEBGENER is to copy.

• SYSUT2  is the DDNAME of the output data set

that is to be created.

Page 33: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 33/55

Example of IEBGENER :-

Page 34: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 34/55

Note :

Page 35: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 35/55

 Note :-

• The SYSOUT  parameter :- sysout is a keyword

 parameter that assigns a data set to an outputclass.

• The DUMMY  parameter :- The sysin DD

 statement in the example contains the parameter

dummy. Dummy is a positional parameter thatindicates that the data set is not to be processed.

• The *  parameter :- The * is a positional

 parameter that indicates that input stream data follow immediately after the DD statement (if

coded after sysut1 DD statement.). The delimiter

 statement, which has /* in column 1 & 2, indicates

the end of input stream data.

Note :

Page 36: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 36/55

 Note :-

• Specifying ddnames in a program :-

 In a COBOL program the DDNAME is specified

in the ASSIGN  clause: ‘ SELECT SALEFI LE

ASSIGN TO SALES ’. The DD name would then

be // sales  DD ....• Temporary data set :- A temporary data set name

consists of two ampersands( &&  ) followed by an

unqualified data set name.

Page 37: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 37/55

IEBCOPY :-

• IEBCOPY  is a utility program that may be used to

copy one or more members from an existing PDS

to a new or existing PDS, to make a backup copy

of a PDS, and to reorganize a PDS in order to

reclaim the unused space

DFSORT i JCL

Page 38: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 38/55

DFSORT using JCL :-

• Sorting  means putting records in a data set into a

 specified order.

• Merging  is closely related to sorting;it means

combining records from two or more sorted

datasets into one data set that is in the sameorder.

• The sort program requires three pieces of

information:where to find the input data,which

 fields in the records to do the sorting on, andwhere to put the sorted output data set.

Page 39: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 39/55

Example of DFSORT :-

Page 40: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 40/55

Page 41: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 41/55

• The sort program expects its input to be supplied

under the DDNAME SORTIN  and writes itsoutput under the DDNAME SORTOUT .

• The DD statements SORTWK01  through

SORTWK06  provide work areas for the sort

 program.

• Sort program uses SYSOUT  DD statement for

messages.

SYSIN  DD statement defines the control statementdata set.

Sort control statements :

Page 42: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 42/55

Sort control statements :-

The most commonly used sort control statements are

SORT  and MERGE .•  A typical control statement would look like :

SORT FIELDS=(1,10,CH,A) .

• The syntax for the fields parameter is

FIELDS=(position,length,format,sequence...) or

FIELDS=(position,length,sequence...),

FORMAT=format .

• Position  is the starting byte of the control field in therecord. Length  is the length in bytes of the control field.

Format  is the format of the data in the control field.

Page 43: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 43/55

• Commonly used values for format are ZD for

 zoned decimal, PD for packed decimal, BI for

binary, AC for ASCII character, CH for EBCDICcharacter, AQ for EBCDIC character using

alternative collating sequence.

• Sequence  is either A for ascending or D for

descending.

• The include & omit statements : The include &

omit statements are used to select the records to

be included in the sort. By selecting records forthe sort, you can decrease the amount of time the

 sort requires.

Page 44: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 44/55

Page 45: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 45/55

• The operator sub parameter may be

GT,GE,EQ,NE,LT & LE.

• The last sub parameter, value  , may be either a field in the record-specified by its own position,

length & format, or a constant.

• Numeric constantsare coded as simple values, such as 15 or -20. Character constants are

enclosed in apostrophes and preceded by a c,as in

c’dec’. Hexadecimal constants are enclosed in

apostrophes and preceded by an x,as in x’f1f2c3’. •  If more than one test is coded, the tests are joined

by the boolean operator AND  or OR ..

Page 46: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 46/55

•  A typical include statement would look like :

 INCLUDE COND=(29,1,CH,EQ,C’L’) 

The INREC & OUTREC statements :

These statements are used to reformat the records.

The INREC statement is used before sort to shorten the records by eliminating unwanted

 fields. This results in faster sorting.

• The OUTREC statement is used after the sort to

improve readability.•  INREC & OUTREC have identical formats:

I NREC FIELDS=(nX,position,length,al ign,...)

OUTREC FIELDS=(nX,position,length,al ign,...)

Page 47: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 47/55

• The first sub parameter,nX  ,is optional; it specifies

the no. of spaces to be inserted in the reformatted

record.

• The next two parameters, position  & length  ,

 specify the field in the input record.• The third sub parameter, align  , is optional; the

 possible values being H, F, and D specify

alignment on a half-word, full-word, and double-

word boundary respectively.

Merging :

Page 48: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 48/55

Merging :-

• When you merge, you start with two or more

 sorted data sets and create a new data set that is

in the same sorted order.

• While merging you must specify more than one

input data set. These data sets have the DD namesSORTINnn  , where nn may range from 01 to 16.

• SKIPREC & EQUALS / NOEQUALS options are

not used on the merge statement.

• The sort control statements are normally coded in

a parameter f i le .

Page 49: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 49/55

Example of sort control statements :-

Page 50: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 50/55

VSAM D t t

Page 51: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 51/55

VSAM Data sets :-

• There are three types of VSAM data sets : key

 sequence data sets,entry sequence data sets, andrelative record data sets.

•  For VSAM data sets, unlike non-vsam data sets, a

utility program, IDCAMS is used to perform functions like :

- Allocating space on DASD

- Supply description of the data set

- Set the data set’s disposition- Load the data set

- Print the data set

Page 52: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 52/55

• DEFINE CLUSTER is the command using which

all the descriptive information about the VSAM

data set is supplied.

• REPRO  command may be used to load data into a

VSAM data set.

• PRINT  command is used to obtain a listing of a

VSAM data set.

• FILE-AID  utility from ISPF primary menu( v.1  )

can be used to allocate / manage VSAM data sets.

Page 53: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 53/55

Example of defining cluster :-

Page 54: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 54/55

Page 55: JCLggg

8/13/2019 JCLggg

http://slidepdf.com/reader/full/jclggg 55/55