Legacy Manifram Training-2
Legacy Manifram Training-2
1
Objectives
2
Course Schedule
Session 3 DD Statement
3
JOB STATEMENT
Session No 1
4
JOB Statement
• Types of parameters
5
JOB statement ( Contd. )
The JOB Statement
6
JOB statement ( Contd. )
The JOB Statement
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
Example :
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
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:
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
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
• 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 :
25
EXEC STATEMENT
Session No 2
26
EXEC Statement
27
EXEC Statement
• Step name
• Positional Parameters
• Keyword Parameters
28
EXEC Statement
STEP NAME
29
EXEC Statement
POSITIONAL PARAMETERS
- PGM=program
- PROC=procedure
- procedure name
30
EXEC statement ( Contd. )
Keyword parameters
PARM
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
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
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
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
38
EXEC statement ( Contd. )
Keyword parameters
TIME
Example :
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
42
DD Statement
• DD Name
• Positional Parameters
• Keyword Parameters
• Special DD statements
43
DD statement ( Contd. )
DDNAME
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 :
46
DD statement ( Contd. )
DATA
• Example :
//INFILE DD DATA DLM=$$
#62HJKS
//! 32647
$$
47
DD statement ( Contd. )
DUMMY
• 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 :
50
DD statement ( Contd. )
DISP
51
DD statement ( Contd. )
UNIT
• 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
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:
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 :
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
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
• SYNTAX:
SYSOUT=CLASS OR SYSOUT=(CLASS,{INTRDR})
( CLASS - TO WHICH THE OUTPUT BELONGS )
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
69
DD statement ( Contd. )
Special DD Statements
Forward Reference
• 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