100% found this document useful (1 vote)
51 views71 pages

Legacy Manifram Training-2

The document discusses the JOB statement in JCL, including its purpose, parameters, and syntax. It covers both positional and keyword parameters such as CLASS, MSGCLASS, TIME, and COND and provides examples of how to code them.

Uploaded by

sivakln
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
51 views71 pages

Legacy Manifram Training-2

The document discusses the JOB statement in JCL, including its purpose, parameters, and syntax. It covers both positional and keyword parameters such as CLASS, MSGCLASS, TIME, and COND and provides examples of how to code them.

Uploaded by

sivakln
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 71

WELCOME

TO THE SESSION ON JCL

1
Objectives

• Familiarize with JCL concepts and programming


techniques.

• Development of JCL for a batch application.

2
Course Schedule

Session 1 JOB Statement

Session 2 EXEC Statement

Session 3 DD Statement

Session 4 Test on JOB, EXEC & DD Stmts

3
JOB STATEMENT

Session No 1

4
JOB Statement

• The JOB statement

• Types of parameters

• The JOB Name

• The Positional & Keyword Parameters

5
JOB statement ( Contd. )
The JOB Statement

• The JOB statement identifies a JOB, (a batch unit of


work), to MVS. The JOB statement names the JOB and
supplies the necessary information to indicate which
resources the JOB will use.

• A JOB is all the JCL statements between a JOB statement


and the next JOB statement or null ('// ') statement.

6
JOB statement ( Contd. )
The JOB Statement

• A JOB is considered to consist of multiple JOB steps ; each


step is made up of an EXEC statement and one or more
DD Statements.

//TRG100A JOB NOTIFY=TRG100A


//STEP1 EXEC PGM=SAMPLE1
//DD1 DD DSN=TRG100.SAMP1.PGM,DISP=SHR
//STEP2 EXEC PGM=SAMPLE2
//DD2 DD DSN=TRG100.SAMP2.PGM,DISP=SHR
//

7
JOB statement ( Contd. )
Kinds of Parameters
Two kinds of parameters
• Positional
• Keyword
Positional parameters
• Pre determined sequence
• Separated by commas
• Omitted parameters indicated by successive commas
Keyword parameters
• Any sequence permitted
• Separated by commas
• Always follow positional parameters
Eg: //jobname JOB <positional parm>,<keyword parm>

8
JOB statement ( Contd. )
JOB Name

• Can be 1-8 characters, either national or alphanumeric.


• The first character must be alphabetic or national.
• The #, @ and $ characters are national symbols.

Example :

//HDUSR50A JOB ............


//HDUSR52B JOB .............

9
JOB statement ( Contd. )
The Positional Parameters

Accounting information
• Accounting Information parameter supplies the
information used to determine who’s responsible
for the job and how its billing should be handled.
• Format is installation dependent.
• Optional

Example : //HDUSR50A JOB (J125,bb,ccccc)

10
JOB statement ( Contd. )
The Positional Parameters

Programmer Name
• Used for user identification.
• Information related to the job being submitted.
• Specified in single quotes if name contains spaces or
special characters other than periods. Max no. of
characters is ’20’.
• It should be coded immediately after the Accounting
Information Parameter.
Example :
//HDUSR50A JOB (J124,bb,cc),‘RAGHAVAN’
//HDUSR52B JOB (J125,cics),‘PROD.CICS’

11
JOB statement ( Contd. )
The Keyword Parameters
A variety of keyword parameters can be specified on the JOB statement;
these are:

CLASS, COND, MSGCLASS, MSGLEVEL, NOTIFY, PASSWORD


PERFORM, PRTY, REGION, RESTART, TIME, TYPRUN, USER

EXAMPLE:
//HDUSR50A JOB (S-1465-3000-22-A),'JOHN SMITH',
// CLASS=A,MSGCLASS=R,
// NOTIFY=DTZ4522,USER=DTZ4522,
// REGION=4096K,TYPRUN=HOLD

12
JOB statement ( Contd. )
The Keyword Parameters

CLASS
• Indicates the nature of the JOB submitted to the system
• Single alphanumeric character (a-z,0-9)
• It depends on installation. Some times Default value is assigned to this
parameter we do not need to code it in our JCL .
• For example CLASS = K can be used to indicate a job that uses a lot of
CPU time or one that is of a low priority.
Example : CLASS=A - Test jobs
CLASS=B - Production jobs
//HDUSR50A JOB (‘ACCT’),CLASS=A

13
JOB statement ( Contd. )
The Keyword Parameters

MSGCLASS

• Specifies output device to which System Messages and JCL Messages


are to be written
• Output Device can be a printer, tape or disk
• Identified by single alphanumeric character- A-Z;0-9

Example : MSGCLASS=A - output to Printer


//HDUSR50A JOB CLASS=A, MSGCLASS=A

14
JOB statement ( Contd. )
The Keyword Parameters

MSGLEVEL
• Determines the JCL print & allocation messages.
• Format is MSGLEVEL=(print,allocations)
• Print Statements
• 0 Only JOB Statements
• 1 Catalogued procedures & Symbolic Parameters also included in the
output
• 2 Only input JCL statements being printed as the outputs
• Allocation Messages
• 0 Allocation messages if the Job terminates abnormally
• 1 Allocation messages whether the job terminates normally or abnormally
EXAMPLE :
//HDUSR50A JOB ('123 456',TSO,2,1),TEST,MSGLEVEL=(0,0)
//HDUSR52B JOB (ACC-ED-231-0),'PROD',MSGLEVEL=(1,1)

15
JOB statement ( Contd. )
The Keyword Parameters

COND
• Specifies whether a JOB should continue to execute or
terminate in relation to the outcome of any JOB step
• Format is COND=(code, operator)
• Code 0 thru 4095
• Operator GT, GE, EQ, LT, LE, NE
• If condition is true, the JOB is terminated
• A COND parameter coded on the JOB Stmt applies to all
job steps within the Job and it overrides COND
parameters coded on the EXEC stmts.

16
JOB statement ( Contd. )
The Keyword Parameters

COND
• A Successful test for the COND parameter coded on the
JOB statement results in all subsequent steps being
processed.
• A Successful test for the COND parameter coded on the
EXEC statement results only in that Job Step being
bypassed.
• If the COND Parameter is coded on the JOB stmt as well
as the EXEC Stmt then the specification on the JOB stmt
nullifies the specification on the EXEC stmt

17
JOB statement ( Contd. )
The Keyword Parameters

COND
Example 1 :
//JOB1 JOB (A123) , RANADE, COND=(0,NE)
//STEP1 EXEC PGM=PROGRAM1
//STEP2 EXEC PGM=PROGRAM2
( If 0 is not equal to the Condition Code returned by any JOB step,
terminate the JOB. In other words, the JOB will execute only if
ALL JOB STEPS RETURN A CONDITION CODE OF 0 )
Example 2 :
//JOB1 JOB (A123) , RANADE, COND=((4,GE) , (9,LT))
//STEP1 EXEC PGM=PROGRAM1
//STEP2 EXEC PGM=PROGRAM2

18
JOB statement ( Contd. )
The Keyword Parameters

TIME
• Specifies the maximum CPU time ( that does not include waiting time )
allowed for a JOB
• System will automatically cancel the JOB if its execution time exceeds
the specified time
• The usefulness of the TIME parameter is evident in test Environment,
e.g. you wish to avoid wasting CPU time if the Job or Job step goes
into endless loop
• If the TIME parameter is not specified, then the installation defined
TIME parameter is used.
• Format is TIME=(Minutess,Seconds) where minutes is a number from
1 to 1439 ( that’s 24 hours ) and seconds is a number from 1 to 59

19
JOB statement ( Contd. )
The Keyword Parameters

TIME
Example 1 :
TIME=(1,30) maximum CPU time for this JOB is 1minute
and 30 seconds
TIME=2 maximum CPU time for this JOB is 2 mins
TIME=(,20) maximum CPU time for this JOB is 20 secs

Example 2 :
//JOB1 JOB (A123) , RANADE, TIME=(45,30)
//STEP1 EXEC PGM=PROGRAM1
//STEP2 EXEC PGM=PROGRAM2
//STEP3 EXEC PGM=PROGRAM3

20
JOB statement ( Contd. )
Other Keyword Parameters

• TYPRUN : This has two options


• SCAN causes JCL to be scanned for syntax errors only
• HOLD causes JOB to be detained in input queue until explicitly
released by the operator

• RESTART
• Enables the execution of a JOB from a particular step at which
the Job was terminated abnormally instead from the top of the
JOB step.
• Format is RESTART=Y or RESTART=N

21
JOB statement ( Contd. )
Other Keyword Parameters

• PRTY
• Determines priority for scheduling jobs within the same class
• A job with a higher number takes precedence before a job with a
lower number as PRTY
• If two jobs have the same JobClass & Priority then they will be
executed in the order in which they are submitted
• Ranges from 0-15

Example:
//JOB1 JOB (A123), RANADE, CLASS=K, PRTY=2
//JOB2 JOB (B123), RANADE, CLASS=K, PRTY=4

22
JOB statement ( Contd. )
Other Keyword Parameters

• REGION
• Specifies amount of space JOB ( all Job Steps ) requires
• At the time a job is run, Operating System assigns a default
amount of work space to it automatically. This default can be
overridden via the REGION parameter.
• Can be specified in KB or MB
• Format is REGION=NK/NM
• If REGION is coded on the JOB Stmt and the EXEC Stmts, the
REGION Specification on the JOB Stmt will override that on the
EXEC stmt
• IF REGION = 0K/0M, all available storage is assigned to the Job
or Job Step

23
JOB statement ( Contd. )
Other Keyword Parameters

REGION
Example 1 :
//HDUSR50A JOB ‘ABCD’,,CLASS=A,PRTY=3,REGION=90K
//STEP1 EXEC PGM=PROGRAM1
//STEP2 EXEC PGM=PROGRAM2

Example 2 :
//HDUSR50A JOB ‘ABCD’,,CLASS=A,PRTY=3,REGION=0M
//STEP1 EXEC PGM=PROGRAM1
//STEP2 EXEC PGM=PROGRAM2

24
JOB statement ( Contd. )
Other Keyword Parameters

• REGION
Example 3 :

//HDUSR50A JOB ‘ABCD’,,CLASS=A,PRTY=3,REGION=90K


//STEP1 EXEC PGM=PROGRAM1, REGION=40K
//STEP2 EXEC PGM=PROGRAM2, REGION=50K

25
EXEC STATEMENT

Session No 2

26
EXEC Statement

• Marks the beginning of each step in a JOB


• Identifies the program or procedure to execute
EXAMPLE :

//PCICSD JOB ‘ABCD’,, CLASS=A


//STEP1 EXEC PGM=PROG1
//DD1 DD .....
//STEP2 EXEC PROC=PROC1
//DD2 DD ............
//STEP3 EXEC PROC2

27
EXEC Statement

• Step name

• Positional Parameters

• Keyword Parameters

28
EXEC Statement

STEP NAME

• Stepname is optional, but recommended. If used, must


be unique in the JOB including any procedures called
by the JOB
• Name syntax similar to JOB name syntax
Format is
//Stepname EXEC <positional>, <keyword>

29
EXEC Statement

POSITIONAL PARAMETERS

• The positional parameter can be one of the following:

- PGM=program
- PROC=procedure
- procedure name

• The Program name specified in the PGM parameter must exist


either in the System libraries, in temporary libraries or in Private
Libraries.

30
EXEC statement ( Contd. )
Keyword parameters
PARM

• Passes parameters to the program that is being executed


• Maximum length of 100 characters
• Put quotes or parentheses around the PARM value if special
characters are used
• The information is placed in a COBOL program’s linkage section
automatically if procedure division using linkage-data- area is
specified
• To continue on a second line, enclose the value in parentheses & use a
continuation `,’ (comma)
• This counts towards the maximum of 100 characters
Example
• //Stepname EXEC pgm=pgm1, parm=‘91/12/01’

31
EXEC statement ( Contd. )
Keyword parameters
COND
• Used to specify that a JOB step will be executed or bypassed, based on
return codes issued by one or more of the preceding JOB steps

• The COND parameter lets the execution of one step depend on the
outcome of a previous step

• For example in compile, link-edit JCL, if compile step condition code


on return is not satisfactory, link edit step will not be performed as it
depends on the successful execution of compile step

32
EXEC statement ( Contd. )
Keyword parameters
COND
General Format :
• COND=(comparison-code, Condition)
( Condition - GT, LT, GE, LE, EQ, NE )
Other Formats are:
• COND=(CODE, OPERATOR,STEPNAME)
• COND=(CODE, OPERATOR,STEPNAME,EVEN)
• COND=(CODE, OPERATOR,STEPNAME,ONLY)
• COND=EVEN
• COND=ONLY
EVEN - Execute this step even if a preceding JOB step abends
ONLY - Execute this step only if a preceding JOB step abends

33
EXEC statement ( Contd. )
Keyword parameters
COND

• A maximum of 8 conditions may be checked in any one step (even &


only count as one)
• Of the eight, omitting stepname in the parameter, will apply the test to
all preceding steps
• If one of the steps being checked was not executed, its condition check
is ignored
• Example: Cond=(0,eq,step1) should be read as:
• If zero equals the condition code passed from step1, do not execute
this step
• If condition is true, step is bypassed

34
EXEC statement ( Contd. )
Keyword parameters
COND
• Examples :
//STEP2 EXEC PGM=READ,COND=(4,LT)
• The cond=(4,lt) means that if 4 is less than the condition code of any
previous step, then don’t execute this step.
step It tells the system to execute
this step, if previous condition codes were less than or equal to 4. The
step executes for codes of 0-4. If the expression is true the step is not
executed.
//STEP2 EXEC PGM=READ,COND.STEP1=(4,LT)
• Maximum of eight conditions can be coded for the cond parmeter. If
any expression is true, the step is not executed
//STEP1 EXEC PGM=READ,COND=((4,GT),(6,LT))
• The above step is executed for 4,5 and 6, and not for 0-3,7..

35
EXEC statement ( Contd. )
Keyword parameters

COND
SPECIFIC PRIOR STEP:
// COND=(6,LT,STEPA)
//STEP1 EXEC PGM=ONE
//STEPA EXEC PGM=A,COND=(0,EQ,STEP1)
//STEPB EXEC PGM=B,COND=(0,LT,STEP1)
//STEPC EXEC PGM=C,COND=EVEN - if any previous step abends
//STEPD EXEC PGM=D,COND=ONLY - if any previous step abends

if COND=(0,LE) - The STEP is never executed

36
EXEC statement ( Contd. )
Keyword parameters

COND
Example 1 :
//JOB1 JOB ( A123 ), ‘DAVID BECKER’
//STEP1 EXEC PGM=PROGRAM1
//STEP2 EXEC PGM=PROGRAM2, COND=(8,EQ,STEP1)

Example 2 :
//JOB1 JOB ( A123 ), ‘DAVID BECKER’
//STEP1 EXEC PGM=PROGRAM1
//STEP2 EXEC PGM=PROGRAM2, COND=EVEN

( Both EVEN & ONLY can not be coded for the same Job Step )

37
EXEC statement ( Contd. )
Keyword parameters
TIME
• Specifies maximum CPU time allowed for this step

• If actual CPU time exceeds time parameter, a system abend S322 will
occur

• If you specify time both in the JOB and EXEC statement, then the
time parameter on the EXEC applies only for that step

• If the TIME Parameter is coded on both the JOB and EXEC


statements, then the TIME parameter on the EXEC stmt will override
the TIME parameter on the JOB Stmt

38
EXEC statement ( Contd. )
Keyword parameters

TIME

Example :

//JOB1 JOB (A123) , RANADE, TIME=12


//STEP1 EXEC PGM=PROGRAM1, TIME=4
//STEP2 EXEC PGM=PROGRAM2, TIME=4
//STEP3 EXEC PGM=PROGRAM3, TIME=4

39
EXEC statement ( Contd. )
Keyword parameters
REGION
• The REGION parameter specifies the size of the execution region for a
JOB step
• The value specified is the amount in K (1024 byte units) or M
(1024*1024 byte units) which will be the upper limit on the amount of
virtual storage that can be obtained via GETMAIN requests
• Format:
• REGION=nK/nM ( - bytes )

• Example:
//STEP1 EXEC PGM=PROGRAM1, REGION=87K
//STEP2 EXEC PGM=PROGRAM2, REGION=4M

40
DD STATEMENT

Session No 3

41
DD Statement

• The DD Statement ( Data Definition ) is used to identify the source of


input in a given program and placement of the output information as a
result of the execution of that program
• Required for each input/output file accessed by the program
• Specifies the name of the physical file, and their properties
• Links between the symbolic file name (called DD name) of a file, as
defined in the program, with its physical file
• Format : //DDname DD <positional>,<keyword>
• Up to 3273 DD statements can be allocated to a single JOB step
• The DD Statement must immediately follow the EXEC stmt

42
DD Statement

• DD Name

• Positional Parameters

• Keyword Parameters

• Special DD statements

43
DD statement ( Contd. )
DDNAME

• It identifies the name of the Data Definition Statement


• Alphanumeric or national characters,and is up to 8
characters in length
• Mandatory in the DD statement
• If omitted, then the dataset is concatenated to previously
defined DD statement
• Logical file name as defined in the program.
• The DDname starts in column 3 on the DD statement
• At least one blank must follow the name

44
DD statement ( Contd. )
DDNAME

Example 1 :
//JOB1 JOB (A123) , RANADE
//STEP1 EXEC PGM=PROGRAM1
//STEPLIB DD DSN=HDUSR50.COBOL.LOAD,DISP=SHR
//NAME1 DD DSN=HDUSR50.CCCA.VS2.AAAA,DISP=SHR
Example 2 :
//JOB2 JOB (A123) , RANADE
//STEPA EXEC PGM=PROGRAM2
//STEPLIB DD DSN=HDUSR50.COBOL.LOAD,DISP=SHR
//@NAME DD DSN=HDUSR50.CCCA.VS2.BBBB,DISP=SHR

45
DD statement ( Contd. )
Positional Parameters
• INSTREAM DATA (*)
• Indicates that instream data follows this statement
• The end of data is indicated by a delimiter /* or //.
• The instream cannot contain // in columns 1-2.

• Example :

//INFILE DD * DATA FOLLOWS


12345 SOME
374832 DATA
/*

46
DD statement ( Contd. )
DATA

• Data is same as ‘*’ operand except the instream


• Data may contain // in columns 1-2.
• Normally followed by a keyword parameter dlm=<chc>
indicating the new delimiter to be used for end of DATA.

• Example :
//INFILE DD DATA DLM=$$
#62HJKS
//! 32647
$$

47
DD statement ( Contd. )
DUMMY

• Dummy specifies that no devices are to be allocated to the


file referenced by the DDname and that all i/o requests be
bypassed.
• Normally followed by a keyword parameter DCB for
output files.

• Example :
//INFILE DD DUMMY
• The other method is to code with DSN as nullfile
//INFILE DD DSN=NULLFILE

48
DD statement ( Contd. )
DATASET NAME (DSN)
• Mandatory
• Specifies the full qualified name of the associated physical file. (input
or output)
• The advantage of qualifying the dataset names is that it gives us the
ability to group data of similar types together
• Maximum of 44 characters with a period after every 8 characters or
less
• A temporary file starts with && followed by 1 to 6 characters
• For spooler file specify SYSOUT=class, where class identifies the class
of spooler output
• SYSOUT=* puts same as that of the JOB, as mentioned in
MSGCLASS of JOB statement

49
DD statement ( Contd. )
DATASET NAME (DSN)

Example :

//JOB1 JOB (A123) , RANADE


//STEP1 EXEC PGM=PROGRAM1
//DATA1 DD DSN=RBI.MODULE2.COBOL(FILE1),DISP=SHR
//STEP2 EXEC PGM=PROGRAM2
//DATA2 DD DSN=RTGS.MODULE4.COBOL.FILE8,DISP=SHR

50
DD statement ( Contd. )
DISP

• Mandatory. Specifies about its existence at the start of the


step, and after the termination of the step.
• Consists of three parameters.
• DISP=({status}{,normal-termination-disp}{,abend-disp})
or
{NEW} {,DELETE } {,DELETE}
{OLD} {,KEEP } {,KEEP}
DISP= {SHR} {,PASS } {,CATLG}
{MOD} {,CATLG } {,UNCATLG}{, } {,UNCATLG}
DEFAULT : DISP=(NEW,DELETE,DELETE)

51
DD statement ( Contd. )
UNIT

• Required if DISP has before as new


• Specifies the type and number of devices to be assigned to a dataset
• Names disk unit or tape unit for the file
• Name can be generic like SYSDA & SYSSQ which respectively means
any disk or tape unit. Or it can be a specific IBM unit 3480/3420

• SYNTAX :
UNIT=({device-number | device-type | group-name}
{unit-count | P},DEFER)
OR UNIT=AFF=DDname

52
DD statement ( Contd. )
VOLUME
May be specified if disp has before parameter as new
Format is VOL=(V1,V2,V3,V4,V5) or
• REF=dsname or
• REF=*.DDname
• REF=*.stepname.DDname
• REF=*.stepname.procstepname.DDname
V1 - PRIVATE
V2 - RETAIN
V3 - VOLUME SEQ. NO
V4 - VOLUME COUNT
V5 - serial number. Indicates the serial numbers of the tape or disk volumes
the dataset is on. Max. 6 characters.
Example : VOL=(PRIVATE,RETAIN,,2,SER=TAPE01)

53
DD statement ( Contd. )
SPACE
Specifies how much space to allocate for a dasd dataset.
Format : SPACE=(S1,(S2,S3,S4),S5,S6,S7)
• S1 - (req) type : trks, cyl, blk size
• S2 - (req) primary quantity.
• S3 - (opt) secondary quantity.
• S4 - (opt) directory, S5 - (opt) rlse.
• S6 - (opt) contig, S7 - (opt) round.
Example :
• SPACE=(TRK,(5,1))
• SPACE=(CYL,3,RLSE)
• SPACE=(8200,(200,20),RLSE,ROUND)
• SPACE=(TRK,(20,5,5))
• SPACE=(6100,(2000,100),,CONTIG)

54
DD statement ( Contd. )
DCB
• Dataset control block. Required when disp is new
Sub parameters are :
• LRECL Record length of file. For variable length file LRECL
should be 4 bytes more
• BLKSIZE Multiple of LRECL
• RECFM Format of file
• FB Fixed Block
• VB Variable Block
• FBA Fixed Block with carriage control as first character
• VBA Variable Block with carriage control as first charcter
• U Unknown. Program should refer to control blocks
for length of each record

55
DD statement ( Contd. )
DCB

DSORG --- >> Data Set ORGanization


• PS physical sequential.
• PO partitioned.
• IS indexed sequential.
EROPT specifies the option to be executed if an error occurs in
reading or writing a record.
• ABE abnormal end of JOB
• SKP skip the block causing the error.
• ACC accept the block causing the ERROR.

Example :
DCB=(LRECL=80,BLKSIZE=800,RECFM=FB)

56
DD statement ( Contd. )
LABEL

Indicates the type and contents of the labels associated with a dataset.

Format is
LABEL=({data-set-seq}{,label}{,PASSWORD }{,IN }
{,RETPD=nnnn })
or ,NOPWREAD,OUT ,EXPDT=yyDDd ) ,EXPDT=yyyy/DDd (ESA
Only)

The first four sub parameters are Positional; the last one is a keyword

57
DD statement ( Contd. )
Special DD Statements

JOBLIB
Example:

//JOB1 JOB (A123) , RANADE


//JOBLIB DD DSN=HDUSR52.COBOL.LOADLIB,DISP=SHR
//STEP1 EXEC PGM = PROGRAM1
//STEP2 EXEC PGM = PROGRAM2
//
(HDUSR52.COBOL.LOADLIB is a Program Library)

58
DD statement ( Contd. )
Special DD Statements

JOBLIB
• Used to identify a program library when attempting to locate
programs executed during the job's life
• Must be placed after the JOB statement and before the first EXEC
statement in the JOB
• More than one program library can be concatenated after the first
one on a joblib
• If a STEPLIB DD is specified in a JOB that also has a JOBLIB, the
STEPLIB takes precedence when searching for a program
• Optional

59
DD statement ( Contd. )
Special DD Statements

STEPLIB
Example :

//JOB1 JOB ( 1234 ), ZAMIR


//STEP1 EXEC PGM=PROGRAM1
//STEPLIB DD DSN=PROD.LOADLIB1,DISP=SHR
//STEP2 EXEC PGM=PROGRAM2
//STEPLIB DD DSN=PROD.LOADLIB2,DISP=SHR

60
DD statement ( Contd. )
Special DD Statements
STEPLIB
• If a STEPLIB DD is specified in a JOB that also has a JOBLIB, the
STEPLIB takes precedence when searching for a program

• The STEPLIB can be placed anywhere in the step's JCL after the
EXEC Statement.

• More than one program library can be concatenated after the first
one on a STEPLIB

• Optional

61
DD statement ( Contd. )
Special DD Statements
Temporary Datasets

• A temporary data set is a data set that is created and deleted in the same
JOB, and is identified by coding one of the following:
• Dsname=&&dsname for a temporary data set
• Dsname=&&dsname(member) for a pds

• One Reason for using temporary datasets would be to release storage


utilized by the dataset after termination of the Job

• This Dataset can also be recognized as such if the DSN parameter is


omitted. The system generates a qualified name for the temporary data
set.

62
DD statement ( Contd. )
Special DD Statements
Temporary Datasets
Example 1 :
//JOB1 JOB (A123) , RANADE
//STEP1 EXEC PGM=PROGRAM1
//TEMPDS1 DD DSN=&&TEMPDATA
Example 2 :
//JOB1 JOB (A123) , RANADE
//STEP1 EXEC PGM=PROGRAM1
//DATA1 DD
//STEP2 EXEC PGM=PROGRAM2
//DATA2 DD *.STEP1.DATA1

63
DD statement ( Contd. )
Special DD Statements
SYSOUT

• The SYSOUT parameter identifies a data set as a "system output"


data set, consisting of printed or punched output that will be managed
by JES2 or JES3

• SYNTAX:
SYSOUT=CLASS OR SYSOUT=(CLASS,{INTRDR})
( CLASS - TO WHICH THE OUTPUT BELONGS )

• If SYSOUT=* the MSGCLASS specified in the JCL is taken.

64
DD statement ( Contd. )
Special DD Statements
SYSIN / SYSPRINT
• Can be explicilty declared and used for other purposes
• SYSIN - Used to provide instream data or can refer a data set used mainly
by IBM utility program.
• SYSPRINT
• Defines an output file containg messages from ibm utility
programs
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
ABC
/*
( The names SYSIN and SYSPRINT are not reserved by the
compiler as file names )

65
DD statement ( Contd. )
Special DD Statements
DUMPS
SYSUDUMP
• Used to request a formatted dump of the user program's work
area and task control blocks if an abend occurs.
• No DCB parameters needtobe specified on the sysudump DD,and
it can be allocated to sysout, dasd, or tape.

SYNTAX:
//SYSUDUMP DD SYSOUT=A

SYSMDUMP
• Used to request an unformatted dump of the user address space
and task control blocks, as well as the system areas, if an abend
occurs

66
DD statement ( Contd. )
Special DD Statements
SYSABEND
• Used to request a formatted dump of the user program's
work area and task control blocks, as well as the system
areas if an abend occurs

67
DD statement ( Contd. )
Special DD Statements
Concatenation of datasets
• You can logically connect or concatenate (link together) sequential or
partitioned data sets (PDSs OR PDSEs) for the duration of a JOB
step.
• To concatenate data sets, omit the DDnames from all the DD
statements except the first.

• The data sets are processed in the same sequence as the DD statements
defining them.
Example:

//INPUT DD DSNAME=FGLIB,DISP=(OLD,PASS)
// DD DSNAME=GROUP2,DISP=SHR

68
DD statement ( Contd. )
Special DD Statements
REFERBACKS

• Reference to an earlier DD statement in the JOB.


• Example :
//STEP1 EXEC PGM=PGM1
//DD1 DD
DSN=INPUT1.DSN,DISP=OLD,VOL=SER=11111
//*
//STEP2 EXEC PGM=PGM2
//DD2 DD
DSN=INPUT2.DSN,DISP=OLD,VOL=REF=*.DD1

69
DD statement ( Contd. )
Special DD Statements
Forward Reference

• Reference to a following DD statement in the JOB.

• Example :
//STEP1 EXEC PGM=PGM1
//DD1 DD DDNAME=DD3
//DD2 DD DSN=DD2.DSN,DISP=SHR
//DD3 DD DSN=DD1.DSN,DISP=SHR

70
THANK YOU

71

You might also like