45750365 JCL Refresher | Operating System Technology | Computer Data

JCL Pefresher

Poge 1 of õ4
JCL.................................................................................................................................. 2
JCL Statements ............................................................................................................... 3
Job Entry System (JES) .................................................................................................. 4
Cataloged Procedures ..................................................................................................... 4
In-stream Procedure........................................................................................................ 4
Symbolic Parameters ...................................................................................................... 4
SET command................................................................................................................. 5
Nesting Procedure........................................................................................................... 5
Include statement ............................................................................................................ 5
Generation Data Group................................................................................................... 6
What is a Utility? ............................................................................................................ 8
DFSORT..................................................................................................................... 8
IEBGENER............................................................................................................... 15
IEFBR14 ................................................................................................................... 18
IEBCOPY ................................................................................................................. 19
IEWL......................................................................................................................... 22
Question and Answers .................................................................................................. 26


JCL Pefresher
Poge Z of õ4
JCL

JCL consists of control statements that introduces a computer job to an OS.

JCL contains a set of statements referred to as Program control cards, provides necessary specifications
such I/O resource requirements to process a Job. JCL is used for submitting batch jobs. JCL is not a
procedural language like COBOL and is also not used to write Programs.

Format of JCL statement

//name operation operand comment

Name field identifies the statement. It should be of a maximum of 8 characters long, should start from 3rd
column, The first character must be an alphabet.

Operation field specifies the type of statement, viz. JOB - makes the beginning of the JOB, or EXEC -
follows JOB statement, and names the Program / Procedure to be executed, or DD - defines the file and
requests the allocation of I/O devices. PROC begins a catalogued or in-streamed procedures, while PEND
marks the end of in-stream procedure. JCLLIB/STEPLIB specifies the private libraries containing the
catalogued procedures and JCL referred to by Include statements. SET assigns values to symbolic
parameters in catalog procedures, INCLUDE allows JCL stored in partitioned dataset to be included in the
job stream. IF/THEN/ELSE/END allows selective execution of Job steps. CNTL and ENDCNTL marks the
start and end of control statements in the input stream. OUTPUT Supplies options for SYSOUT processing.

/* - Indicates the end of data.
//* - Marks as comment line.
// - Marks the end of Job.

Operand field supplies information to JCL in the form of parameters (positional and key-word).

Positional parameters are characterized by their position in relation to other parameters. The Key-word
parameters are independent of their position and characterized by key-word and '='.

Key-word and positional parameters may have sub-parameters enclosed in parenthesis that may be
positional or key-word parameters, following their corresponding rules.

The various parameters are separated by Commas, The absence of positional parameters are indicated by
coding a coma in it's place. Comma's need be provided, if all subsequent positional parameters are absent.
The enclosing parameters can be omitted, if there is only one value.

Nothing needs to be coded if all positional parameters are absent. Key word parameters can be coded in any
order after any positional parameters. Comments field is optional.

General rules in coding a JCL

Start all statements in column 1 with appropriate // or /* or space.
An entry in the name field must begin in column 3 and be followed by at least one space.
There must not be any embedded blanks within fields, parameters must be separated by commas.
Column 1 to 71 contains the JCL information. Use '-' for continuation.
Comments may be written on comment line or by leaving a blank after all the operands.




JCL Pefresher
Poge 3 of õ4
JCL Statements

JOB

Jobname, (ACCTNUM, ACCTNAME) (positional parms),'Name' (positional parm),
CLASS= , PRTY= , MSGCLASS= , MSGLEVEL= , TYPRUN= , NOTIFY= , COND= , REGION=.

CLASS and MSGCLASS can have one of the 36 values, A-Z and 0-9.
CLASS identifies the nature of the job that is to be submitted. Some jobs can be short running, others can
take a long time, and still others may utilize heavy resources.
MSGCLASS specifies the output class to which system messages for your job are to be routed.

TYPRUN can be SCAN or HOLD.
If TYPRUN=SCAN is coded, it checks job for syntactical errors.
If TYPRUN=HOLD is coded, holds the Job without running. This job can be run only after operator
releases the Job.

The PRTY parameter is related to the CLASS parameter. It assigns priority to jobs, which belong to same
class. Smaller number indicates higher priority (allowed values are 0-15 for JES2 and 0-14 for JES3).
When the job is initiated, the system will convert the job's priority into a dispatching priority so that job's
task can complete with other tasks for use of main storage and CPU resources

REGION parameter will be used to override the installation default Region size for executing your job.
REGION=0M parameter again allocates maximum space that is available in the system to execute the job.
Omitting REGION means no limit will be applied

MSGLEVEL have two positional parameters (statements, messages), which indicates what job output is to
be written as a part of output listing.

Statements:
0 - Print only Job statements
1 - All input control statements, catalogued procedure statements and the internal
representation of procedure statement parameters after symbolic parameters substitution
are to be written
2 - Only input job control statements are to be written

Messages:
0 - Only JCL messages print; if the job ABENDs, then JES messages too
1 - JCL and JES messages print.

NOTIFY is used to notify the user about the completion of Job.

EXEC

The PGM parameter specifies the Program to be executed. ACCT parameter is used to specify the
accounting number of the Step, if it is different from the Job accounting number. PARM is used to send
values to the program, when it is executed. REGION specifies the amount of storage a Job step can use.
The PRTY is used to specify priority to the step. COND specifies the condition for executing subsequent
Job step. TIME sets a CPU time limit for a Job step.

Ex. //step1 EXEC PGM=prog1,PARM='aa', REGION=64k



JCL Pefresher
Poge 4 of õ4
DD

For Input stream datasets SYSIN is traditionally used as ddname.
Use SYSOUT parameter to indicate the Output stream dataset.

DDname – specifies the name of the DD statement. DSN= is used to specify the dataset name to OS,
&&name is used to specify a temporary dataset.

DISP=(status,norm,abnorm) is used to specify the Disposition of the DS, with the status at beginning and
norm,abend after execution, valid options are NEW, OLD, SHR, MOD for status,
keep,catalog,uncatalog,delete for normal & abnormal run's, In addition Pass is also used for normal run.
UNIT specifies the I/O devices. VOL, SPACE and DCB are others.
Job Entry System (JES)

JES is used to accept jobs and run them on one of several computers connected together in a network. JES
consists of statements placed before or after the JOB statement to direct Jobs to the computer in a network.

Differences between JES2 & JES3

(i) In JES2 computers are connected in a network, and each computer is termed as a node. In
JES3 several computers are connected closely together and all of the scheduling is done by a
single computer that is called a global processor.

(ii) In JES2 each computer in a network can select jobs from it's queue (decentralized system),
while in JES3 the global processor schedules the jobs in queue to itself or to the other
computers connected to it (centralized system).

(iii) JES3 allocates datasets for all the steps before the job is scheduled. In JES2, allocation of
datasets required by a step are done only just before the step executes.
(iv) All the jobs are placed in single Job Queue in JES2 & JES3. They can also route the output to
some destination. JES2 statements cannot be placed in a cataloged Procedure.
Cataloged Procedures

The JCL statements that have potential use by several users are often placed in a cataloged procedure,
which can be invoked by a single exec statement. They are stored in a PDS (need to be specified by
JCLLIB ORDER=(dsn,dsn,...) statement) or SYS1.PROCLIB system library. It begins with PROC
statement and followed by JCL statements that constitute the procedure.
In-stream Procedure

In-stream procedure starts with a PROC statement and end with PEND statement. Instream procedure's can
be included after the JOB statement but before the first EXEC statement. Up to 15 in-stream procedures are
allowed in a JOB, with each in-stream procedure allowed to be executed several times.
Symbolic Parameters

Symbolic parameters are used to override parameters on the DD statement.


JCL Pefresher
Poge õ of õ4
To run a procedure for various jobs, we may have the need to modify the DD statements every time in the
procedure, for that we can use Symbolic parameters, which provides the means to modify procedures for
execution.

Symbolic parameters are preceded with ampersand (&) and may be 1 to 7 alphanumeric characters long,
which must be coded in the operand field of JCL statements. Key words on EXEC statement such as
COND, PARM, PGM cannot be coded as symbolic parameter names. Values can be assigned to EXEC or
SET statement on the PROC statement for duration of the run.

Assign values to Symbolic parameters

Values can be assigned to symbolic parameters on PROC, EXEC and SET statements of a JCL. Values
containing special characters other than blank , . ' * must be coded in apostrophes ''. Values assigned to
symbolic parameters can be of any length but cant be continued on next line. Symbolic parameters can be
concatenated with other symbolic parameters. Nullify the symbolic parameter value by coding the key
word followed equal sign without a value, either on PROC or EXEC statement. Delimiter such as leading
or trailing commas next to Symbolic parameters are not removed.
SET command

A SET statement is used to assign values to symbolic parameters. Any number of SET statements can be
can be included in a JCL. SET can be placed in a catalog procedure to assign default values rather than to
assign values on the PROC statement. SET can be placed in JOBSTREAM to assign default values rather
than assign values on EXEC statement. A new SET statement can change the value of previous SET
statement. A value of SET by PROC statement is changed, if a SET statement appears with in the
procedure. SET statement can be placed anywhere following the Job statement. SET is conditional and is
not affected by condition execution of the IF-THEN-ELSE-ENDIF. SET statement can replace setting
symbolic parameter values on both EXEC and PROC statement, they also allow to create symbolic values
in JCL and assign them without having to create a cataloged or in-stream procedures.
Nesting Procedure

In-stream procedures can be nested to a maximum of 15 levels (i.e. one proc invoking other and so on).
We can not make backward reference between nested procedure. Up to only one over ridding statement is
possible.
All step-names should be unique So that we can override them correctly.
Include statement

It is used to copy in JCL stored as a member of a PDS using the JCLLIB statement to name the PDS and
placing INCLUDE statements in the JCL, where we want the members to be copied.

//INCLUDE MEMBER=member-name.

PDS must be named with JCLLIB statement. PDS must be cataloged and have DCB attributes of
LRECL=80 and RECFM=F or FB. It can be place anywhere after JOB statement. Placed in Cataloged and
In-stream procedures. Include group can be nested up to 15 levels. Include can not Contain JOB,
PROC/PEND, JCLLIB, DD *, JES2 & JES3 statements.



JCL Pefresher
Poge ó of õ4
Generation Data Group

Generation Data Group is a group of datasets that are logically or chronologically related and referred by a
name and relative generation number. Relative number is an integer, which identifies the generation of a
dataset and is coded in parentheses after dataset name

The DEFINE GENERATIONDATAGROUP command creates a catalog entry for a generation data group
(GDG). The syntax of this command is:

DEFINE GENERATIONDATAGROUP
( NAME(entry-name)
LIMIT(limit)
{EMPTY|NOEMPTY}
{OWNER(owner-id)}
{SCRATCH|NOSCRATCH}
{TO(date)|FOR(days)})
{CATALOG(cat-name{/password})
)

Parameters

Required Parameters:
DEFINE
Define can be abbreviated: DEF

GENERATIONDATAGROUP:
Specifies that a generation data group (GDG) entry is to be defined. A GDG can contain both
SMS- and non-SMS-managed generation data sets. A generation data set (GDS) cannot be a
VSAM data set.
Abbreviation: GDG

NAME(entry-name)
Specifies the name of the GDG being defined.

LIMIT(limit)
Specifies the maximum number, from 1 to 255, of GDSs that can be associated with the GDG
being defined.
Abbreviation: LIM

Optional Parameters:
CATALOG(cat-name./password.)
Identifies the catalog in which the generation data group is to be defined. If the catalog's volume
is physically mounted, it is dynamically allocated.

Cat-name
Specifies the name of the catalog.

password
Specifies the catalog's password. If the catalog is not SMS-managed and is password-protected,
you must supply the update (or higher-level) password. Passwords are ignored for SMS-managed
data sets and catalogs.
Abbreviation: CAT


JCL Pefresher
Poge 7 of õ4
EMPTY|NOEMPTY
Specifies what action is to be taken when the maximum number of GDSs for the GDG is exceeded
and another GDS is to be cataloged. The disposition of the data set's DSCB in the volume's
VTOC is determined with the SCRATCH|NOSCRATCH parameter. If NOSCRATCH is specified
for an SMS- managed GDS, the GDS is un-cataloged from its GDG base and can be re-cataloged
outside its GDG base as an SMS non-VSAM entry with the roll-off status.

EMPTY
Specifies that all the generation data sets are to be un-cataloged when the maximum is exceeded.
Each data set's non-VSAM entry is automatically deleted from the catalog.
Abbreviation: EMP

NOEMPTY
Specifies that only the oldest generation data set is to be un-cataloged when the maximum is
reached.
Abbreviation: NEMP

OWNER(owner-id)
Identifies the generation data set's owner.
Note to TSO Users: If the owner is not identified with the OWNER parameter, the TSO user-id is
the default owner-id.

SCRATCH|NOSCRATCH
Specifies whether a generation data set's DSCB is to be deleted from the volume's VTOC when
the data set is un-cataloged (that is, when its entry is deleted from the catalog automatically, as
described under EMPTY|NOEMPTY, or explicitly as a result of a user entered DELETE request).

SCRATCH
Specifies that the generation data set's DSCB is to be deleted from the volume's VTOC when the
generation data set is un-cataloged.
Abbreviation: SCR

NOSCRATCH
Specifies that the generation data set's DSCB is not to be removed from the volume's VTOC when
the generation data set is un-cataloged.
Abbreviation: NSCR

TO(date)|FOR(days)
Specifies the retention period for the GDG being defined.

TO(date)
Specifies the date through which to keep the GDG being defined. The date appears in the form
yyddd, where yy is a two-digit year, and ddd is the three-digit (001 through 366) day of the year.
FOR(days)
Specifies the number of days to keep the GDG being defined. The maximum number that can be
specified is 9999.
Example: //IDCAMS EXEC PGM=IDCAMS,REGION=512K
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE GDG ( -
NAME (G1CLFAT.RC1E.AFSO) -
LIMIT (5) -
NOSCRATCH )
/*


JCL Pefresher
Poge ß of õ4
What is a Utility?

• A UTILITY program performs a basic function, i.e., it does a routine job which is required repeatedly
in an installation.
• MVS/DFP provides utility programs to assist users in organizing and maintaining data.

Each utility program falls into one of the three classes, based on the function performed and the type of
control of the utility. The three classes are: the system utilities, the data set utilities, and the independent
utilities.

System Utility Programs
System utility programs can be used to maintain and manipulate system and user data sets. These programs
must reside in an authorized library. They can be executed as jobs or be invoked as subroutines of an
authorized program.

Data Set Utility Programs
Data set utility programs can be used to reorganize, change or compare data at the data set or record level.
They can be executed as jobs or be invoked as subroutines of a calling program.

Independent Utility Programs
Independent utility programs can be used to prepare devices for system use when the operating system is
not available. They cannot be invoked by a calling program.

Control
System and data set utility programs are controlled by job control and utility control statements. The
independent utility program is controlled by utility control statements only.

Format of Utility Control Statements
Utility control statements must be contained in columns 2 through 71. A statement that exceeds 71
characters must be continued on one or more additional lines.

DFSORT
You can use DFSORT to
• Sort records in ascending or descending order within a file
• Merge two or more files into a single file

It is also used to perform the following functions:
• To select a subset of records from an input file
• To SUM values in records
• To reformat records



JCL Pefresher
Poge 9 of õ4
Job Control Statements

//JOB CARD
//STEPNAME EXEC PGM=SORT
//STEPLIB DD
Defines the library containing the DFSORT program.
If it is in a system library, this statement may be omitted
//SYSOUT DD
Defines the message data set
//SORTIN DD
Defines the INPUT dataset
//SORTWKnn DD
Defines a WORK storage dataset In most cases, one dataset is sufficient
//SORTOUT DD
Defines the OUTPUT dataset
//SYSIN DD
Contains DFSORT program control statements
Consider a book store file with the following record layout :

SL.NO FIELD START END DATA
1 BOOK TITLE 1 75 CH
2 AUTHOR'S LAST NAME 76 90 CH
3 AUTHOR'S FIRST NAME 91 105 CH
4 PUBLISHER 106 109 CH
5 COURSE DEPARTMENT 110 114 CH
6 COURSE NUMBER 115 119 CH
7 COURSE NAME 120 144 CH
8 INSTRUCTOR'S LAST NAME 145 159 CH
9 INSTRUCTOR'S INITIAL 160 161 CH
10 NUMBER IN STOCK 162 165 BI
11 NUMBER SOLD YTD 166 169 BI
12 PRICE 170 173 BI

CH - CHARACTER BI - BINARY

How to write a SORT statement?

Write the SORT statement between columns 2 and 71

Leave atleast one blank and write SORT FIELD= Write in parentheses, separated by commas

The starting position of the key field
Length of the key field in bytes
A code for data format
Letter 'A' for Ascending order or 'D' for Descending order



JCL Pefresher
Poge 10 of õ4
The following are the data format codes that can be specified.

DATA FORMAT CODE

EBCDIC CHARACTER CH
ASCII CHARACTER AC
BINARY BI
ZONED DECIMAL ZD
PACKED DECIMAL PD
Example 1

Let us see how we can write a SORT statement to sort these book store records by the DEPARTMENT
field
1 2..............................................71
SORT FIELDS=(110,5,CH,A)

Example 2

Now let us consider sorting by multiple fields like COURSE DEPARTMENT, COURSE NUMBER and
BOOK TITLE.

The SORT control statements would then look like -
SORT FIELDS=(110,5,CH,A,115,5,CH,A,1,75,CH,A)

This is .EQUIVALENT to SORT FIELDS=(110,10,CH,A,1,75,CH,A)

NOTE: The first two key fields being contiguous have been concatenated.

When all the control fields are of the same data format, it can be specified just once by using 'FORMAT='
parameter.
SORT FIELDS=(110,10,A,1,75,A),FORMAT=CH

Example 3

SORT JCL - Sort the book store file records in ASCENDING order of COURSE DEPARTMENT and
COURSE NUMBER and DESCENDING order of NUMBER IN STOCK.

Assume that the program DFSORT is available in a partitioned dataset IBM.UTIL.LOADLIB
//JOB CARD
//STEP01 EXEC PGM = SORT
//STEPLIB DD DSN=IBM.UTIL.LOADLIB,DISP=SHR
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=BOOK.STORE.INPUT,DISP=OLD
//SORTWK01 DD UNIT=3380,SPACE=(TRK,(1,1))
//SORTOUT DD DSN=BOOK.STORE.OUT,
// DISP=(NEW,CATLG,DELETE),
// UNIT=DISK,VOL=SER=TRG001,
// SPACE=(CYL,(10,1),RLSE),
// DCB=(RECFM=FB,LRECL=173,BLKSIZE=1730)
//SYSIN DD *
SORT FIELDS=(110,10,CH,A,162,4,BI,D)
/*


JCL Pefresher
Poge 11 of õ4
Tailoring the Input file.
• Input file can be tailored by either
Specifying an INCLUDE control statement for the records to be included OR
Specifying an OMIT control statement for the records to be omitted

• Both INCLUDE and OMIT cannot be used together
• Inclusion and Omission can be done by comparing the contents of a record field with either another
field OR a Constant (Character string / Decimal Number / Hexa decimal string)
• Two or more conditions can be combined by logical ‘AND’ and ‘OR’ Rules for Padding / Truncation
during field comparisons
In a field-to-field comparison, the shorter field is padded as appropriate (with blanks or zeros)
In a field-to-constant comparison, the constant is padded or truncated to the length of the field.
Note: The decimal constants are padded or truncated on the left Character and Hexadecimal constants are
padded or truncated on the right

How To Write An INCLUDE/OMIT Statement?

• Leave at least one blank and write INCLUDE
• Leave at least one blank and write COND=
• Write in parentheses, and separated by commas:
The location, length, and data format of the field to be compared comparison operator the
location, length, and data format of the field compared against OR a constant

List of Comparison operators

EQ EQUAL TO
NE NOT EQUAL TO
GT GREATER THAN
GE GREATER THAN OR EQUAL TO
LT LESS THAN
LE LESS THAN OR EQUAL TO

Example: INCLUDE statement

Suppose in the Book store file we want only the books (in ascending order of book title) for which the
number of copies sold YTD exceeds 250.

The DFSORT Control statements are
----------------------------------------------------
INCLUDE COND=(166,4,BI,GT,250)
SORT FIELDS=(1,75,CH,A)
----------------------------------------------------

Example: OMIT statement

Suppose only those books for which NUMBER SOLD YTD exceeds 125 and the LAST NAME of the
author is MARTIN are to appear in the descending order of Price

The corresponding DFSORT control statements are
------------------------------------------------------
OMIT COND=(166,4,BI,LE,125,OR,76,15,CH,NE,C'MARTIN')
SORT FIELDS=(170,4,BI,D)
------------------------------------------------------


JCL Pefresher
Poge 1Z of õ4
Reformatting

Reformatting records with OUTREC

After records are sorted they can be reformatted by using OUTREC control statement.
• Fields can be deleted
• Order of the fields can be rearranged
• Zeroes or blanks can be inserted BEFORE, BETWEEN or AFTER fields

If record length gets changed in the process of using OUTREC statement, the new record length has to be
specified on the SORTOUT DD statement.

How to write the OUTREC statement ?

• Leave at least one blank and write OUTREC
• Leave at least one blank and write FIELDS=
• Write in parentheses and separated by commas:
The input location and length of the fields to appear, in the desired order (data format is
not specified)

Reformatting the Output Record-Examples

Example 1
Suppose only the BOOK TITLE, NUMBER IN STOCK, are to appear in ASCENDING order of
BOOK TITLE. The output record becomes 79 bytes long. The SORTOUT DD Statement becomes

//SORTOUT DD DSN=BOOK.OUTPUT,
// DISP=(NEW CATLG,DELETE),
// UNIT=DISK,VOL=SER=TRG001,
// DCB=(RECFM=FB,LRECL=79,BLKSIZE=790),
// SPACE=(TRK,(5,2,),RLSE)

and the DFSORT control statements are

//SYSIN DD *
SORT FIELDS=(1,75,CH,A)
OUTREC FIELDS=(1,75,162,4)
/*

Example 2
If it is required to add a 4-byte Binary field between BOOK TITLE and NUMBER IN STOCK
and fill it up with ZEROES, the following control statement has to be given –

OUTREC FIELDS=(1,75,4Z,162,4)

and the LRECL on the SORTOUT DD statement should be 83

Example 3
Suppose a 20 character blank field is to be prefixed to the output records, the following control
statement has to be given - OUTREC FIELDS=(20X,1,75,4Z,162,4) and the LRECL on the
SORTOUT DD statement should be 103



JCL Pefresher
Poge 13 of õ4
Reformatting records with INREC

The INREC control statement allows to reformat the input records before they are processed. Reformatting
is performed before SORT/MERGE.

Note: If reformatting using INREC changes the location of key fields, the new location has to be specified
in the SORT statement.

Example

If only the BOOK TITLE and NUMBER SOLD YTD are to appear in descending order of NUMBER
SOLD YTD the following control statement has to be given -
//SYSIN DD *
INREC FIELDS=(1,75,166,4)
SORT FIELDS=(76,4,BI,D)
/*

MERGE FILES
• Files to be merged should be sorted on the same set of keys on which they are being merged
• Do not use SORTWKnn DD statement
• Instead of SORTIN DD, use SORTINnn DD; one SORTINnn DD statement for each input
file nn --> 01 to 16
• In Utility Control Statements, MERGE replaces SORT

Example: Merge 3 files that have been sorted in ASCENDING order of COURSE DEPARTMENT and
COURSE NUMBER and DESCENDING order of NUMBER IN STOCK.

//JOB CARD
//STEP01 EXEC PGM = SORT
//STEPLIB DD DSN=IBM.UTIL.LOADLIB,DISP=SHR
//SYSOUT DD SYSOUT=*
//SORTIN01 DD DSN=BOOK.STORE.INPUT1,DISP=OLD
//SORTIN02 DD DSN=BOOK.STORE.INPUT2,DISP=OLD
//SORTIN03 DD DSN=BOOK.STORE.INPUT3,DISP=OLD
//SORTOUT DD DSN=BOOK.STORE.OUT,
// DISP=(NEW,CATLG,DELETE),
// UNIT=DISK,VOL=SER=TRG001,
// SPACE=(CYL,(10,1),RLSE),
// DCB=(RECFM=FB,LRECL=173,BLKSIZE=1730)
//SYSIN DD *
MERGE FIELDS=(110,10,CH,A,162,4,BI,D)
/*
Processing Order Of Control Statements

INCLUDE/OMIT
|
V
INREC
|
V
SORT/MERGE
|
V


JCL Pefresher
Poge 14 of õ4
OUTREC


JCL Pefresher
Poge 1õ of õ4
IEBGENER
You can use IEBGENER to:
• Create a backup of a sequential data set or a member of a partitioned data set
• Produce a PDS data set or a member of a partitioned data set, from a sequential input data set
• Expand an existing partitioned data set by creating partitioned members and merging them
into the existing data set
• Produce an edited sequential of partitioned data set
• Reblock or change the logical record length of a data set

Job Control Statements
The following are the job control statements for IEBGENER.

//JOB CARD
//STEP01 EXEC PGM=IEBGENER
//SYSPRINT DD
Defines a sequential data set for messages
(System output device / Tape volume / DASD volume)
//SYSUT1 DD
Defines the INPUT data set (Sequential data set / Member of a PDS)
//SYSUT2 DD
Defines the OUTPUT data set (Sequential data set / PDS / Member of a PDS)
//SYSIN DD
Defines the CONTROL data set (Very often DUMMY)

Example 1
To copy a Tape file PROJ.EMP.MASTER, to a Disk file PROJ.EMP.MST.DISK
(VOL SER of Tape is 007311 Employee master record is 500 bytes in length)

//JOB CARD...
//STEP1 EXEC PGM=IEBGENER
//SYSUT1 DD DSN=PROJ.EMP.MASTER,
// UNIT=TAPE,DISP=OLD,
// VOL=SER=007311,
// LABEL=(,SL)
//SYSUT2 DD DSN=PROJ.EMPMST.DISK,
// UNIT=DISK,VOL=SER=PRJ3010,
// DISP=(NEW,CATLG),
// SPACE=(TRK,(10,10),RLSE)
// DCB=(RECFM=FB,LRECL=500,BLKSIZE=5000)
//SYSPRINT DD SYSOUT=A
//SYSIN DD DUMMY

Utility Control Statements

GENERATE - Indicates the number of member names and alias names, record identifiers, literals, and
editing information contained in the control data set.

(LABEL) GENERATE (MAXNAME=N)
(MAXFLDS=N)
(MAXGPS=N)
(MAXLITS=N)


JCL Pefresher
Poge 1ó of õ4
MAXNAME=N
Specifies a number, from 1 to 3276, that is no less than the total number of member names and
aliases appearing in subsequent MEMBER statements.

MAXFLDS=N
Specifies a number, from 1 to 4095, that is no less than the total number of FIELD parameters
appearing in subsequent RECORD statements.

MAXGPS=N
Specifies a number, from 1 to 2730, that is no less than the total number of IDENT parameters
appearing in subsequent RECORD statements.

MAXLITS=N
Specifies a number, from 1 to 32767, that is no less than the total number of characters contained
in the FIELD literal of subsequent RECORD statements.

MEMBER - Specifies the member name and alias of a member of a partitioned data set to be created.

|label| MEMBER NAME=(name|,alias||,...|)

NAME=(name,(alias)(,...))
Specifies a member name followed by a list of its aliases.

RECORD - Defines a record group to be processed and supplies editing information.

|label| RECORD |IDENT=(length,'name',input-location)|
|,FIELD=(|length|,|{input-location|'literal'}|,
|conversion|,|output-location|)||,FIELD=...|
|,LABELS=N|

IDENT - Identifies the last record of a collection of records in the input data set.

length - Length in bytes of the identifying names; cannot exceed 8 bytes.
name - Exact literal that identifies the last input record of a record group.
input-location - Starting byte of the field that contains the identifying name in the input records.

FIELD - Specifies field-processing and editing information.
length - Length in bytes of the input field or literal to be processed. Default is 80 bytes.
If a literal is to be processed, a length of 40 or less must be specified.

input-location - Specifies the starting byte of the field to be processed. Default is 1.
literal - Specifies a literal to be placed in the specified output location.
conversion - PZ for packed decimal to unpacked decimal;
ZP for unpacked to packed decimal conversion. Default (NO conversion).
output-location - Specifies the starting location of this field in the output records. Default is 1.

LABELS - Indicates the number of records in the SYSIN data set to be treated as user labels.



JCL Pefresher
Poge 17 of õ4
Example 2

Create a partitioned dataset (consisting of three members, their names being MEMBER1 MEMBER2,
MEMBER3) from sequential input.

//JOB CARD
//STEP01 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=A
//SYSUT1 DD DSN=INSET,DISP=OLD
//SYSUT2 DD DSN=NEWSET,UNIT=DISK,
// DISP=(NEW CATLG,DELETE),
// VOL=SER=TRG001,
// SPACE=(TRK,(10,5,5)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD *
GENERATE MAXNAME=3,MAXGPS=2
MEMBER NAME=MEMBER1
GROUP1 RECORD IDENT=(8,'FIRSTMEM',1)
MEMBER NAME=MEMBER2
GROUP2 RECORD IDEN (8,'SECNDMEM',1)
MEMBER NAME=MEMBER3
/*

NOTE: The first record statement identifies the last record to be placed in the first member

Example 3: EDITING

//SYSIN DD *
GENERATE MAXFLDS=3,MAXLITS=11
RECORD FIELD=(10,'**********',,1),
FIELD=(5,1,,11,), C COL-72
FIELD=(1,'=',,16) C COL-72
/*


JCL Pefresher
Poge 1ß of õ4

IEFBR14
You can use IEFBR14 to

Allocate and Catalog a data set
Delete a data set

Allocating and Cataloging a Data set

//JOB CARD ...
//STEP01 EXEC PGM=IEFBR14
//FILE1 DD DSN=PROJ.EMP.MASTER,
// DISP=(NEW,CATLG,DELETE),
// UNIT=DISK,VOL=SER=TRG001,
// SPACE=(5000,(100,100),RLSE),
// DCB=(RECFM=FB,LRECL=500)


Deleting a Data set

//JOB CARD ...
//STEP01 EXEC PGM=IEFBR14
//FILE1 DD DSN=PROJ.EMP.MASTER,
// DISP=(OLD,UNCATLG)
//FILE2 DD DSN=PROJ.EMP.MASTER
// DISP=(OLD,DELETE),UNIT=DISK
// VOL=SER=TRG001



JCL Pefresher
Poge 19 of õ4

IEBCOPY
You can use IEBCOPY to

• Create a backup of a partitioned data set
• Copy one or more data sets per COPY operation
• Copy a partitioned data set to a sequential data set (UNLOAD)
• Copy one or more data sets created by UNLOAD operation on any direct access device
(LOAD)
• Compress partitioned data sets in place
• Merge data sets (Except when UNLOADING)
• Recreate a data set that has exhausted its PRIMARY, SECONDARY or DIRECTORY space
allocation
• Alter load modules in place
• Copy and Reblock load modules

• Select members from a data set to be COPIED, UNLOADED or LOADED
• Replace identically named members in data sets
• Replace selected data set members
• Rename selected members
• Exclude members from a data set to be COPIED, LOADED or UNLOADED

Job Control Statements:

The following are the job control statements for IEBCOPY.

//JOB CARD
//STEP01 EXEC PGM=IEBCOPY
//SYSPRINT DD
Defines a sequential data set for messages
//SYSUT1 or anyname1 DD
Defines an INPUT partitioned data set
//SYSUT2 or anyname2 DD
Defines an OUTPUT partitioned data set
//SYSUT3 DD
Defines a spill data set on a direct access device.It is used when there is no space in virtual
storage for some or all of the current directory entries of the input PDS.
//SYSUT4 DD
Defines a spill data set on a direct access device. It is used when there is no space in virtual
storage for some or all of the current directory entries of the output PDS.
//SYSIN DD
Defines the CONTROL data set



JCL Pefresher
Poge Z0 of õ4
Example 1

To copy members from three partitioned data sets (DATASET1, DATASET2, DATASET3) to an existing
partitioned data set (DATASET4).

//JOB CARD
//STEP01 EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=A
//INOUT1 DD DSN=DATASET1,DISP=OLD
//INOUT2 DD DSN=DATASET2,DISP=OLD
//INOUT3 DD DSN=DATASET3,DISP=OLD
//INOUT4 DD DSN=DATASET4,DISP=OLD
//SYSUT3 DD UNIT=SYSDA,SPACE=(TRK,(1))
//SYSUT4 DD UNIT=SYSDA,SPACE=(TRK,(1))
//SYSIN DD *
COPYOPER COPY OUTDD=INOUT4,
INDD=INOUT1,
INDD=INOUT2,
INDD=INOUT3
/*

Example 2

To copy all members of INOUT6 (partitioned data set) to INOUT2 replacing identically named members.

//SYSIN DD *
COPYOPER COPY OUTDD=INOUT2
INDD=((INOUT6,R))
/*

Example 3

To copy members C, D, E, A and G from INOUT6 and INOUT2 to INOUT4. (INOUT6, INOUT2 and
INOUT4 are partitioned data sets).

//SYSIN DD *
COPYOPER COPY OUTDD=INOUT4
INDD=INOUT6
INDD=INOUT2
SELECT MEMBER=(C,D,E,A,G)
/*

Example 4

In EXAMPLE 3, if members E and G can replace identically named member of INOUT4, the control
statements are as follows

//SYSIN DD *
COPYOPER COPY OUTDD=INOUT4
INDD=INOUT6,INOUT2
SELECT MEMBER=(C,D,(E,,R),A,(G,,R))
/*


JCL Pefresher
Poge Z1 of õ4


Example 5

Suppose in EXAMPLE 4 the members C and D are renamed J and K respectively.
G Replaces identically named member of output PDS.
E is renamed T and replaces identically named member of output PDS.

//SYSIN DD *
COPYOPER COPY OUTDD=INOUT4
INDD=INOUT6,INOUT2
SELECT MEMBER=((C,J),(D,K) (E,T,R),A,(G,,R))
/*

Example 6

Suppose in a copy operation from INOUT1 to INOUT2, members A,B,C AND D have to be excluded

//SYSIN DD *
COPYOPER COPY OUTDD=INOUT2,INDD=INOUT1
EXCLUDE MEMBER = (A,B,C,D)
/*

Example 7

To compress a partitioned data set, assign the same data set name to INDD and OUTDD

//SYSIN DD *
COPYOPER COPY OUTDD=DATASET1,
INDD=DATASET1
/*

Example 8

Multiple COPY operations to copy members A and B from DATASET1 and all members of DATASET2
except C and G to DATASET3.

All members copied from DATASET2 are permitted to replace identically named members of DATASET3

//SYSIN DD *
COPYOPER COPY OUTDD=DATASET3,
INDD=DATASET1
SELECT MEMBER=(A,B)
COPY O=DATASET3,
I=(DATASET2,R)
EXCLUDE MEMBER=(C,G)
/*



JCL Pefresher
Poge ZZ of õ4
IEWL
Fundamentals

Modular programming: Aims to split a problem into small, manageable units of work (modules).

Source module: Program written in a symbolic language. Forms the input to a language translator.

Object module: The output from a language translator. Forms the input to the linkage editor.
An object module may, however, be directly executed via the Loader.

Load module: The output from the linkage editor; it is in a readily executable format.

Control Section: The smallest, separately relocatable unit of code.

External References: Symbolic references within a module to control sections in other modules.

External Symbol Dictionary (ESD): Contains one entry for each external reference within a
module.
Entry point: The point within a program from which execution begins. Every load module must
have a main entry point. There could be more than one entry point to a program - . Alternate entry
points.

Alias: A name which may be used in place of the member name of the load module for execution.
An alias:
• could be an alternate entry point,
• need not be an external symbol; in which case, the main entry point to the load
module is used.

Linkage Editor Processing

Inputs: The Linkage editor accepts, mainly, two types of inputs:
Primary Input, containing only object modules, and linkage editor control statements.
Additional user-specified input, which may contain either object modules and control
statements, or load modules.

Outputs:
• A load module.
• Diagnostic output.


Uses of Linkage Editor

The primary function of the linkage editor is to combine object modules and load modules in accordance
with the requirements stated in control statements into a single output load module. The other functions of
the linkage editor are:
• Editing load modules by replacing, deleting, rearranging, and ordering control sections as
directed by control statements.
• Aligning control sections and named common areas on 4K-byte page boundaries as directed
by control statements.
• Creating overlay programs in a structure defined by control statements.


JCL Pefresher
Poge Z3 of õ4
• Creating multiple copies of a load module.
• Providing special processing and diagnostic output options.
• Assigning attributes to load modules.
• Tracing processing history.
• Assigning an addressing mode (AMODE) to the main entry point, all
• True aliases, and each alternate entry point into the main load module.
• Deciding where the load module is to reside (RMODE). (Note: The Linkage editor merely
assigns AMODE/RMODE as specified. It is the application programmer's responsibility to
ensure that the code can work under these conditions.)

JCL to run a Linkage editor job

EXEC statement

The following details are specified in a linkage editor EXEC statement:
The program name - IEWL (HEWL, LINKEDIT, HEWLH096 may also be used instead) Link-
edit options - Include four types of parameters:

Module attributes, which describe the characteristics of the output load module.

E.g, Attributes like Reusability, Refreshable, and Test.

Special processing requirements, which affect linkage editor processing. E.g., Options
like Let and Exclusive call (XCAL).

Space allocation options, which affect the amount of storage used by the linkage editor
for processing and output module library buffers.
E.g., Size, DCBS options.

Output options, which specify the kind of output the linkage editor is to produce.
E.g., cross reference table (XREF), module map options (MAP).

Region-size requirements.

DD Statements

The following DD statements are relevant to a Link-edit job:

SYSLIB DD statement
When the automatic library-call mechanism is used, this DD statement describes the library which
contains the input datasets. The datasets concatenated to this DD must be partitioned.
DCB requirement: RECFM = F, FB; LRECL=80

SYSLMOD DD statement
Describes the output module library, which should be a PDS.
DCB requirement: RECFM = U
SYSUT1 DD statement
Describes the intermediate dataset, a PS dataset assigned to a DASD.
The DCB parameters are provided by the linkage editor.



JCL Pefresher
Poge Z4 of õ4
SYSLIN DD statement
It is the linkage editor SYSIN card. It describes the primary input dataset that can be assigned to
DASD, a magnetic tape unit, or the card reader. It may be a PS or a PDS with the member name.
The linkage editor control statements are specified as a part of the SYSLIN DD statement.
DCB requirement: RECFM = F, FB; LRECL=80

SYSPRINT DD statement
It describes the diagnostic output dataset, which is a PS assigned to an intermediate storage device.
DCB requirement: RECFM = FBA; LRECL=121

SYSTERM DD statement
This DD is optional. It describes a dataset that is used only for numbered error and warning
messages.
DCB requirement: RECFM = FBA; LRECL=121

Sample Link edit jobsteps

1 Example on multiple load module processing

//LKED EXEC PGM=IEWL,
// PARM='AMODE=31,RMODE=ANY,TEST,LIST,
// XREF,LET,MAP',REGION=512K
//SYSLIB DD DSN=SYS2.PROJ.LOAD,DISP=SHR
// DD DSN=SYS1.COB2LIB,DISP=SHR
//LIB1 DD DSN=TRG1T.TEST.DSN1,DISP=SHR
//LIB2 DD DSN=TRG1T.TEST.DSN2,DISP=SHR
//SYSLMOD DD DSN=TRG1T.TEST.LOAD,DISP=SHR
//SYSUT1 DD SPACE=(1024,(50,50)),UNIT=VIO
//SYSPRINT DD SYSOUT=*
//SYSLIN DD DSN=&&LOADSET,DISP=(OLD,DELETE)
// DD DDNAME=SYSIN
//SYSIN DD *
NAME LOAD1(R)
INCLUDE LIB1(MEM1,MEM2,MEM3)
NAME LOAD2
/*

2 Example on defining entry point

//SYSLIN DD DSN=&&OBJECT,DISP=(OLD,DELETE)
// DD *
ENTRY CDCHECK
NAME ROUT1
/*

Here, CDCHECK is the main entry point. Any references to ROUT1 will cause execution to begin at
CDCHECK. The member name of the load module is ROUT1.



JCL Pefresher
Poge Zõ of õ4
3 Example on defining aliases

//SYSLMOD DD DSN=TRG1T.MYDSN,DISP=OLD,UNIT=DISK
//SYSLIN DD DSN=&&OBJECT,DISP=(OLD,DELETE)
// DD *
ALIAS CODE1,CODE2,ROUTONE
NAME ROUT1
/*


The output module is assigned two additional entry points, CODE1 and CODE2. In addition, there is a
requirement to refer to the load module by the names ROUT1 and ROUTONE. So, ROUTONE has been
defined as an alias. The member name of the load module is, however, ROUT1.


4 Usage of the ORDER control statement

//SYSLMOD DD DSN=TRG1T.MYDSN,DISP=OLD,UNIT=DISK
//SYSLIN DD *
ORDER ROOT(P),MAIN,PART1
ORDER PART2(P),PART3
ORDER PART4,PART4,PARTZ(P)
INCLUDE SYSLMOD(LOAD)
/*

The control sections in the load module, LOAD are arranged by the linkage editor according to the
sequence specified by the ORDER statement. ROOT, PART2 and PARTZ are aligned on 4K page
boundaries.

5 Specifying AMODE and RMODE
6
The MODE statement may be placed before, between, or after object modules or other control statements.
It should precede the NAME statement for the module, if one is present.


//SYSLMOD DD DSN=TRG1T.MYDSN,DISP=OLD,UNIT=DISK
//SYSLIN DD DSN=&&OBJECT,DISP=(OLD,DELETE)
// DD *
MODE AMODE(31),RMODE(ANY)
ALIAS TESTLOAD
NAME MAINLOAD
/*


Here, the output load module, named MAINLOAD is created, given an alias of TESTLOAD; the residence
mode for the load module is ANY; the addressing mode for the main entry point, MAINLOAD and its
alias, TESTLOAD, is 31.





JCL Pefresher
Poge Zó of õ4
Question and Answers

1. What is JCL?

JCL is Job Control Language and is used for Batch processing.

JCL is interface between operating system (MVS) & application program (languages in
mainframe).

When two related programs are combined together on control statements is called Job Control
Language

2. What are the components of JCL statements?

1. Identifier field
2. Name field
3. Operation field
4. Operand field
5. Comments

3. What are the basic JCL Statements for a JOB?

a. JOB: Identifies a job and supplies accounting info
b. EXEC: Identifies a job step by indicating the name of the program to be executed.
c. DD: Identifies a data set to be allocated for the job step
d. Delimiter (/*): Marks the end of an in-stream dataset
e. Null(//): Marks the end of a job
f. Comments(//*): Provides Comments
g. PROC: Marks the beginning of a procedure
h. PEND: Marks the end of a procedure
i. OUTPUT: Supplies options for SYSOUT processing.

4. What are the three basic types of statements in a jobstream?

JOB (one per job stream)
EXEC (one or more per job)
DD (one or more per job step)

5. What are three major types of JCL statements? What are their functions?

JOB, EXEC and DD.

JOB - indicates start of jobstream to the operating system and through parms coded on it, certain
details about the job (time, region, message level, job accounting data).

EXEC - indicates the start of execution of a particular job step, be that step a program or a proc.

DD - is a data definition, which is used to describe the attributes of a data set (name, unit, type,
space, disposition).





JCL Pefresher
Poge Z7 of õ4
6. What is a DD statement?

Data Definition

7. What is the DD statement for a output file?

Unless allocated earlier, will have the following parameters: DISP=(NEW,CATLG,DELETE),
UNIT , SPACE & DCB

8. If the "DISP=" keyword is not coded for an existing dataset, what default values will be used
for "DISP="?

If the "DISP=" keyword is not coded ,then the DEFAULT Values are :
DISP=(NEW,DELETE,DELETE)

9. If the "DISP=" keyword is not coded for a new dataset, what default values will be used for
"DISP="?

If the "DISP=" keyword is not coded ,then the DEFAULT Values are
DISP=(NEW,DELETE,DELETE)

10. How do you access a file that had a disposition of KEEP?

Need to supply volume serial no. VOL=SER=xxxx.

11. What does a DISP=(NEW,CATLG,DELETE) mean?

That this is a new dataset and needs to be allocated, to CATLG the dataset if the step is successful
and to delete the dataset if the step abends.

12. What does a DISP=(NEW,CATLG,KEEP) mean?

That this is a new dataset and needs to be allocated, to CATLG the dataset if the step is successful
and to KEEP but not CATLG the dataset if the step abends. Thus if the step abends, the dataset
would not be catalogued and we would need to supply the vol. ser the next time we refer to it.

13. What does a DISP=(MOD,DELETE,DELETE) mean ?

The MOD will cause the dataset to be created (if it does not exist), and then the two DELETE 's
will cause the dataset to be deleted whether the step abends or not. This disposition is used to clear
out a dataset at the beginning of a job.

14. What is DISP=(NEW,PASS,DELETE)?

This is a new file and create it, if the step terminates normally, pass it to the subsequent steps and
if step abends, delete it. This dataset will not exist beyond the JCL.

15. What is MOD, SHR and PASS?

DISP=MOD is used when the dataset can be extended, ie, you can add records at the end of an
existing dataset.
DISP=SHR permits old data sets to be shared.
DISP=PASS passes the data set on to subsequent job steps, and each step can use the data set
once.


JCL Pefresher
Poge Zß of õ4

16. How do pass temp dataset from one step to another step?

By specifying the DISP as PASS for the temp dataset

17. What happens in case of DISP=MOD if data set specified doesn't exist?

If the data set doesn't exist, the system changes MOD to NEW unless the VOL parameter request
specific volume.

18. What are the parameters that have to be coded on a DD statement in order to retrieve a
cataloged data set?

The minimum parameters needed are DSN and DISP

19. What is the difference between specifying DISP=OLD and DISP=SHR for a dataset?

OLD specifies exclusive use of a dataset, SHR allows multiple jobs to concurrently access the
dataset Note: When updating a dataset, you would normally use OLD.

20. What is a COND parameter in JCL?

The COND parameter is used to control the execution of subsequent job steps, depending on the
condition code that is returned for a prior step.

COND means condition parameter, consists of 2 sub-parameters,
1st - return code from the previous step
2nd - condition.. It is compared with system return code of previous step.

//step1 EXEC PGM=abcd
//step2 EXEC PGM=xyz, COND=(4,LT)

Step2 will be executed when system return code of step1 is less than 4, else it is bypassed.

COND=EVEN Means execute this step even if any of the previous steps, terminated abnormally.
COND=ONLY Means execute this step only if any of the previous steps, terminated abnormally.

If specify COND=(0,LE) or COND=(4095,GE) in step then step never execute.

21. If condition specified in the COND parameter is true, then what happens?

If condition specified in the COND parameter is true, the step is bypassed

22. What is the difference between the COND parameter specified on the EXEC statement and
the one specified on the JOB statement?

COND specified on EXEC statement determines whether step should be bypassed or executed.
COND parameter defined on the JOB statement will determine whether Job should be terminated
at a certain point or continued

23. Can you execute a PROC from another PROC?

Yes. Only if cataloged in SYS1.PROCLIB. Upto 15 levels are allowed.



JCL Pefresher
Poge Z9 of õ4
24. What will happen if you attempt to restart a job in the middle of a JCL // IF.... // ENDIF?

Job will fall through to the ENDIF (not executing any steps), then resume execution with the first
step AFTER the // ENDIF.

25. How do you skip a particular step in a PROC/JOB?

Can use either condition codes or use the jcl control statement IF (only in ESA JCL)

26. WHAT IS A FILE?

A File is a collective group of records. The number of records on a file depends entirely on the
application associated with the file. Files may contain a few or more records.

27. How many positional Parameters are there in JOB statement?

There are two positional parameters in JOB statements.

28. What are three parameters you can specify on JOB as well as on EXEC statement?

TIME, REGION and COND parameters

29. How can you trap abends in the JCL?

Use IF ABEND statement in the JCL.

30. How do you restart a step in JCL?

Use RESTART=step name.

31. What is RESTART? How is it invoked?

RESTART is a JOB statement keyword. It is used to restart the job at a specified step rather than
at the beginning.

32. How do you pass parameters to the program as the job is being executed?

By using 'PARM' parameter in exec statement. The value mentioned here should be declared in
linkage section in the program and process thru procedure division. This technique is very useful
when you do not know the parameters at the time of coding the programs.

33. Why do you use a control card?

A control card can be a member of a PDS or a sequential dataset and is used for storing the date
fields; Definitions of VSAM files....etc.
You use control card because you cannot use a instream procedure in a procedure. Generally you
will be calling a Proc from your JCL and you cannot code instream procedure in the Proc and so
you will point to the dataset, which is called control card.



JCL Pefresher
Poge 30 of õ4
34. How do you submit JCL via a COBOL program? For the above question the solution is as
follows..

In your JCL define as
//JOBA JOB 1111,JOB1
//STEP01 EXEC PGM=PROG1
//ddname DD SYSOUT=(*,INTRDR)....

And your COBOL(PROG1) should look like this
SELECT JCL-FILE ASSIGN TO ddname.
Open this file and
Write the JCL statements into this file.

Example:

MOVE '//TESTJOB JOB 1111,VISVEISH' TO JCL-REC.
MOVE '//STEP01 EXEC PGM=IEFBR14' TO JCL-REC.
And close this file.
Then TESTJOB will be submitted.

35. How do you submit a JCL under CICS environment ?

Pass all the JCL codes to a COBOL variable (should be declare using OCCURS clause) and the
write the line one by one to the spool using CICS commands like SPOOL Close, SPOOL Open
and SPOOL Write . For more help refer CECI of CICS or CICS manual

36. What is meant by SOC7 ABEND codes?

S0C7 - Data exception error

You will get this Abend in following situation:
i. You are trying to move the low values or spaces into the numeric field
ii. Compare the numeric fields with low values
iii. Try to do some arithmetic operations on the low values.

To avoid this you have to always initialize the numeric fields otherwise they will contain the low
values.

37. How to pass the temporary dataset form one JOB step to another?

By specifying the DISP as PASS for the temp dataset

38. Write a JCL to execute a JOB by 7 A.M on JAN 20,1986?

THE code is : //*MAIN DEADLINE=(0700,B,012086)

39. How many types of libraries are there in JCL?

Libraries are of 3 types.

System Library: Such as STS1.LINKLIB
Private Library: Specifies in a JOBLIB or STEPLIB DD statements
Temporary Libraries: Created in a previous step of the JOB



JCL Pefresher
Poge 31 of õ4
40. What do you mean by INCLUDE statement in JCL?

An INCLUDE statement identifies a members of a PDS or PDSE that contains the set of JCL
statements is called an INCLUDE group. The system replaces the include statement with the
statements in the INCLUDE group.

41. What you mean by skeleton JCL?

JCL which changes during run time ie., the values for the JCL such as PGM name, DD name will
change. i.e., same JCL can be used for various job, equivalent to dynamic SQL....

42. What is the max block size for a Tape file?

It is 32,760.Based on that we can calculate efficient number of Records in a Block

43. What does the statements: TYPRUN=SCAN and TYPRUN=HOLD do in a JCL statement?

TYPRUN=SCAN checks the JCL for errors
TYPRUN=HOLD holds the job until further notice.

44. Which is the most widely used batch performance monitor for DB2?

DB2PM

45. What is QSAM error usually when it is occurs?

Usually it is occurs at the time of job submission.

46. What is the purpose of INCLUDE statement in a JCL?

It is used as an alternative for STEPLIB. When we specify the dataset name in include, it will
search in all the datasets specified in the include dataset.

47. What is PDS?

PDS is a library type of data set organization consisting of Directory and Members.
The directory consists of blocks, and each block is 256 bytes in length and can hold up to 5
members. Each member of the PDS is a sequential data set.

48. What is the difference between primary and secondary allocation for a dataset?

Primary allocation is The space allocated when the dataset is first created.
Secondary allocation is done when more space is required than what has already been allocated.

49. On n the DD statement, what is the main difference between creating a new sequential flat
file and PDS?

SPACE=(n,m) for a sequential file, SPACE=(n,m,p) for a PDS where n, m, and p are numbers.
The p designates how many directory blocks to allocate for a PDS.

50. How much is memory space involved, when we code BLOCKSIZE,TRK & CYL?

One block constitutes 32KB of formatted memory/ 42KB of unformatted memory
6 blocks makes one Track and 15 Tracks makes one cylinder


JCL Pefresher
Poge 3Z of õ4

51. What do you do if you do not want to keep all the space allocated to a dataset?

Specify the parameter RLSE ( release ) in the SPACE e.g. SPACE=(CYL,(50,50),RLSE)

52. How do you access a file that had a disposition of KEEP?

Need to supply Volume Serial Number VOL=SER=xxxx

53. What are the three guidelines do we have to follow when concatenating DD statements?

a. Datasets must be of the same type (disk or tape)
b. All datasets must have the same logical record length
c. The dataset with the largest block-size must be listed first

54. Is it possible to know the remaining free space in a Control Interval/Control Area once an
insertion has been made?

Not Possible

55. In which table PLAN is registered in?

RCT

56. What is mean by GDG?

GDG - group of dataset that are logically or chronologically related, referred by name and a
relative generation number - an integer which identifies the generation of a dataset and is coded in
parentheses after dataset name.

Absolute GDG name - GxxxxVyy, where xxxx - absolute generation number, yy-version number.
Can be sequential, direct, partitioned. (VSAM - no). Must always be cataloged.

Advantage - all datasets have the same name and system keeps track of adding new and retaining
previous generations and deleting oldest successive generation. To create a GDG we create a GDG
index in the system catalog with IDCAMS utility and then a model (prototype, DSCB) on the
same volume to supply DCB information.

EMPTY – When limit is reached all members are removed from the index, otherwise-only oldest.

SCRATCH – Removed members are uncataloged & deleted, otherwise - removed & uncataloged,
but remain in the system (not members of GDG any more).

GDG number is updated at the end of the job.

If number is not specified all generations will be processed from the beginning

57. What are advantages of GDG?

Advantage - all datasets have the same name and system keeps track of adding new and retaining
previous generations and deleting oldest successive generation.



JCL Pefresher
Poge 33 of õ4
58. How to create GDG?

To create a GDG we create a GDG index in the system catalog with IDCAMS utility and then a
model (prototype, DSCB) on the same volume to supply DCB information.

A GDG base is created in the system catalog and keeps track of the generation numbers used for
datasets in the group. IDCAMS utility is used to define the GDG base.

59. How do you refer a current (or latest) GDG dataset in the JCL?

Using Dataset name (0)

60. How do you mention in the JCL, when you want to create a new GDG data set? How do you
refer the same dataset in the next step?

Using dataset name (+1) , Dataset name(+1) only.
The catalogue information of GDG will not be updated until the completion of job.

61. Which Utility program is used to create GDG base?

IDCAMS, Define statement is used to create GDG base

62. Do all versions of the GDG have to be of the same record length?

No, the DCB of the model dataset can be overridden when you allocate new versions.

63. Hpw are different versions of GDG named?

Base-file-name.GnnnnV00 where nnnn= generation number (upto 255). nnnn will be 0000 for the
1st generation.

64. Suppose 3 generations of a GDG exist. How would you reference the 1 st generation in the
JCL?

Use GDG name(-2)

65. Suppose a generation of GDG gets created in a particular step of a proc.
How would you refer the current generation in a subsequent step? What would be the
disposition of this generation now?

Relative generation numbers are updated only at the end of the job, not at the end of a step.
To allocate a new generation, we would be using (+1) with a DISP of (NEW,CATLG,DELETE).
To refer to this in a subsequent step in the same job, we would again use (+1) but with a DISP of
SHR or OLD.

66. Can we brose or edit the GDG dataset if it is a tape entry?

No

67. What is model dataset label (Model DSCB)?

A model dataset label is a pattern for the dataset label created for any dataset named as a part of
the GDG group. The system needs an existing dataset to serve as a model to supply the DCB
parameters for the generation data group one wish to create. The model dataset label must be


JCL Pefresher
Poge 34 of õ4
cataloged. The model DSCB name is placed on the DCB parameter on the DD statement that
creates the generation data group.

68. How are GDGs concatenated?

Generation Data Groups are concatenated by specifying each dataset name and the generation
number for all generations of the generation data group. Otherwise to have all generations of a
generation data group, omit the generation number. The DD statement will refer to all generations.
The result is the same as if all individual datasets were concatenated. If generations are not on the
same volume, this will not work.

69. How is a new GDG coded?

A new GDG is coded as (+1) after the dataset name as follows: DSN=JAN.DATA(+1). This will
cause all generations to be pushed down one level at the end of the job.

70. What do you mean by spooling? Expand SPOOL?

This is managed by JES. This is used for Queuing the Outputs that are intended for Printing and
are first stored in SPOOLDASD.
71. How many Instream-Procedures (procs) can be coded in a single Job?

15

72. For how long a job can be executed continuously in a Mainframe?

248 Days

73. How may divisions are there in JCL-COBOL?

6

74. Maximum number of DD statement in a JOB?
3273

75. How much space OS allocates when you create a PS or PDS?

56 KB

76. Minimum number of dataset names (PDS) in one directory block?

6

77. The maximum number of steps in a JOB?

255

78. What is the parameter to be passed in the job card for the unlimited time, irrespective of the
job class

TIME=1440



JCL Pefresher
Poge 3õ of õ4
79. How many levels of nesting is allowed in PROCs?

15

80. The maximum number of instream procedure you can CODE in any JCL is?

15.

81. How much memory space involved, when we code BLOCKSIZE, TRK & CYL?

One block constitutes 32KB of formatted memory/ 42KB of Unformatted memory, 6 blocks
makes one Track & 15 Tracks makes one cylinder.

82. What is DSNDB06?

This is the Place where DB2 Catalog resides

83. What is the use of DSNDB07?

This is the area where sorting takes place in DB2

84. What is the purpose of Identification Division?

Documentation.

85. What is DATACOM DB?

It is a database used with VSE.

86. What is a Dummy Utility and What it does?

IEFBR14 is a Dummy utility and it is used for the sake of EXEC PGM= .... statement in
JCL[when used it wouldn't perform any task]. e.g. While Allocating a dataset you don't have to
run any utility [this could be done by giving DISP=NEW in DD statement]. But for a PGM name
must be given in EXEC statement, it is used.

87. What are three guidelines do we have to follow when concatenating DD statements?

a. Datasets must be of the same type (disk or tape)
b. All datasets must have the same logical record length
c. The dataset with the largest blocksize must be listed first.

88. On the DD statement, What is the main difference between creating a new sequential flat file
and a partitioned dataset?

SPACE=(n,m) for a sequential file
SPACE=(n,m,p) for a PDS where n, m, and p are numbers.

The p designates how many directory blocks to allocate.

89. What is the difference between IEBGENER, IEBCOPY and REPRO in IDCAMS utility?

IEBGENER – This is a dataset utility for copying sequential datasets which produces a PDS or a
member from a sequential dataset.


JCL Pefresher
Poge 3ó of õ4

IEBCOPY – This is a dataset utility for copying one PDS to another or to merge PDSs.

REPRO – This is for copying sequential datasets. More or less same as the IEBGENER.

90. How do you submit JCL via a COBOL program?

Use a file //dd1 DD sysout=(*,intrdr) write your JCL to this file.

91. How to execute a set of JCL statements from a COBOL program

Using EXEC CICS SPOOL WRITE(var-name) END-EXEC command.
Varname as a COBOL host structure containing JCL statements.

92. What is the difference between static call & Dynamic call?

In the case of Static call, the called program is a stand a log program, it is an executable program.
During run time we can call it in our called program. As about Dynamic call, the called program is
not an executable program it can executed thru the called program

93. What is a Procedure?

A set of pre-coded JCL that can be modified through the use of parameters or override cards.

The Procedure helps to minimize duplication of code. A procedure is initiated with the keyword
PROC.
There are two types of procedures in JCL. They are called Instream procedure and catalogued
procedure.

94. What is the difference between catalog procedure and In-Stream procedure?

Insream procedures are set of JCL statements written between JOB and EXEC statements, start
with PROC and end with PEND statement. Mainly used to test cataloged procedures.

Cataloged procedure is cataloged on the procedure library and is called by specifying the
procedure name on the EXEC statement.

95. Name some of the JCL statements that are not allowed in PROCs?

Some of the JCL statements which are not allowed in procedures are:
1. JOB, Delimiter(/*), or Null statements
2. JOBLIB or JOBCAT DD statements
3. DD * or DATA statements
4. Any JES2 or JES3 control statements

96. What do you feel makes a good program?

A program that follows a top down approach. It is also one that other programmers or users can
follow logically and is easy to read and understand.

97. Can we browse or edit the GDG dataset if it is a tape entry?

No



JCL Pefresher
Poge 37 of õ4
98. What are the maximum and minimum sizes of any CONTROL AREA (VSAM datasets) ?

Minimum Size: 1 Track
Maximum size: 1 Cylinder

99. How to get cursor position from system in CICS environment?

Get it from EIBCURPOS

100. How many parameters are there to a DISP statement and what are their uses.

There are three parameters.
Parameter 1: Current data set disposition (NEW, SHR, OLD, MOD)
Parameter 2: Normal close action for data set (CATLG, KEEP, DELETE)
Parameter 3: Abend action for data set (CATLG, KEEP, DELETE)

101. What is the error code SOC01 indicate?

Operation exception error
For example: a dataset open error

102. What is COMM?

COMM – Half Word binary




103. What does SYSIN * indicate?

Instream data follows this card and is terminated when followed by a card containing // or /* in
columns 1 and 2.

104. How do you continue a JCL card?

A comma should follow the last entry on the original card. The continuation card must have // in
columns 1 and 2, followed by a least one blank, and the rest of the Parms must start in or before
column 16.

105. What do you mean by a ADDRESS SPACE?

A address Space is the amount of Virtual Storage Seen by the Job.
2 GB for MVS/XA and MVS/ESA. TSO for On-Line Users.
Batch Jobs execute in an Intiator Address Space

106. What do you feel makes a good program?

A program that follows a top down approach. It is also one that other programmers or users can
follow logically and is easy to read and understand.



JCL Pefresher
Poge 3ß of õ4
107. How do you code Cobol to access a parameter that has been defined in JCL? And do you
code the PARM parameter on the EXEC line in JCL?

Using JCL with sysin
.//sysin dd * here u code the parameters(value) to pass in to cobol program/*and in
program you use accept variable name(one accept will read one row)/.another way.

In jcl using parm statement
ex: In exec statement parm='john','david' in cobol program you have to code linkage
section in that for first value you code lenth variable and variable name say, abc pic
x(4).it will take john inside to read next value u have to code another variable in the same
way above mentioned.

108. What is the directory block size in option 3.2?

It decides how many members you want to have under one PDS. One directory block can contain
5 members

109. How do you define a SORT file in JCL that runs the COBOL program?

Use the SORTWK01, SORTWK02,..... DD names in the step. Number of sort datasets depends on
the volume of data being sorted, but a minimum of 3 is required.

110. In the JCL, how do you define the files referred to in a subroutine?

Supply the DD cards just as you would for files referred to in the main program.

111. What are S0C1, S0C4, S0C5 and S0C7 ABENDs?

S0C1 (Operation Exception Error) - May be due to
• Missing or misspelled DD name
• Read/Write to unopened dataset
• Reading a dataset opened output mode
• Writing into a dataset opened input mode
• Called subprogram not found

S0C4 may be due to
• Missing Select statement (during compile)
• Bad Subscript/index
• Protection Exception
• Missing parameters on called subprogram
• Read/Write to unopened file
• Move data from/to unopened file

S0C5 May be due to
• Bad Subscript/index
• Close an unopened dataset
• Bad exit from a perform
• Access to I/O area (FD) before read

S0C7 may be due to


JCL Pefresher
Poge 39 of õ4
• Numeric operation on non-numeric data
• Un-initialized working storage
• Coding past the maximum allowed subscript

S0CB might be due to 1.Division by Zero


112. What is 'S0C7' abend?

S0C7 is Caused by invalid data in a numeric field.

113. What do you do to resolve SOC-7 error?

Basically you need to correct the offending data.
Many times the reason for SOC7 is an un-initialized numeric item. Examine that possibility first.

Many installations provide you a dump for run time abends (it can be generated also by calling
some subroutines or OS services through assembly language). These dumps provide the offset of
the last instruction at which the abend occurred. Examine the compilation output XREF listing to
get the verb and the line number of the source code at this offset. Then you can look at the source
code to find the bug. To get capture the runtime dumps, you will have to define some datasets
(SYSABOUT etc) in the JCL.

If none of these are helpful, use judgment and DISPLAY to localize the source of error.
Some installation might have batch program debugging tools. Use them.

114. What does SOC4 error mean?

S0C4 is a Storage violation error - can be due to various reasons. e.g.: READING a file that is not
open, invalid address referenced due to subscript error.

This error is faced when we execute the COBOL program. The main reason for this error is that a
variable is defined with fewer characters and we are trying to move data which is larger than the
actual storage space.

115. What are SD37, SB37, SE37 abends?

All indicate dataset out of space.
SD37 - no secondary allocation was specified.
SB37 - end of vol. and no further volumes specified.
SE37 - Max. of 16 extents already allocated.

116. What is S322 abend?

Indicates a time-out abend. Your program has taken more CPU time than the default limit for the
job class. Could indicate an infinite loop.

117. How do you trap abends in the JCL?

Use IF ABEND statement in the JCL



JCL Pefresher
Poge 40 of õ4
118. How many extents are possible for a sequential file ? For a VSAM file?

16 extents on a volume for a sequential file and 123 for a VSAM file.

119. What do you do if you do not want to keep all the space allocated to a dataset?

Specify the parameter RLSE ( release ) in the SPACE e.g. SPACE=(CYL,(50,50),RLSE)

120. How do you create a temporary dataset? Where will you use them?

Temporary datasets can be created either by not specifying any DSNAME or by specifying the
temporary file indicator as in DSN=&&TEMP. We use them to carry the output of one step to
another step in the same job. The dataset will not be retained once the job completes.

121. How do you restart a PROC from a particular step?

In job card, specify RESTART=PROCNAME.STEPNAME.
Where PROCNAME = Name of the JCL step that invoked the procedure and STEPNAME =
name of the procedure step where you want execution to start

122. How do you skip a particular step in a proc/JOB?

Can use either condition codes or use the JCL control statement IF (only in ESA JCL)

123. Can you code in-stream data in a PROC? How do you overcome if there are limitations?

No. One way is to code SYSIN DD DUMMY in PROC, and then override it in JCL with in-
stream data.

124. A PROC has five steps. Step 3 has a condition code. How can you override/nullify this
condition code?

Provide the override on the EXEC stmt in the JCL as follows:

//STEP001 EXEC procname,COND.stepname=value

All parameters on an EXEC stmt in the proc such as COND, PARM have to be overridden like
this.

125. How do you override a specific DDNAME/SYSIN in PROC from a JCL?

//<stepname.dd> DSN=...

126. What is NOTCAT 2

This is an MVS message indicating that a duplicate catalog entry exists. E.g., if you already have a
dataset with dsn = 'xxxx.yyyy' and u try to create one with disp=new,catlg, you would get this
error.

The program open and write would go through and at the end of the step the system would try to
put it in the system catalog. At this point since an entry already exists the catlg would fail and give
this message. You can fix the problem by deleting/uncataloging the first dataset and going to the
volume where the new dataset exists (this info is in msglog of job) and cataloging.



JCL Pefresher
Poge 41 of õ4
127. Why do you want to specify the REGION parameter in a JCL step?

To override the REGION defined at the JOB card level. REGION specifies the max region size.
REGION=0K or 0M or omitting REGION means no limit will be applied.

128. What does the TIME parameter signify ? What does TIME=1440 mean?

TIME parameter can be used to overcome S322 abends for programs that genuinely need more
CPU time. TIME=1440 means no CPU time limit is to be applied to this step.

129. What is the significance of TIME parameter in EXEC statement?

Time parameter is used to specify the amount of CPU time that a job or job step is permitted to
use before it terminates

TIME parameter can be specified both on JOB and EXEC statements

The Time parameter specified in EXEC statement will override the TIME parameter specified on
the JOB statement.

130. How do you check the syntax of a JCL without running it?

TYPERUN=SCAN on the JOB card or use JSCAN.

131. What does IEBGENER do?

Used to copy one QSAM file to another.
Source dataset should be described using SYSUT1 ddname.
Destination dataset should be described using SYSUT2.
IEBGENR can also do some reformatting of data by supplying control cards via SYSIN.

132. How do you send the output of a COBOL program to a member of a PDS?

Code the DSN as PDS(member) with a DISP of SHR. The DISP applies to the PDS and not to a
specific member.

133. I have multiple jobs (JCL 's with several JOB cards) in a member. What happens if I submit
it?

Multiple jobs are submitted (as many jobs as the number of JOB cards).

134. I have a COBOL program that ACCEPT 's some input data. How do you code the JCL
statement for this? (How do you code in-stream data in a JCL?)

//SYSIN DD*
input data
/*

135. Can you code in-stream data in a PROC? How do you overcome this limitation?

No. One way is to code SYSIN DD DUMMY in PROC, and then override it in JCL with in-
stream data.



JCL Pefresher
Poge 4Z of õ4
136. How do you run a COBOL batch program from a JCL? How do you run a COBOL/DB2
program?

To run a non DB2 COBOL program: //STEP001 EXEC PGM=MYPROG

To run a DB2 COBOL program:
//STEP001 EXEC PGM=IKJEFT01
//SYSTSIN DD *
DSN SYSTEM(....)
RUN PROGRAM(MYPROG)
PLAN(.....) LIB(....) PARMS(...)
/*

137. What is STEPLIB, JOBLIB? What is it used for?

Specifies that the private library (or libraries) specified should be searched before the default
system libraries in order to locate a program to be executed.

JOBLIB belongs to all the steps in the Job and should be immediately followed by job statement.
STEPLIB is available to the particular step only. STEPLIB has got higher priority over JOBLIB.

138. Where in the job-stream is the JOBLIB statement placed?

After the JOB statement and before the EXEC or PROC statement

139. What is order of searching of the libraries in a JCL?

First any private libraries as specified in the STEPLIB or JOBLIB, then the system libraries such
as SYS1.LINKLIB. The system libraries are specified in the linklist.

140. What happens if both JOBLIB & STEPLIB is specified?

STEPLIB will be given first priority. JOBLIB is ignored.

141. When you specify multiple datasets in a JOBLIB or STEPLIB, what factor determines the
order?

The library with the largest block size should be the first one.

142. How to change default PROCLIB?

//ABCD JCLLIB ORDER=(ME.MYPROCLIB, SYS1.PROCLIB)

143. The DISP in the JCL is MOD and the program opens the file in OUTPUT mode. What
happens? The DISP in the JCL is SHR and the PGM opens the file in EXTEND mode. What
happens?

Records will be written to end of file (append) when a WRITE is done in both cases.

144. What are the valid DSORG values?

PS - QSAM, PO - Partitioned, IS – ISAM



JCL Pefresher
Poge 43 of õ4
145. What is the max block-size for a Tape file?

It is 32,760.Based on that we can calculate efficient number of Records in a Block

146. What is the purpose of include statement in a JCL?

It is used as an alternative for STEPLIB. When we specify the dataset name in include, it will
search in all the datasets specified in the include dataset.

147. What is the difference between a symbolic and an override in executing a PROC?

A symbolic is a PROC placeholder; the value for the symbolic is supplied when the PROC is
invoked, eg. &symbol=value. An override replaces the PROC's statement with another one; it
substitutes for the entire statement.

148. What is a GDG? How is it referenced? How is it defined? What is a MODELDSCB?

GDG stands for generation data group. It is a dataset with versions that can be referenced
absolutely or relatively. It is defined by an IDCAMS define generation datagroup execution.

149. Explain concatenating datasets.

Datasets can be grouped in a DD statement one after another, eg. in a JOBLIB statement where the
load module can exist in one of many datasets.

150. What are the keywords associated with DCB? How can you specify DCB information? What
is the OS precedence for obtaining that DCB information, ie. Where does the system look for
it first?

The keywords associated with the DCB parameter are LRECL, RECFM, BLKSIZE and DSORG.
The DCB information can be supplied in the DD statement. The system looks for DCB
information in the program code first.

151. What is the purpose of the PARM keyword in the EXEC statement?

The value after the PARM= specifies control information to be passed to the executing program of
the job step.

152. What is the meaning of data definition name (ddname) and dataset name (dsname) in the
DD statement?

Data definition name is the eight character designation after the // of the DD statement. It matches
the internal name specified in the steps executing program. In COBOL that's the name specified
after the ASSIGN in the SELECT ASSIGN statement. Dataset name is the operating system
(MVS) name for the file.

153. How is the keyword DUMMY used in JCL?

For an output file DUMMY specifies that the output is to be discarded. For input it specifies that
the file is empty.



JCL Pefresher
Poge 44 of õ4
154. What does the keyword DCB mean and what are some of the keywords associated with it?

DCB stands for data control block; it is a keyword for the DD statement used to describe
datasets. Keywords associated with it are BLKSIZE, DEN, LRECL and RECFM.

155. What is the difference between BLKSIZE and LRECL?

LRECL is the logical record length , where as BLKSIZE is multiples of LRECL


156. JCL contain several JOB cards in a member. What happen if I submit that member?

All the jobs in a member are submitted

157. In // SYSPRINT DD SYSOUT=*, what is mean for ‘*’?

* - Means not the DEFAULT class. It actually refers the same output device specified in the
"MSGCLASS" parameter of JOB statement

158. How does the system get information about the block size?

DCB info comes from:
1. Program - FD: BLOCK CONTAINS 3 RECORDS RECORD CONTAINS 100 CHARACTERS
2. The label - like a tape
3. From the VTOC - for Dasd
4. From the JCL - DCB=BLKSIZE=nnn.

159. What is a Label?

The LABEL parameter tells the type of label, the relative file number, and whether the data set is
to be protected for input or output.

160. When should be NL be specified as a type of label processing?

NL should be specified when a program needs to process unlabeled tapes

161. How do you describe the input data, which is a part of the input job stream?

You should use either DD * or DD Data.

162. What is the difference between * and DATA?

DD * and DD DATA describe the input data which follows the above mention cards. If the input
data contains record switch // in col 1 and 2 then DD Data should be used.

163. What is the purpose of SPACE parameter?

It is a keyword parameter, which should allocated on the DD statement for the output data sets
stored on the disk. It consists of the following sub-parameters:

SPACE=(BLKS/CYL/TRK,(primary, secondary, index),RLSE,CONTIG)



JCL Pefresher
Poge 4õ of õ4
164. What is a RLSE?

RLSE releases all unused space when the data set is closed. It permits you to allocate more space
than perhaps, it needed without wasting space.

Space is released only if the data set is not empty and if the data set is closed after being opened.

165. What is a CONTIG?

CONTIG requests the primary space be allocated only on contiguous tracks and cylinders, that is
all tracks on a cylinder are contiguous, and if more than one cylinder is needed, the cylinders are
also contiguous.

166. What is the significance of OUTLIM parameter?

The OUTLIM parameter is coded on the DD statement and is used to limit the number of lines
that are output to the destination specified in the SYSOUT.

167. How do you read input that is mentioned in the sysin card of JCL through COBOL
program?

Using ACCEPT Statement

168. What is the DD name, where all your DISPLAY statements will be routed?

SYSOUT

169. What kind of information DCB parameter provides?


It provides what kind of record will be processed, such as fixed block or variable block, length of
the record, blocksize.
Also some other kinds of information also provided such as DSORG, OPTCD, etc.

170. What is the use of a delimiter statement?

It is normally used for instream input and specifies where the instream starts and where it ends.
But it is very much obsolete now.

171. How does the system get information about the block size?

DCB info comes from:
1. Program - FD: BLOCK CONTAINS 3 RECORDS RECORD CONTAINS 100
CHARACTERS
2. The label - like a tape
3. From the VTOC - for Dasd
4. From the JCL - DCB=BLKSIZE=nnn

172. How do you override a specific DDNAME/SYSIN in PROC from a JCL?

//<stepname.dd> DSN=…



JCL Pefresher
Poge 4ó of õ4
173. How would you limit the time allotted for a JOB to forty-five seconds?

With a TIME Parm on the JOB statement in the form: TIME=(, 45)

174. What happens if you submit a job without a jobcard?

The job will be terminated by the computer stating that no jobcard is present.

175. In case of Temporary Data Sets, can we retain the data set once the job completes?

NO. The dataset will not be retained once the job completes

176. What are LASTCC and MAXCC?

LASTCC implies the resultant code resulted from the last step
MAXCC implies the max return code resulted from all the previous steps

177. How do you change LASTCC and MAXCC values in the JCL?

Using SET command like SET MAXCC = 8

178. What JCL statement will you use to activate a dump if there is an abend?

SYSUDUMP DD SYSOUT=A or MSGCLASS

179. How do you send the output of a COBOL program to a member of PDS?

Code the DSN as PDS(member) with a DISP of SHR. The DISP applies to the PDS and not to a
specific member

180. Compare IEBGENER and IEBCOPY utilities?

IEBGENER is used to copy one sequential data set to another dataset.
Where as IEBCOPY is used to copy members of a Partitioned dataset, to load tape data sets to
direct access devices and to compress datasets


181. What is meant by INCLUDE statement in SORT step?

The Include statement is coded in the sort program to select only specified records which meet the
specified criteria.

182. What is meant by SUM FIELDS = NONE in the SORT utility?

Duplicate records will be eliminated.

183. How do you define a sort file in JCL that runs the COBOL program?

Use the SORTWK01, SORTWK02,..... dd names in the step. Number of sort datasets depends on
the volume of data being sorted, but a minimum of 3 is required.



JCL Pefresher
Poge 47 of õ4
184. Can I reformat a record layout before/after sorting?

You can change the layout of a record both before and after it is sorted using the INREC and
OUTREC keywords. You simply specify the fields to be included in the new record.

INREC reformats the record layout before it is passed through the sort, while OUTREC will
reformat the record layout after the record has been sorted.

Here's some examples:

SORT FIELDS=(1,10,CH,A)
INREC=(1,10,CH,50,4,PD,40,4,PD)

SORT FIELDS=(1,10,CH,A)
OUTREC=(1,10,50,4,40,4)

Both examples will reformat the record so that it consists of the first 10 bytes of the input record,
followed by the 4 bytes starting at position 50, followed by the 4 bytes starting at position 40.

185. Can I sort records into different files?

DFSORT allows you to write to multiple output files. There are two different ways to do this.
Both methods use the OUTFIL keyword, and are identical except in how you specify the
DDNAME.

Method 1 allows you to specify the DDNAME to be written to:

SORT FIELDS=(1,10,CH,A)
OUTFIL FNAMES=CUST1,
INCLUDE=(1,1,CH,EQ,C'A')
OUTFIL FNAMES=CUST2,
INCLUDE=(1,1,CH,EQ,C'B')

In this example the sort file will be split into 2 files, CUST1 and CUST2, depending on whether
the first character is A or B. CUST1 and CUST2 must be defined as DDNAMES in the JCL.

Method 2 uses DDNAMEs defined by DFSORT in the form SORTOFxx.

SORT FIELDS=(1,10,CH,A)
OUTFIL FILES=1,INCLUDE=(1,1,CH,EQ,C'A')
OUTFIL FILES=2,INCLUDE=(1,1,CH,EQ,C'B')

In this example the sort file is split into 2 files SORTOF1 and SORTOF2, depending on whether
the first character is A or B. SORTOF1 and SORTOF2 must be defined as DDNAMEs in the JCL.


186. How can I use DFSORT to create reports?

DFSORT has some powerful reporting capabilities. You can use the OUTFIL keyword to define
the report layout, including Headings, record counts, trailers and control breaks. You can also
define multiple reports using the same techniques as for multiple output files.
Example:




JCL Pefresher
Poge 4ß of õ4
SORT FIELDS=(1,10,CH,A)
OUTFIL HEADER1=(5:'CONTROL REPORT',5X,&DATE=(DM4/),5X,'PAGE: '
&PAGE),
HEADER2=(10:'Invalid Keys ',30X,'PAGE: ',&PAGE,/,
5:'KEY',15X,'NAME'),
OUTREC=(5:1,13,10X,20,30,74X),
TRAILER1=(15:'TOTAL NO OF RECORDS IS ',COUNT,/,
20:'***** END OF REPORT *****')

187. How can I remove records with duplicate keys?

You can remove duplicates by specifying SUM FIELDS=NONE. This will remove any records
with equal sort fields.

Example:

SORT FIELDS=(1,10,CH,A,43,5,CH,A)
SUM FIELDS=NONE

188. Can more than one dataset be stored in a tape? If yes, how?

By using LABEL parameter and specifying the numbers of the datasets in order, such as:
LABEL=(1,SL), LABEL=(2,SL), LABEL=(3,SL).
These 1, 2 or 3 shows the order of the datasets placed in the tape.

189. What is the use of single & double ampersand in the JCL or PROC?

The single ampersand is used to represent symbolic parameter and double ampersand is used to
represent temporary datasets.
190. What are the maximum and minimum sizes of any CONTROL AREA?

Minimum Size : 1 track Maximum size : 1 cylinder

191. Is it possible to know the remaining free space in control interval / control area, once an
insertion is made?

You can find using LISTCAT command

192. How do you specify the DD card in JCL when you want to read records from VSAM file
based on alternate index in the COBOL program?

You need to mention in the JCL base cluster and Path for the alternate index.

E.g:
In the Cobol program the input-output section is coded as below and file accessed using VSAM
file.

SELECT ALT-VSAM FILE ASSIGN TO ALTMSTR

Then JCL should be coded as followed

//ALTMSTR DD DSN=TEST.MASTER.CLUSTOR, DISP=SHR
//ALTMSTR1 DD DSN=TEST.MSTR.ALTPATH, DISP=SHR



JCL Pefresher
Poge 49 of õ4
193. How are datasets concatenated?

Datasets are concatenated by writing a normal DD statement for the first dataset and then adding a
DD statement without a DDNAME for each dataset to be concatenated in the order they are to be
read. The following is an example of three datasets concatenated:

//YEARDAT DD DSN=JAN.DATA,DISP=SHR
// DD DSN=FEB.DATA,DISP=SHR
// DD DSN=MAR.DATA,DISP=SHR

194. What is the difference between BLKSIZE AND LRECL?

LRECL is the logical record length, where as BLKSIZE is multiples of LRECL

195. How do you convert ASCII data format to EBCDIC?

Use OPTCD sub parameter in the DCB parameter




JCL Pefresher
Poge õ0 of õ4
1. //MYJOB JOB(T,U202,SH1),'FRANK SMITH',CLASS=A
//STEP01 EXEC PGM=PGM01
//INFILE DD DSN=TEST.PAYROLL.DATA,DISP=SHR
//SYSOUT SYSOUT=A
//STEP02 EXEC PGM=PGM02
//INFILE DD DSN=TEST.PERSONEL.DATA,DISP=SHR
//SYSOUT SYSOUT=A
//STEP03 EXEC PGM=PGM03
//OUTFILE DD DSN=TEST.BENEFITS.DATA,DISP=SHR

Referring to the above coding, which line, added to STEP03, gives the OUTFILE dataset the same
attributes as the INFILE dataset in STEP01?

A) // DUP=TEST.PAYROLL.DATA,DISP=(NEW,KEEP)
B) // CLONE=TEST.PAYROLL.DATA,DISP=(NEW,KEEP)
C) // COPY=TEST.PAYROLL.DATA,DISP=(NEW,KEEP)
D) // SAME=TEST.PAYROLL.DATA,DISP=(NEW,KEEP)
E) // LIKE=TEST.PAYROLL.DATA,DISP=(NEW,KEEP)

2. Which line defines that the SYSOUT dataset will print 45 lines to a page and print at the offsite
location called HOUSTON?

A) //H002 SYSPRT DD REMOTE=HOUSTON,LINEPAGE=45
B) //HOU1 OUTPUT DD DEST=HOUSTON,LINECT=45
C) //H003 SYSPARM DD SYSTEM=HOUSTON,PAGELIMIT=45
D) //HOU2 PRTOUT DD NODE=HOUSTON,PAGESIZE=45
E) //H001 SYSOUT DD LOC=HOUSTON,LINELMT=45

3. Which statement transmits print output to the remote location called DETROIT?

A) /*TRANS PRINT DETROIT
B) \\*XMIT REPT DETROIT
C) //*XMIT PRINT DETROIT
D) /*ROUTE PRINT DETROIT
E) \*XCHG REPORT DETROIT

4. Which of the following JCL statements obtains exclusive use of a dataset?

A) //INFILE DD DSN=INFILE.PROD.DATA,DISP=RESV
B) //INFILE DD DSN=INFILE.PROD.DATA,DISP=OLD
C) //INFILE DD DSN=INFILE.PROD.DATA,DISP=SHR
D) //INFILE DD DSN=INFILE.PROD.DATA,DISP=EXCL
E) //INFILE DD DSN=INFILE.PROD.DATA,DISP=LOCK

5. //T0DPFDSI JOB (00010,G000600,08E1),'Frank Smith',CLASS=E,
// MSGCLASS=L,NOTIFY=T0DPFDS
//STEP1 EXEC PGM=PROGRAM1
//STEPLIB DD DSNAME=LIBRARY.TEST.LOADLIB,DISP=SHR
//SYSOUT DD SYSOUT=A
//FILEIN DD DSNAME=FILE1.TEST.DATA,DISP=SHR
//FILEOUT DD DSNAME=FILE2.TEST.DATA,DISP=(NEW,DELETE),
// AVGREC=U,SPACE=(80,(100,20)),
// DCB=(LRECL=80,RECFM=FB)



JCL Pefresher
Poge õ1 of õ4
What would cause the above job to fail if it terminated on an S222 error?

A) Exceeded Line Limit B) Device Time Out
C) Security Access Denied D) Operator Cancellation
E) System Time Out

6. //A10010 PROC
//STEP2 EXEC PGM=PROGRAM2
//STEPLIB DD DSNAME=LIBRARY.TEST.LOADLIB,DISP=SHR
//SYSOUT DD SYSOUT=A
//FILEIN DD DSNAME=FILE2.TEST.DATA,DISP=SHR
//FILEOUT DD DSNAME=FILE3.TEST.DATA,DISP=(NEW,CATLG,DELETE),
// SPACE=(800,(100,20),RLSE),
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=800)

Referring to the above coding, what statement can you add to change the space parameter of
FILE3.TEST.DATA when the following EXEC statement invokes the proc A10010?
//STEP1 EXEC PROC=A10010

A) //STEP1 EXEC PROC=A10010
//STEP2.FILEOUT DD SPACE=(800,(250,50),RLSE)
B) //STEP1 EXEC PROC=A10010
// DD *
FILEOUT.STEP2 DD SPACE=(800,(250,50),RLSE)
C) //STEP1 EXEC PROC=A10010
/* OVERRIDE
A10010.STEP2 DD SPACE=(800,(250,50),RLSE)
D) //STEP1 EXEC PROC=A10010
//SUBSTITUTE A10010.FILEOUT=(SPACE=(800,(250,50),RLSE))
E) //STEP1 EXEC PROC=A10010,
// OVERRIDE=(A10010.FILEOUT,SPACE=(800,(250,50),RLSE)

7. //INFILE DD DSN=PROD.ACCOUNTING.MASTER,DISP=OLD,
Which one of the following parameters calls for the fourth tape of the above multi-volume tape
dataset?

A) // VOL=SER=(5,4) B) // VOL=(,,4)
C) // TAPE=SER=4 D) // SER=NUM=(,4)
E) // SERIES=(4)

8. //T0DPFDSI JOB (00010,G000600,08E1),'Frank Smith',CLASS=E,
// MSGCLASS=L,NOTIFY=T0DPFDS
//STEP1 EXEC PGM=PROGRAM1
//STEPLIB DD DSNAME=LIBRARY.TEST.LOADLIB,DISP=SHR
//SYSOUT DD SYSOUT=A
//FILEIN DD DSNAME=FILE1.TEST.DATA,DISP=SHR
//FILEOUT DD DSNAME=FILE2.TEST.DATA,DISP=(NEW,DELETE),
// AVGREC=U,SPACE=(80,(100,20)),
// DCB=(LRECL=80,RECFM=FB)

What caused the above job to fail if it terminated in STEP1 on an S913 error?



JCL Pefresher
Poge õZ of õ4
A) Security Access Denied
B) Operator Cancellation
C) System Time Out
D) Device Time Out
E) Exceeded Line Limit

9. Which JES2 statement specifies that the job is to run on the system called N002?

A) /*JOBNODE SYS=N002 B) /*SYSID SYSNAME=N002
C) /*SYSTEM NODE=N002 D) /*JOBPARM SYSAFF=N002
E) /*SYSNODE SYSID=N002

10. Which line suspends tape-volume requests until the dataset has been opened?

A) //FILEIN1 DD DSNAME=FILE1.TEST.DATA,DISP=(,CATLG,DELETE),
// UNIT=(3480,,DEFER)
B) //FILEIN1 DD DSNAME=FILE1.TEST.DATA,DISP=(,CATLG,DELETE),
// DEV=3480,VOL=HOLD
C) //FILEIN1 DD DSNAME=FILE1.TEST.DATA,DISP=(,CATLG,DELETE),
// UNIT=(3480,WAIT)
D) //FILEIN1 DD DSNAME=FILE1.TEST.DATA,DISP=(,CATLG,DELETE),
// VOL=(565501,,,WAIT)
E) //FILEIN1 DD DSNAME=FILE1.TEST.DATA,DISP=(,CATLG,DELETE),
// DEVICE=(3480,SUSPEND)

11. Which JCL statement acquires the 12th generation of the generation dataset INFILE.DATA?

A) //INFILE DD DSN=INFILE.DATA,GEN=12,DISP=SHR
B) //INFILE DD DSN=INFILE.DATA(12),DISP=SHR
C) //INFILE DD DSN=INFILE.DATA,GEN(12),DISP=SHR
D) //INFILE DD DSN=INFILE.DATA.GV(12),DISP=SHR
E) //INFILE DD DSN=INFILE.DATA.G0012V00,DISP=SHR

12. //MYJOB JOB(T,U202,SH1),'FRANK SMITH',CLASS=A
//STEP01 EXEC PGM=PGM01
//INFILE DD DSN=TEST.PAYROLL.DATA,DISP=SHR
//SYSOUT SYSOUT=A

Which change to STEP01 above will specify that STEP01 can be Automatically restarted by an
operator if that step fails during execution?

A) //STEP01 EXEC PGM=PGM01,AR=OS
B) //STEP01 EXEC PGM=PGM01,RST=OP
C) //STEP01 EXEC PGM=PGM01,ARST=OP
D) //STEP01 EXEC PGM=PGM01,RD=R
E) //STEP01 EXEC PGM=PGM01,OP=RST

13. Which statement transmits print output to the remote location called DETROIT?

A) /*TRANS PRINT DETROIT
B) \\*XMIT REPT DETROIT
C) //*XMIT PRINT DETROIT
D) /*ROUTE PRINT DETROIT
E) \*XCHG REPORT DETROIT


JCL Pefresher
Poge õ3 of õ4

14. //SYDOEJ JOB USER=SYDOE,CLASS=A
// EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=A
//MODEL DD DSN=PAYROLL.WEEKLY.MASTER,DISP=(NEW,KEEP),
// UNIT=SYSDA,SPACE=(TRK,0)
// DCB=(DSORG=PS,RECFM=FB)
//SYSIN DD *
DEFINE GDG ( NAME(PAYROLL.WEEKLY.MASTER) -

Which one of the following, added to the above generation data group definition, removes all
generations, excluding the current generation, when the limit of 32 generations is exceeded?

A) ALL B) CLEAR C) EVERY D) EMPTY E) REMOVE

15. //TEMPDS2 DD DSNAME=TEMP.DATA,DISP=(NEW,PASS),UNIT=3380,
// SPACE=(TRK,15)
How can the above code be altered to make the above dataset reside in virtual storage?

A)//TEMPDS2 DD DSNAME=TEMP.DATA,DISP=(NEW,PASS),UNIT=3380,SPACE=VIRT
B) //TEMPDS2 DD DSNAME=TEMP.DATA,DISP=(NEW,PASS),UNIT=VIRT,
// SPACE=(TRK,15)
C) //TEMPDS2 DD DSNAME=TEMP.DATA,DISP=(NEW,PASS),UNIT=3380,
// SPACE=VIRTUAL
D) //TEMPDS2 DD DSNAME=TEMP.DATA,DISP=(NEW,PASS),UNIT=3380,
// SPACE=VSTOR
E) //TEMPDS2 DD DSNAME=TEMP.DATA,DISP=(NEW,PASS),UNIT=VIO,
// SPACE=(TRK,15)

16. Which statement, added before the jobcard, alters the job's position in the JES spool?

A) //FACTOR 12 B) /*SPOOL 12
C) /*PRIORITY 12 D) //POSITION 12
E) //SCHEDULE 12

17. //A10010 PROC
//STEP2 EXEC PGM=PROGRAM2
//STEPLIB DD DSNAME=LIBRARY.TEST.LOADLIB,DISP=SHR
//SYSOUT DD SYSOUT=A
//FILEIN DD DSNAME=FILE2.TEST.DATA,DISP=SHR
//FILEOUT DD DSNAME=FILE3.TEST.DATA,DISP=(NEW,CATLG,DELETE),
// SPACE=(800,(100,20),RLSE),
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=800)

If the default region size for the job is 528 kilobytes, how can you override STEP2 of the above
procedure to have a 2-megabyte region size when it is executed?

A) //A10010 EXEC A10010,REGION=(STEP2,2MEG)
B) //A10010 EXEC A10010,PARM.STEP2=(REGION,2M)
C) //A10010 EXEC A10010,STEP2(TIME=2M)
D) //A10010 EXEC A10010,REGION.STEP2=2M
E) //A10010 EXEC A10010,STEP2.REGION=2M



JCL Pefresher
Poge õ4 of õ4
18. //MYJOB JOB(T,U202,SH1),'FRANK SMITH',CLASS=A
//STEP01 EXEC PGM=PGM01
//INFILE DD DSN=TEST.PAYROLL.DATA,DISP=SHR
//SYSOUT SYSOUT=A
//STEP02 EXEC PGM=PGM02
//INFILE DD DSN=TEST.PERSONEL.DATA,DISP=SHR
//SYSOUT SYSOUT=A
//STEP03 EXEC PGM=PGM03
//OUTFILE DD DSN=TEST.BENEFITS.DATA,DISP=SHR

Referring to the above coding, which line, added to STEP03, gives the OUTFILE dataset the same
attributes as the INFILE dataset in STEP01?

A) // DUP=TEST.PAYROLL.DATA,DISP=(NEW,KEEP)
B) // CLONE=TEST.PAYROLL.DATA,DISP=(NEW,KEEP)
C) // COPY=TEST.PAYROLL.DATA,DISP=(NEW,KEEP)
D) // SAME=TEST.PAYROLL.DATA,DISP=(NEW,KEEP)
E) // LIKE=TEST.PAYROLL.DATA,DISP=(NEW,KEEP)

JCL
JCL consists of control statements that introduces a computer job to an OS. JCL contains a set of statements referred to as Program control cards, provides necessary specifications such I/O resource requirements to process a Job. JCL is used for submitting batch jobs. JCL is not a procedural language like COBOL and is also not used to write Programs. Format of JCL statement //name operation operand comment

Name field identifies the statement. It should be of a maximum of 8 characters long, should start from 3rd column, The first character must be an alphabet. Operation field specifies the type of statement, viz. JOB - makes the beginning of the JOB, or EXEC follows JOB statement, and names the Program / Procedure to be executed, or DD - defines the file and requests the allocation of I/O devices. PROC begins a catalogued or in-streamed procedures, while PEND marks the end of in-stream procedure. JCLLIB/STEPLIB specifies the private libraries containing the catalogued procedures and JCL referred to by Include statements. SET assigns values to symbolic parameters in catalog procedures, INCLUDE allows JCL stored in partitioned dataset to be included in the job stream. IF/THEN/ELSE/END allows selective execution of Job steps. CNTL and ENDCNTL marks the start and end of control statements in the input stream. OUTPUT Supplies options for SYSOUT processing. /* //* // Indicates the end of data. Marks as comment line. Marks the end of Job.

Operand field supplies information to JCL in the form of parameters (positional and key-word). Positional parameters are characterized by their position in relation to other parameters. The Key-word parameters are independent of their position and characterized by key-word and '='. Key-word and positional parameters may have sub-parameters enclosed in parenthesis that may be positional or key-word parameters, following their corresponding rules. The various parameters are separated by Commas, The absence of positional parameters are indicated by coding a coma in it's place. Comma's need be provided, if all subsequent positional parameters are absent. The enclosing parameters can be omitted, if there is only one value. Nothing needs to be coded if all positional parameters are absent. Key word parameters can be coded in any order after any positional parameters. Comments field is optional. General rules in coding a JCL Start all statements in column 1 with appropriate // or /* or space. An entry in the name field must begin in column 3 and be followed by at least one space. There must not be any embedded blanks within fields, parameters must be separated by commas. Column 1 to 71 contains the JCL information. Use '-' for continuation. Comments may be written on comment line or by leaving a blank after all the operands.

JCL Statements
JOB Jobname, (ACCTNUM, ACCTNAME) (positional parms),'Name' (positional parm), CLASS= , PRTY= , MSGCLASS= , MSGLEVEL= , TYPRUN= , NOTIFY= , COND= , REGION=. CLASS and MSGCLASS can have one of the 36 values, A-Z and 0-9. CLASS identifies the nature of the job that is to be submitted. Some jobs can be short running, others can take a long time, and still others may utilize heavy resources. MSGCLASS specifies the output class to which system messages for your job are to be routed. TYPRUN can be SCAN or HOLD. If TYPRUN=SCAN is coded, it checks job for syntactical errors. If TYPRUN=HOLD is coded, holds the Job without running. This job can be run only after operator releases the Job. The PRTY parameter is related to the CLASS parameter. It assigns priority to jobs, which belong to same class. Smaller number indicates higher priority (allowed values are 0-15 for JES2 and 0-14 for JES3). When the job is initiated, the system will convert the job's priority into a dispatching priority so that job's task can complete with other tasks for use of main storage and CPU resources REGION parameter will be used to override the installation default Region size for executing your job. REGION=0M parameter again allocates maximum space that is available in the system to execute the job. Omitting REGION means no limit will be applied MSGLEVEL have two positional parameters (statements, messages), which indicates what job output is to be written as a part of output listing. Statements: 0 - Print only Job statements 1 - All input control statements, catalogued procedure statements and the internal representation of procedure statement parameters after symbolic parameters substitution are to be written 2 - Only input job control statements are to be written Messages: 0 - Only JCL messages print; if the job ABENDs, then JES messages too 1 - JCL and JES messages print. NOTIFY is used to notify the user about the completion of Job. EXEC The PGM parameter specifies the Program to be executed. ACCT parameter is used to specify the accounting number of the Step, if it is different from the Job accounting number. PARM is used to send values to the program, when it is executed. REGION specifies the amount of storage a Job step can use. The PRTY is used to specify priority to the step. COND specifies the condition for executing subsequent Job step. TIME sets a CPU time limit for a Job step. Ex. //step1 EXEC PGM=prog1,PARM='aa', REGION=64k

DD For Input stream datasets SYSIN is traditionally used as ddname. Use SYSOUT parameter to indicate the Output stream dataset. DDname – specifies the name of the DD statement. DSN= is used to specify the dataset name to OS, &&name is used to specify a temporary dataset. DISP=(status,norm,abnorm) is used to specify the Disposition of the DS, with the status at beginning and norm,abend after execution, valid options are NEW, OLD, SHR, MOD for status, keep,catalog,uncatalog,delete for normal & abnormal run's, In addition Pass is also used for normal run. UNIT specifies the I/O devices. VOL, SPACE and DCB are others.

Job Entry System (JES)
JES is used to accept jobs and run them on one of several computers connected together in a network. JES consists of statements placed before or after the JOB statement to direct Jobs to the computer in a network. Differences between JES2 & JES3 (i) In JES2 computers are connected in a network, and each computer is termed as a node. In JES3 several computers are connected closely together and all of the scheduling is done by a single computer that is called a global processor. In JES2 each computer in a network can select jobs from it's queue (decentralized system), while in JES3 the global processor schedules the jobs in queue to itself or to the other computers connected to it (centralized system). JES3 allocates datasets for all the steps before the job is scheduled. In JES2, allocation of datasets required by a step are done only just before the step executes. All the jobs are placed in single Job Queue in JES2 & JES3. They can also route the output to some destination. JES2 statements cannot be placed in a cataloged Procedure.

(ii)

(iii) (iv)

Cataloged Procedures
The JCL statements that have potential use by several users are often placed in a cataloged procedure, which can be invoked by a single exec statement. They are stored in a PDS (need to be specified by JCLLIB ORDER=(dsn,dsn,...) statement) or SYS1.PROCLIB system library. It begins with PROC statement and followed by JCL statements that constitute the procedure.

In-stream Procedure
In-stream procedure starts with a PROC statement and end with PEND statement. Instream procedure's can be included after the JOB statement but before the first EXEC statement. Up to 15 in-stream procedures are allowed in a JOB, with each in-stream procedure allowed to be executed several times.

Symbolic Parameters
Symbolic parameters are used to override parameters on the DD statement.

To run a procedure for various jobs, we may have the need to modify the DD statements every time in the procedure, for that we can use Symbolic parameters, which provides the means to modify procedures for execution. Symbolic parameters are preceded with ampersand (&) and may be 1 to 7 alphanumeric characters long, which must be coded in the operand field of JCL statements. Key words on EXEC statement such as COND, PARM, PGM cannot be coded as symbolic parameter names. Values can be assigned to EXEC or SET statement on the PROC statement for duration of the run. Assign values to Symbolic parameters Values can be assigned to symbolic parameters on PROC, EXEC and SET statements of a JCL. Values containing special characters other than blank , . ' * must be coded in apostrophes ''. Values assigned to symbolic parameters can be of any length but cant be continued on next line. Symbolic parameters can be concatenated with other symbolic parameters. Nullify the symbolic parameter value by coding the key word followed equal sign without a value, either on PROC or EXEC statement. Delimiter such as leading or trailing commas next to Symbolic parameters are not removed.

SET command
A SET statement is used to assign values to symbolic parameters. Any number of SET statements can be can be included in a JCL. SET can be placed in a catalog procedure to assign default values rather than to assign values on the PROC statement. SET can be placed in JOBSTREAM to assign default values rather than assign values on EXEC statement. A new SET statement can change the value of previous SET statement. A value of SET by PROC statement is changed, if a SET statement appears with in the procedure. SET statement can be placed anywhere following the Job statement. SET is conditional and is not affected by condition execution of the IF-THEN-ELSE-ENDIF. SET statement can replace setting symbolic parameter values on both EXEC and PROC statement, they also allow to create symbolic values in JCL and assign them without having to create a cataloged or in-stream procedures.

Nesting Procedure
In-stream procedures can be nested to a maximum of 15 levels (i.e. one proc invoking other and so on). We can not make backward reference between nested procedure. Up to only one over ridding statement is possible. All step-names should be unique So that we can override them correctly.

Include statement
It is used to copy in JCL stored as a member of a PDS using the JCLLIB statement to name the PDS and placing INCLUDE statements in the JCL, where we want the members to be copied. //INCLUDE MEMBER=member-name. PDS must be named with JCLLIB statement. PDS must be cataloged and have DCB attributes of LRECL=80 and RECFM=F or FB. It can be place anywhere after JOB statement. Placed in Cataloged and In-stream procedures. Include group can be nested up to 15 levels. Include can not Contain JOB, PROC/PEND, JCLLIB, DD *, JES2 & JES3 statements.

Passwords are ignored for SMS-managed data sets and catalogs. Abbreviation: GDG NAME(entry-name) Specifies the name of the GDG being defined. A generation data set (GDS) cannot be a VSAM data set. from 1 to 255.) Identifies the catalog in which the generation data group is to be defined. If the catalog is not SMS-managed and is password-protected. The syntax of this command is: DEFINE GENERATIONDATAGROUP ( NAME(entry-name) LIMIT(limit) {EMPTY|NOEMPTY} {OWNER(owner-id)} {SCRATCH|NOSCRATCH} {TO(date)|FOR(days)}) {CATALOG(cat-name{/password}) ) Parameters Required Parameters: DEFINE Define can be abbreviated: DEF GENERATIONDATAGROUP: Specifies that a generation data group (GDG) entry is to be defined. you must supply the update (or higher-level) password./password. password Specifies the catalog's password.and non-SMS-managed generation data sets. Abbreviation: LIM Optional Parameters: CATALOG(cat-name. A GDG can contain both SMS.Generation Data Group Generation Data Group is a group of datasets that are logically or chronologically related and referred by a name and relative generation number. Abbreviation: CAT . which identifies the generation of a dataset and is coded in parentheses after dataset name The DEFINE GENERATIONDATAGROUP command creates a catalog entry for a generation data group (GDG). Cat-name Specifies the name of the catalog. Relative number is an integer. it is dynamically allocated. If the catalog's volume is physically mounted. LIMIT(limit) Specifies the maximum number. of GDSs that can be associated with the GDG being defined.

TO(date) Specifies the date through which to keep the GDG being defined.AFSO) LIMIT (5) NOSCRATCH ) /* .RC1E. Abbreviation: EMP NOEMPTY Specifies that only the oldest generation data set is to be un-cataloged when the maximum is reached. when its entry is deleted from the catalog automatically. SCRATCH Specifies that the generation data set's DSCB is to be deleted from the volume's VTOC when the generation data set is un-cataloged. Note to TSO Users: If the owner is not identified with the OWNER parameter. and ddd is the three-digit (001 through 366) day of the year. as described under EMPTY|NOEMPTY.EMPTY|NOEMPTY Specifies what action is to be taken when the maximum number of GDSs for the GDG is exceeded and another GDS is to be cataloged. The disposition of the data set's DSCB in the volume's VTOC is determined with the SCRATCH|NOSCRATCH parameter. the TSO user-id is the default owner-id.REGION=512K //SYSPRINT DD SYSOUT=* //SYSIN DD * DEFINE GDG ( NAME (G1CLFAT. the GDS is un-cataloged from its GDG base and can be re-cataloged outside its GDG base as an SMS non-VSAM entry with the roll-off status. Abbreviation: NSCR TO(date)|FOR(days) Specifies the retention period for the GDG being defined. where yy is a two-digit year. SCRATCH|NOSCRATCH Specifies whether a generation data set's DSCB is to be deleted from the volume's VTOC when the data set is un-cataloged (that is. EMPTY Specifies that all the generation data sets are to be un-cataloged when the maximum is exceeded. If NOSCRATCH is specified for an SMS. The maximum number that can be specified is 9999. or explicitly as a result of a user entered DELETE request). Example: //IDCAMS EXEC PGM=IDCAMS. The date appears in the form yyddd.managed GDS. FOR(days) Specifies the number of days to keep the GDG being defined. Abbreviation: NEMP OWNER(owner-id) Identifies the generation data set's owner. Each data set's non-VSAM entry is automatically deleted from the catalog. Abbreviation: SCR NOSCRATCH Specifies that the generation data set's DSCB is not to be removed from the volume's VTOC when the generation data set is un-cataloged.

Independent Utility Programs Independent utility programs can be used to prepare devices for system use when the operating system is not available. They can be executed as jobs or be invoked as subroutines of a calling program. Control System and data set utility programs are controlled by job control and utility control statements. These programs must reside in an authorized library. The independent utility program is controlled by utility control statements only. it does a routine job which is required repeatedly in an installation. They can be executed as jobs or be invoked as subroutines of an authorized program. MVS/DFP provides utility programs to assist users in organizing and maintaining data. • Each utility program falls into one of the three classes.What is a Utility? • A UTILITY program performs a basic function. DFSORT You can use DFSORT to • Sort records in ascending or descending order within a file • Merge two or more files into a single file It is also used to perform the following functions: • To select a subset of records from an input file • To SUM values in records • To reformat records . the data set utilities. change or compare data at the data set or record level. Data Set Utility Programs Data set utility programs can be used to reorganize. System Utility Programs System utility programs can be used to maintain and manipulate system and user data sets. i. They cannot be invoked by a calling program.. A statement that exceeds 71 characters must be continued on one or more additional lines.e. The three classes are: the system utilities. Format of Utility Control Statements Utility control statements must be contained in columns 2 through 71. based on the function performed and the type of control of the utility. and the independent utilities.

one dataset is sufficient //SORTOUT DD Defines the OUTPUT dataset //SYSIN DD Contains DFSORT program control statements Consider a book store file with the following record layout : SL.NO FIELD START END 1 BOOK TITLE 1 75 2 AUTHOR'S LAST NAME 76 90 3 AUTHOR'S FIRST NAME 91 105 4 PUBLISHER 106 109 5 COURSE DEPARTMENT 110 114 6 COURSE NUMBER 115 119 7 COURSE NAME 120 144 8 INSTRUCTOR'S LAST NAME 145 159 9 INSTRUCTOR'S INITIAL 160 161 10 NUMBER IN STOCK 162 165 11 NUMBER SOLD YTD 166 169 12 PRICE 170 173 CH . If it is in a system library.Job Control Statements //JOB CARD //STEPNAME EXEC PGM=SORT //STEPLIB DD Defines the library containing the DFSORT program.CHARACTER BI . this statement may be omitted //SYSOUT DD Defines the message data set //SORTIN DD Defines the INPUT dataset //SORTWKnn DD Defines a WORK storage dataset In most cases.BINARY DATA CH CH CH CH CH CH CH CH CH BI BI BI How to write a SORT statement? Write the SORT statement between columns 2 and 71 Leave atleast one blank and write SORT FIELD= Write in parentheses. separated by commas The starting position of the key field Length of the key field in bytes A code for data format Letter 'A' for Ascending order or 'D' for Descending order .

.BLKSIZE=1730) //SYSIN DD * SORT FIELDS=(110.LOADLIB //JOB CARD //STEP01 EXEC PGM = SORT //STEPLIB DD DSN=IBM....CH.. it can be specified just once by using 'FORMAT=' parameter...LOADLIB..UTIL..A..RLSE)...1.INPUT.CH. Assume that the program DFSORT is available in a partitioned dataset IBM....5.SPACE=(TRK.1..A) This is ..UTIL.1)) //SORTOUT DD DSN=BOOK. SORT FIELDS=(110. // DCB=(RECFM=FB..CH.CH.CH.STORE.A) Example 2 Now let us consider sorting by multiple fields like COURSE DEPARTMENT. When all the control fields are of the same data format.VOL=SER=TRG001.115.5.A)... The SORT control statements would then look like SORT FIELDS=(110.A.. DATA FORMAT EBCDIC CHARACTER ASCII CHARACTER BINARY ZONED DECIMAL PACKED DECIMAL Example 1 Let us see how we can write a SORT statement to sort these book store records by the DEPARTMENT field 1 2.A.10.The following are the data format codes that can be specified.1). // UNIT=DISK.5.DELETE)..71 SORT FIELDS=(110.75...FORMAT=CH Example 3 SORT JCL .A) NOTE: The first two key fields being contiguous have been concatenated...LRECL=173.A.......10..DISP=OLD //SORTWK01 DD UNIT=3380.CATLG..(10.(1..10.CH.....75.. COURSE NUMBER and BOOK TITLE.Sort the book store file records in ASCENDING order of COURSE DEPARTMENT and COURSE NUMBER and DESCENDING order of NUMBER IN STOCK.DISP=SHR //SYSOUT DD SYSOUT=* //SORTIN DD DSN=BOOK.75.A..1.4.CH. // DISP=(NEW.OUT..STORE..162.BI..D) /* CODE CH AC BI ZD PD ..EQUIVALENT to SORT FIELDS=(110. // SPACE=(CYL.

A) ---------------------------------------------------Example: OMIT statement Suppose only those books for which NUMBER SOLD YTD exceeds 125 and the LAST NAME of the author is MARTIN are to appear in the descending order of Price The corresponding DFSORT control statements are -----------------------------------------------------OMIT COND=(166.C'MARTIN') SORT FIELDS=(170.15.4.LE.4.BI. and data format of the field compared against OR a constant List of Comparison operators EQ NE GT GE LT LE EQUAL TO NOT EQUAL TO GREATER THAN GREATER THAN OR EQUAL TO LESS THAN LESS THAN OR EQUAL TO Example: INCLUDE statement Suppose in the Book store file we want only the books (in ascending order of book title) for which the number of copies sold YTD exceeds 250.CH. the shorter field is padded as appropriate (with blanks or zeros) In a field-to-constant comparison. length. Note: The decimal constants are padded or truncated on the left Character and Hexadecimal constants are padded or truncated on the right • • How To Write An INCLUDE/OMIT Statement? • • • Leave at least one blank and write INCLUDE Leave at least one blank and write COND= Write in parentheses.BI.D) ------------------------------------------------------ .76.250) SORT FIELDS=(1.CH.Tailoring the Input file.GT. The DFSORT Control statements are ---------------------------------------------------INCLUDE COND=(166.125.75.OR.4. and data format of the field to be compared comparison operator the location.NE. length.BI. • Input file can be tailored by either Specifying an INCLUDE control statement for the records to be included OR Specifying an OMIT control statement for the records to be omitted Both INCLUDE and OMIT cannot be used together Inclusion and Omission can be done by comparing the contents of a record field with either another field OR a Constant (Character string / Decimal Number / Hexa decimal string) • Two or more conditions can be combined by logical ‘AND’ and ‘OR’ Rules for Padding / Truncation during field comparisons In a field-to-field comparison. the constant is padded or truncated to the length of the field. and separated by commas: The location.

How to write the OUTREC statement ? • • • Leave at least one blank and write OUTREC Leave at least one blank and write FIELDS= Write in parentheses and separated by commas: The input location and length of the fields to appear. The output record becomes 79 bytes long. The SORTOUT DD Statement becomes //SORTOUT // // // // DD DSN=BOOK.DELETE).A) OUTREC FIELDS=(1.4) and the LRECL on the SORTOUT DD statement should be 103 . DCB=(RECFM=FB.OUTREC FIELDS=(20X. are to appear in ASCENDING order of BOOK TITLE.75.75.LRECL=79.(5.4) and the LRECL on the SORTOUT DD statement should be 83 Example 3 Suppose a 20 character blank field is to be prefixed to the output records. • Fields can be deleted • Order of the fields can be rearranged • Zeroes or blanks can be inserted BEFORE. DISP=(NEW CATLG. the new record length has to be specified on the SORTOUT DD statement.CH.75. the following control statement has to be given – OUTREC FIELDS=(1.162. UNIT=DISK.4Z. BETWEEN or AFTER fields If record length gets changed in the process of using OUTREC statement.2. SPACE=(TRK. NUMBER IN STOCK.VOL=SER=TRG001.BLKSIZE=790).OUTPUT. the following control statement has to be given .4Z.4) /* Example 2 If it is required to add a 4-byte Binary field between BOOK TITLE and NUMBER IN STOCK and fill it up with ZEROES.Reformatting Reformatting records with OUTREC After records are sorted they can be reformatted by using OUTREC control statement.).1. in the desired order (data format is not specified) Reformatting the Output Record-Examples Example 1 Suppose only the BOOK TITLE.RLSE) and the DFSORT control statements are //SYSIN DD * SORT FIELDS=(1.75.162.162.

10.75.DISP=OLD //SORTIN02 DD DSN=BOOK.STORE.CATLG.D) /* Processing Order Of Control Statements INCLUDE/OMIT | V INREC | V SORT/MERGE | V . the new location has to be specified in the SORT statement.INPUT3.BI. MERGE replaces SORT Example: Merge 3 files that have been sorted in ASCENDING order of COURSE DEPARTMENT and COURSE NUMBER and DESCENDING order of NUMBER IN STOCK.4. one SORTINnn DD statement for each input file nn --> 01 to 16 In Utility Control Statements.166.STORE.STORE.DISP=OLD //SORTOUT DD DSN=BOOK.BI. Note: If reformatting using INREC changes the location of key fields. // SPACE=(CYL.DELETE). // DISP=(NEW.BLKSIZE=1730) //SYSIN DD * MERGE FIELDS=(110.UTIL.4.LOADLIB.A. // DCB=(RECFM=FB.Reformatting records with INREC The INREC control statement allows to reformat the input records before they are processed.INPUT2.STORE.162.D) /* MERGE FILES • • • • Files to be merged should be sorted on the same set of keys on which they are being merged Do not use SORTWKnn DD statement Instead of SORTIN DD.LRECL=173.RLSE). Reformatting is performed before SORT/MERGE.DISP=SHR //SYSOUT DD SYSOUT=* //SORTIN01 DD DSN=BOOK.CH.VOL=SER=TRG001. //JOB CARD //STEP01 EXEC PGM = SORT //STEPLIB DD DSN=IBM. use SORTINnn DD. Example If only the BOOK TITLE and NUMBER SOLD YTD are to appear in descending order of NUMBER SOLD YTD the following control statement has to be given //SYSIN DD * INREC FIELDS=(1.4) SORT FIELDS=(76.OUT.DISP=OLD //SORTIN03 DD DSN=BOOK. // UNIT=DISK.INPUT1.1).(10.

OUTREC .

// DISP=(NEW. // UNIT=TAPE.. and editing information contained in the control data set.Indicates the number of member names and alias names. from a sequential input data set • Expand an existing partitioned data set by creating partitioned members and merging them into the existing data set • Produce an edited sequential of partitioned data set • Reblock or change the logical record length of a data set Job Control Statements The following are the job control statements for IEBGENER.MASTER..MASTER.EMP.DISK. // LABEL=(.EMP.VOL=SER=PRJ3010. record identifiers.(10.BLKSIZE=5000) //SYSPRINT DD SYSOUT=A //SYSIN DD DUMMY Utility Control Statements GENERATE .IEBGENER You can use IEBGENER to: • Create a backup of a sequential data set or a member of a partitioned data set • Produce a PDS data set or a member of a partitioned data set. // VOL=SER=007311.MST. // UNIT=DISK.10).RLSE) // DCB=(RECFM=FB. // SPACE=(TRK.LRECL=500.CATLG).EMPMST.DISP=OLD. //JOB CARD //STEP01 EXEC PGM=IEBGENER //SYSPRINT DD Defines a sequential data set for messages (System output device / Tape volume / DASD volume) //SYSUT1 DD Defines the INPUT data set (Sequential data set / Member of a PDS) //SYSUT2 DD Defines the OUTPUT data set (Sequential data set / PDS / Member of a PDS) //SYSIN DD Defines the CONTROL data set (Very often DUMMY) Example 1 To copy a Tape file PROJ.DISK (VOL SER of Tape is 007311 Employee master record is 500 bytes in length) //JOB CARD. literals. (LABEL) GENERATE (MAXNAME=N) (MAXFLDS=N) (MAXGPS=N) (MAXLITS=N) .SL) //SYSUT2 DD DSN=PROJ. //STEP1 EXEC PGM=IEBGENER //SYSUT1 DD DSN=PROJ. to a Disk file PROJ.EMP.

LABELS=N| IDENT . Default (NO conversion). that is no less than the total number of member names and aliases appearing in subsequent MEMBER statements. MAXLITS=N Specifies a number..FIELD=. from 1 to 2730.Exact literal that identifies the last input record of a record group. Default is 80 bytes.Specifies the starting location of this field in the output records. LABELS . from 1 to 4095..|{input-location|'literal'}|. a length of 40 or less must be specified. . |label| MEMBER NAME=(name|.|output-location|)||. literal .(alias)(. RECORD . cannot exceed 8 bytes. from 1 to 3276. conversion .'name'.FIELD=(|length|.Specifies the member name and alias of a member of a partitioned data set to be created. length . that is no less than the total number of characters contained in the FIELD literal of subsequent RECORD statements. name . that is no less than the total number of IDENT parameters appearing in subsequent RECORD statements. MAXFLDS=N Specifies a number.input-location)| |. input-location . FIELD .|) NAME=(name.Length in bytes of the identifying names.MAXNAME=N Specifies a number.)) Specifies a member name followed by a list of its aliases..Identifies the last record of a collection of records in the input data set.Specifies the starting byte of the field to be processed.Starting byte of the field that contains the identifying name in the input records. |conversion|...PZ for packed decimal to unpacked decimal. length .Specifies field-processing and editing information. MAXGPS=N Specifies a number.alias||. Default is 1.| |.. from 1 to 32767. If a literal is to be processed..Specifies a literal to be placed in the specified output location.Defines a record group to be processed and supplies editing information. ZP for unpacked to packed decimal conversion. MEMBER .Length in bytes of the input field or literal to be processed. that is no less than the total number of FIELD parameters appearing in subsequent RECORD statements.. |label| RECORD |IDENT=(length. Default is 1. output-location .Indicates the number of records in the SYSIN data set to be treated as user labels. input-location .

1) MEMBER NAME=MEMBER3 /* NOTE: The first record statement identifies the last record to be placed in the first member Example 3: EDITING //SYSIN DD * GENERATE MAXFLDS=3.'**********'.11.5.MAXGPS=2 MEMBER NAME=MEMBER1 GROUP1 RECORD IDENT=(8.16) C COL-72 /* ..'FIRSTMEM'.DELETE). // DISP=(NEW CATLG.Example 2 Create a partitioned dataset (consisting of three members.'SECNDMEM'. // DCB=(RECFM=FB. FIELD=(5. // SPACE=(TRK..BLKSIZE=800) //SYSIN DD * GENERATE MAXNAME=3.(10.'='.DISP=OLD //SYSUT2 DD DSN=NEWSET.1). their names being MEMBER1 MEMBER2.1. // VOL=SER=TRG001.LRECL=80. //JOB CARD //STEP01 EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=A //SYSUT1 DD DSN=INSET.).1) MEMBER NAME=MEMBER2 GROUP2 RECORD IDEN (8.UNIT=DISK.. C COL-72 FIELD=(1. MEMBER3) from sequential input.MAXLITS=11 RECORD FIELD=(10.5)).

(100.100).EMP..MASTER. // UNIT=DISK.IEFBR14 You can use IEFBR14 to Allocate and Catalog a data set Delete a data set Allocating and Cataloging a Data set //JOB CARD .. // SPACE=(5000.CATLG.EMP.EMP. //STEP01 EXEC PGM=IEFBR14 //FILE1 DD DSN=PROJ.UNIT=DISK // VOL=SER=TRG001 .RLSE).DELETE). // DCB=(RECFM=FB.UNCATLG) //FILE2 DD DSN=PROJ.VOL=SER=TRG001.MASTER // DISP=(OLD..MASTER..LRECL=500) Deleting a Data set //JOB CARD .DELETE). // DISP=(OLD. //STEP01 EXEC PGM=IEFBR14 //FILE1 DD DSN=PROJ. // DISP=(NEW.

//SYSUT4 DD Defines a spill data set on a direct access device.It is used when there is no space in virtual storage for some or all of the current directory entries of the input PDS. UNLOADED or LOADED Replace identically named members in data sets Replace selected data set members Rename selected members Exclude members from a data set to be COPIED. LOADED or UNLOADED Job Control Statements: The following are the job control statements for IEBCOPY.IEBCOPY You can use IEBCOPY to • • • • • • • • • • • • • • Create a backup of a partitioned data set Copy one or more data sets per COPY operation Copy a partitioned data set to a sequential data set (UNLOAD) Copy one or more data sets created by UNLOAD operation on any direct access device (LOAD) Compress partitioned data sets in place Merge data sets (Except when UNLOADING) Recreate a data set that has exhausted its PRIMARY. //SYSIN DD Defines the CONTROL data set . //JOB CARD //STEP01 EXEC PGM=IEBCOPY //SYSPRINT DD Defines a sequential data set for messages //SYSUT1 or anyname1 DD Defines an INPUT partitioned data set //SYSUT2 or anyname2 DD Defines an OUTPUT partitioned data set //SYSUT3 DD Defines a spill data set on a direct access device. It is used when there is no space in virtual storage for some or all of the current directory entries of the output PDS. SECONDARY or DIRECTORY space allocation Alter load modules in place Copy and Reblock load modules Select members from a data set to be COPIED.

(1)) //SYSUT4 DD UNIT=SYSDA.R).R)) Example 3 To copy members C. INDD=INOUT3 /* Example 2 To copy all members of INOUT6 (partitioned data set) to INOUT2 replacing identically named members.. the control statements are as follows //SYSIN DD * COPYOPER COPY OUTDD=INOUT4 INDD=INOUT6.SPACE=(TRK. A and G from INOUT6 and INOUT2 to INOUT4.Example 1 To copy members from three partitioned data sets (DATASET1. //SYSIN COPYOPER /* DD * COPY OUTDD=INOUT2 INDD=((INOUT6.E.DISP=OLD //SYSUT3 DD UNIT=SYSDA. //JOB CARD //STEP01 EXEC PGM=IEBCOPY //SYSPRINT DD SYSOUT=A //INOUT1 DD DSN=DATASET1.A.INOUT2 SELECT MEMBER=(C.DISP=OLD //INOUT3 DD DSN=DATASET3.(E.. INDD=INOUT1.D.DISP=OLD //INOUT4 DD DSN=DATASET4.SPACE=(TRK. DATASET3) to an existing partitioned data set (DATASET4). //SYSIN DD * COPYOPER COPY OUTDD=INOUT4 INDD=INOUT6 INDD=INOUT2 SELECT MEMBER=(C.DISP=OLD //INOUT2 DD DSN=DATASET2. DATASET2. if members E and G can replace identically named member of INOUT4.A.D. INDD=INOUT2. (INOUT6. D.(G.R)) /* . INOUT2 and INOUT4 are partitioned data sets).G) /* Example 4 In EXAMPLE 3. E.(1)) //SYSIN DD * COPYOPER COPY OUTDD=INOUT4.

T.R).J).K) (E.C AND D have to be excluded //SYSIN DD * COPYOPER COPY OUTDD=INOUT2. I=(DATASET2.INOUT2 SELECT MEMBER=((C.A. INDD=DATASET1 /* Example 8 Multiple COPY operations to copy members A and B from DATASET1 and all members of DATASET2 except C and G to DATASET3.B.(D.D) /* Example 7 To compress a partitioned data set.C. G Replaces identically named member of output PDS.. All members copied from DATASET2 are permitted to replace identically named members of DATASET3 //SYSIN DD * COPYOPER COPY OUTDD=DATASET3.G) /* .B. //SYSIN DD * COPYOPER COPY OUTDD=INOUT4 INDD=INOUT6. INDD=DATASET1 SELECT MEMBER=(A.R) EXCLUDE MEMBER=(C.(G.INDD=INOUT1 EXCLUDE MEMBER = (A.Example 5 Suppose in EXAMPLE 4 the members C and D are renamed J and K respectively. E is renamed T and replaces identically named member of output PDS.B) COPY O=DATASET3. assign the same data set name to INDD and OUTDD //SYSIN DD * COPYOPER COPY OUTDD=DATASET1.R)) /* Example 6 Suppose in a copy operation from INOUT1 to INOUT2. members A.

Alternate entry points. Diagnostic output. The other functions of the linkage editor are: • Editing load modules by replacing. An object module may. • need not be an external symbol. separately relocatable unit of code. deleting. Entry point: The point within a program from which execution begins. Additional user-specified input.. Alias: A name which may be used in place of the member name of the load module for execution. Forms the input to a language translator. the main entry point to the load module is used. mainly. containing only object modules. and ordering control sections as directed by control statements. Object module: The output from a language translator. Load module: The output from the linkage editor. There could be more than one entry point to a program . however. External Symbol Dictionary (ESD): Contains one entry for each external reference within a module. manageable units of work (modules). in which case. Control Section: The smallest. two types of inputs: Primary Input. rearranging. Uses of Linkage Editor The primary function of the linkage editor is to combine object modules and load modules in accordance with the requirements stated in control statements into a single output load module. • Creating overlay programs in a structure defined by control statements. Every load module must have a main entry point.IEWL Fundamentals Modular programming: Aims to split a problem into small. Source module: Program written in a symbolic language. and linkage editor control statements. • Aligning control sections and named common areas on 4K-byte page boundaries as directed by control statements. An alias: • could be an alternate entry point. be directly executed via the Loader. it is in a readily executable format. Linkage Editor Processing Inputs: The Linkage editor accepts. or load modules. . Forms the input to the linkage editor. Outputs: • • A load module. External References: Symbolic references within a module to control sections in other modules. which may contain either object modules and control statements.

. this DD statement describes the library which contains the input datasets. and each alternate entry point into the main load module. a PS dataset assigned to a DASD. DCBS options. HEWLH096 may also be used instead) Linkedit options . module map options (MAP).g. The DCB parameters are provided by the linkage editor. LRECL=80 SYSLMOD DD statement Describes the output module library. cross reference table (XREF). Space allocation options. Deciding where the load module is to reside (RMODE).IEWL (HEWL. Region-size requirements.) JCL to run a Linkage editor job EXEC statement The following details are specified in a linkage editor EXEC statement: The program name . all True aliases. E.. Size. Tracing processing history. which specify the kind of output the linkage editor is to produce.Include four types of parameters: Module attributes. DD Statements The following DD statements are relevant to a Link-edit job: SYSLIB DD statement When the automatic library-call mechanism is used. E. FB. It is the application programmer's responsibility to ensure that the code can work under these conditions. Output options. E. Assigning attributes to load modules.g. Assigning an addressing mode (AMODE) to the main entry point. (Note: The Linkage editor merely assigns AMODE/RMODE as specified. The datasets concatenated to this DD must be partitioned. Options like Let and Exclusive call (XCAL). Refreshable. DCB requirement: RECFM = F. which describe the characteristics of the output load module.. which affect linkage editor processing. DCB requirement: RECFM = U SYSUT1 DD statement Describes the intermediate dataset. Special processing requirements. E.• • • • • • • Creating multiple copies of a load module. and Test.g. Attributes like Reusability. .g. which should be a PDS. LINKEDIT. which affect the amount of storage used by the linkage editor for processing and output module library buffers. Providing special processing and diagnostic output options.

DISP=(OLD.LOAD.REGION=512K //SYSLIB DD DSN=SYS2.LOAD. LRECL=121 Sample Link edit jobsteps 1 Example on multiple load module processing //LKED EXEC PGM=IEWL.DELETE) // DD * ENTRY CDCHECK NAME ROUT1 /* Here.DISP=SHR //LIB1 DD DSN=TRG1T.MEM2. // PARM='AMODE=31. It describes a dataset that is used only for numbered error and warning messages.SYSLIN DD statement It is the linkage editor SYSIN card. The linkage editor control statements are specified as a part of the SYSLIN DD statement.TEST.DISP=SHR // DD DSN=SYS1.COB2LIB.MEM3) NAME LOAD2 /* 2 Example on defining entry point //SYSLIN DD DSN=&&OBJECT.RMODE=ANY.TEST.DISP=SHR //LIB2 DD DSN=TRG1T.50)).TEST. DCB requirement: RECFM = F.DELETE) // DD DDNAME=SYSIN //SYSIN DD * NAME LOAD1(R) INCLUDE LIB1(MEM1. Any references to ROUT1 will cause execution to begin at CDCHECK.DISP=(OLD.UNIT=VIO //SYSPRINT DD SYSOUT=* //SYSLIN DD DSN=&&LOADSET. DCB requirement: RECFM = FBA. // XREF. It describes the primary input dataset that can be assigned to DASD.TEST. a magnetic tape unit.MAP'. or the card reader. LRECL=121 SYSTERM DD statement This DD is optional.DSN2. which is a PS assigned to an intermediate storage device.DSN1.LET.LIST.(50. LRECL=80 SYSPRINT DD statement It describes the diagnostic output dataset.DISP=SHR //SYSLMOD DD DSN=TRG1T. . The member name of the load module is ROUT1. It may be a PS or a PDS with the member name.DISP=SHR //SYSUT1 DD SPACE=(1024. CDCHECK is the main entry point.PROJ. DCB requirement: RECFM = FBA. FB.

CODE2.PARTZ(P) INCLUDE SYSLMOD(LOAD) /* The control sections in the load module. named MAINLOAD is created.PART3 ORDER PART4. The member name of the load module is.UNIT=DISK //SYSLIN DD * ORDER ROOT(P). So.DELETE) // DD * MODE AMODE(31). 4 Usage of the ORDER control statement //SYSLMOD DD DSN=TRG1T.3 Example on defining aliases //SYSLMOD DD DSN=TRG1T.MAIN. PART2 and PARTZ are aligned on 4K page boundaries.RMODE(ANY) ALIAS TESTLOAD NAME MAINLOAD /* Here.MYDSN. the addressing mode for the main entry point.PART1 ORDER PART2(P). is 31. if one is present.DELETE) // DD * ALIAS CODE1.MYDSN. 5 Specifying AMODE and RMODE 6 The MODE statement may be placed before. .PART4. It should precede the NAME statement for the module. however.DISP=OLD. In addition. MAINLOAD and its alias.DISP=(OLD. //SYSLMOD DD DSN=TRG1T. LOAD are arranged by the linkage editor according to the sequence specified by the ORDER statement.DISP=OLD. there is a requirement to refer to the load module by the names ROUT1 and ROUTONE. CODE1 and CODE2. between. the output load module. ROUTONE has been defined as an alias. or after object modules or other control statements. the residence mode for the load module is ANY. given an alias of TESTLOAD.UNIT=DISK //SYSLIN DD DSN=&&OBJECT.DISP=OLD. ROUT1.DISP=(OLD.UNIT=DISK //SYSLIN DD DSN=&&OBJECT.ROUTONE NAME ROUT1 /* The output module is assigned two additional entry points.MYDSN. ROOT. TESTLOAD.

JOB . i. be that step a program or a proc.indicates start of jobstream to the operating system and through parms coded on it. 3. Identifier field Name field Operation field Operand field Comments What are the basic JCL Statements for a JOB? a. 2. DD . d. which is used to describe the attributes of a data set (name.is a data definition. message level. 4. e. disposition). 5.indicates the start of execution of a particular job step. What are the components of JCL statements? 1.Question and Answers 1. EXEC . certain details about the job (time. unit. 4. 3. What are three major types of JCL statements? What are their functions? JOB. DD: Identifies a data set to be allocated for the job step Delimiter (/*): Marks the end of an in-stream dataset Null(//): Marks the end of a job Comments(//*): Provides Comments PROC: Marks the beginning of a procedure PEND: Marks the end of a procedure OUTPUT: Supplies options for SYSOUT processing. c. space. EXEC and DD. . When two related programs are combined together on control statements is called Job Control Language 2. region. What are the three basic types of statements in a jobstream? JOB (one per job stream) EXEC (one or more per job) DD (one or more per job step) 5. What is JCL? JCL is Job Control Language and is used for Batch processing. h. type. JOB: Identifies a job and supplies accounting info EXEC: Identifies a job step by indicating the name of the program to be executed. job accounting data). b. g. JCL is interface between operating system (MVS) & application program (languages in mainframe). f.

.DELETE) not coded .DELETE) 9. If the "DISP=" keyword is not coded for a new dataset. what default values will be used for "DISP="? If the "DISP=" keyword is not coded .6. you can add records at the end of an existing dataset. What is MOD. If the "DISP=" keyword is not coded for an existing dataset. 13. if the step terminates normally. what default values will be used for "DISP="? If the "DISP=" keyword is DISP=(NEW.DELETE) mean ? The MOD will cause the dataset to be created (if it does not exist). 14. What is a DD statement? Data Definition 7.CATLG. UNIT . 15.DELETE) mean? That this is a new dataset and needs to be allocated. VOL=SER=xxxx. This disposition is used to clear out a dataset at the beginning of a job. Thus if the step abends. DISP=SHR permits old data sets to be shared.PASS. What does a DISP=(NEW. delete it. What is DISP=(NEW.DELETE).then the DEFAULT Values are : DISP=(NEW. and then the two DELETE 's will cause the dataset to be deleted whether the step abends or not. What does a DISP=(MOD. SHR and PASS? DISP=MOD is used when the dataset can be extended. will have the following parameters: DISP=(NEW. the dataset would not be catalogued and we would need to supply the vol.KEEP) mean? That this is a new dataset and needs to be allocated. DISP=PASS passes the data set on to subsequent job steps. SPACE & DCB 8. How do you access a file that had a disposition of KEEP? Need to supply volume serial no.CATLG. What does a DISP=(NEW. pass it to the subsequent steps and if step abends.DELETE)? This is a new file and create it. and each step can use the data set once.then the DEFAULT Values are 10.DELETE. to CATLG the dataset if the step is successful and to delete the dataset if the step abends.CATLG.DELETE.DELETE. 12. This dataset will not exist beyond the JCL. ie. 11. ser the next time we refer to it. What is the DD statement for a output file? Unless allocated earlier. to CATLG the dataset if the step is successful and to KEEP but not CATLG the dataset if the step abends.

terminated abnormally. 18. What are the parameters that have to be coded on a DD statement in order to retrieve a cataloged data set? The minimum parameters needed are DSN and DISP 19. If specify COND=(0.. the step is bypassed 22. consists of 2 sub-parameters. COND means condition parameter. //step1 //step2 EXEC EXEC PGM=abcd PGM=xyz.GE) in step then step never execute. else it is bypassed.PROCLIB. depending on the condition code that is returned for a prior step. Upto 15 levels are allowed. It is compared with system return code of previous step. How do pass temp dataset from one step to another step? By specifying the DISP as PASS for the temp dataset 17. 20. COND=(4.LE) or COND=(4095. What is a COND parameter in JCL? The COND parameter is used to control the execution of subsequent job steps. SHR allows multiple jobs to concurrently access the dataset Note: When updating a dataset. terminated abnormally. then what happens? If condition specified in the COND parameter is true. COND=ONLY Means execute this step only if any of the previous steps.LT) Step2 will be executed when system return code of step1 is less than 4. the system changes MOD to NEW unless the VOL parameter request specific volume. COND parameter defined on the JOB statement will determine whether Job should be terminated at a certain point or continued 23. What is the difference between specifying DISP=OLD and DISP=SHR for a dataset? OLD specifies exclusive use of a dataset. What happens in case of DISP=MOD if data set specified doesn't exist? If the data set doesn't exist.16.return code from the previous step 2nd . Only if cataloged in SYS1.condition. . COND=EVEN Means execute this step even if any of the previous steps. Can you execute a PROC from another PROC? Yes. 21. If condition specified in the COND parameter is true. What is the difference between the COND parameter specified on the EXEC statement and the one specified on the JOB statement? COND specified on EXEC statement determines whether step should be bypassed or executed. you would normally use OLD. 1st .

What will happen if you attempt to restart a job in the middle of a JCL // IF. WHAT IS A FILE? A File is a collective group of records. It is used to restart the job at a specified step rather than at the beginning.. The value mentioned here should be declared in linkage section in the program and process thru procedure division. 33. Definitions of VSAM files. You use control card because you cannot use a instream procedure in a procedure. Generally you will be calling a Proc from your JCL and you cannot code instream procedure in the Proc and so you will point to the dataset. // ENDIF? Job will fall through to the ENDIF (not executing any steps).. then resume execution with the first step AFTER the // ENDIF. How can you trap abends in the JCL? Use IF ABEND statement in the JCL. which is called control card. 30. ... How do you skip a particular step in a PROC/JOB? Can use either condition codes or use the jcl control statement IF (only in ESA JCL) 26. How do you restart a step in JCL? Use RESTART=step name. The number of records on a file depends entirely on the application associated with the file. What are three parameters you can specify on JOB as well as on EXEC statement? TIME. Files may contain a few or more records. 25.24..etc. 28. 32. REGION and COND parameters 29. 27. How do you pass parameters to the program as the job is being executed? By using 'PARM' parameter in exec statement. How many positional Parameters are there in JOB statement? There are two positional parameters in JOB statements. This technique is very useful when you do not know the parameters at the time of coding the programs. What is RESTART? How is it invoked? RESTART is a JOB statement keyword.. 31. Why do you use a control card? A control card can be a member of a PDS or a sequential dataset and is used for storing the date fields.

. 35. Try to do some arithmetic operations on the low values. How do you submit a JCL under CICS environment ? Pass all the JCL codes to a COBOL variable (should be declare using OCCURS clause) and the write the line one by one to the spool using CICS commands like SPOOL Close.34. You are trying to move the low values or spaces into the numeric field ii. What is meant by SOC7 ABEND codes? S0C7 . And your COBOL(PROG1) should look like this SELECT JCL-FILE ASSIGN TO ddname.. Write a JCL to execute a JOB by 7 A. In your JCL define as //JOBA JOB //STEP01 EXEC //ddname DD 1111.B. SPOOL Open and SPOOL Write . How to pass the temporary dataset form one JOB step to another? By specifying the DISP as PASS for the temp dataset 38. TO TO JCL-REC. 37. System Library: Such as STS1.012086) 39.LINKLIB Private Library: Specifies in a JOBLIB or STEPLIB DD statements Temporary Libraries: Created in a previous step of the JOB .Data exception error You will get this Abend in following situation: i. JCL-REC. For more help refer CECI of CICS or CICS manual 36. Example: MOVE '//TESTJOB JOB 1111. To avoid this you have to always initialize the numeric fields otherwise they will contain the low values. Then TESTJOB will be submitted. How many types of libraries are there in JCL? Libraries are of 3 types. Open this file and Write the JCL statements into this file..VISVEISH' MOVE '//STEP01 EXEC PGM=IEFBR14' And close this file.M on JAN 20.JOB1 PGM=PROG1 SYSOUT=(*. Compare the numeric fields with low values iii. How do you submit JCL via a COBOL program? For the above question the solution is as follows..INTRDR).1986? THE code is : //*MAIN DEADLINE=(0700.

What does the statements: TYPRUN=SCAN and TYPRUN=HOLD do in a JCL statement? TYPRUN=SCAN checks the JCL for errors TYPRUN=HOLD holds the job until further notice.. 50. What is the max block size for a Tape file? It is 32. 44.e.m. What is QSAM error usually when it is occurs? Usually it is occurs at the time of job submission.p) for a PDS where n.760. Secondary allocation is done when more space is required than what has already been allocated. The p designates how many directory blocks to allocate for a PDS. when we code BLOCKSIZE. On n the DD statement. Which is the most widely used batch performance monitor for DB2? DB2PM 45. m. and p are numbers. and each block is 256 bytes in length and can hold up to 5 members. i. What is the purpose of INCLUDE statement in a JCL? It is used as an alternative for STEPLIB. What you mean by skeleton JCL? JCL which changes during run time ie. 42. The directory consists of blocks. The system replaces the include statement with the statements in the INCLUDE group.. What is the difference between primary and secondary allocation for a dataset? Primary allocation is The space allocated when the dataset is first created. 41. DD name will change. equivalent to dynamic SQL. 48. SPACE=(n. When we specify the dataset name in include. same JCL can be used for various job. What do you mean by INCLUDE statement in JCL? An INCLUDE statement identifies a members of a PDS or PDSE that contains the set of JCL statements is called an INCLUDE group.TRK & CYL? One block constitutes 32KB of formatted memory/ 42KB of unformatted memory 6 blocks makes one Track and 15 Tracks makes one cylinder .Based on that we can calculate efficient number of Records in a Block 43.. What is PDS? PDS is a library type of data set organization consisting of Directory and Members. what is the main difference between creating a new sequential flat file and PDS? SPACE=(n. Each member of the PDS is a sequential data set. the values for the JCL such as PGM name.m) for a sequential file. it will search in all the datasets specified in the include dataset.40. 49. 47.. How much is memory space involved. 46..

. What do you do if you do not want to keep all the space allocated to a dataset? Specify the parameter RLSE ( release ) in the SPACE e.GxxxxVyy. b.50). direct.absolute generation number. yy-version number. If number is not specified all generations will be processed from the beginning 57. Advantage . EMPTY – When limit is reached all members are removed from the index. SCRATCH – Removed members are uncataloged & deleted. where xxxx .removed & uncataloged. DSCB) on the same volume to supply DCB information.group of dataset that are logically or chronologically related. SPACE=(CYL. (VSAM . Can be sequential. referred by name and a relative generation number .RLSE) 52. How do you access a file that had a disposition of KEEP? Need to supply Volume Serial Number VOL=SER=xxxx 53.all datasets have the same name and system keeps track of adding new and retaining previous generations and deleting oldest successive generation. c. To create a GDG we create a GDG index in the system catalog with IDCAMS utility and then a model (prototype. but remain in the system (not members of GDG any more). otherwise-only oldest. What is mean by GDG? GDG . What are the three guidelines do we have to follow when concatenating DD statements? a.an integer which identifies the generation of a dataset and is coded in parentheses after dataset name. Must always be cataloged. Datasets must be of the same type (disk or tape) All datasets must have the same logical record length The dataset with the largest block-size must be listed first 54.51. Absolute GDG name . otherwise .(50. Is it possible to know the remaining free space in a Control Interval/Control Area once an insertion has been made? Not Possible 55. In which table PLAN is registered in? RCT 56. What are advantages of GDG? Advantage .no).g. partitioned.all datasets have the same name and system keeps track of adding new and retaining previous generations and deleting oldest successive generation. GDG number is updated at the end of the job.

How to create GDG? To create a GDG we create a GDG index in the system catalog with IDCAMS utility and then a model (prototype. DSCB) on the same volume to supply DCB information. The system needs an existing dataset to serve as a model to supply the DCB parameters for the generation data group one wish to create. To allocate a new generation. the DCB of the model dataset can be overridden when you allocate new versions. Do all versions of the GDG have to be of the same record length? No. we would be using (+1) with a DISP of (NEW. What is model dataset label (Model DSCB)? A model dataset label is a pattern for the dataset label created for any dataset named as a part of the GDG group.GnnnnV00 where nnnn= generation number (upto 255). 66. Can we brose or edit the GDG dataset if it is a tape entry? No 67. How would you reference the 1 st generation in the JCL? Use GDG name(-2) 65. How do you mention in the JCL. Suppose a generation of GDG gets created in a particular step of a proc. The catalogue information of GDG will not be updated until the completion of job.DELETE). IDCAMS utility is used to define the GDG base. nnnn will be 0000 for the 1st generation. Define statement is used to create GDG base 62. Dataset name(+1) only. 59.CATLG. 61. To refer to this in a subsequent step in the same job. 64.58. How would you refer the current generation in a subsequent step? What would be the disposition of this generation now? Relative generation numbers are updated only at the end of the job. not at the end of a step. Which Utility program is used to create GDG base? IDCAMS. 63. when you want to create a new GDG data set? How do you refer the same dataset in the next step? Using dataset name (+1) . Hpw are different versions of GDG named? Base-file-name. we would again use (+1) but with a DISP of SHR or OLD. A GDG base is created in the system catalog and keeps track of the generation numbers used for datasets in the group. The model dataset label must be . How do you refer a current (or latest) GDG dataset in the JCL? Using Dataset name (0) 60. Suppose 3 generations of a GDG exist.

75.DATA(+1). How may divisions are there in JCL-COBOL? 6 74. The maximum number of steps in a JOB? 255 78. What do you mean by spooling? Expand SPOOL? This is managed by JES. How is a new GDG coded? A new GDG is coded as (+1) after the dataset name as follows: DSN=JAN. How are GDGs concatenated? Generation Data Groups are concatenated by specifying each dataset name and the generation number for all generations of the generation data group. The result is the same as if all individual datasets were concatenated. 70. If generations are not on the same volume. This will cause all generations to be pushed down one level at the end of the job. The model DSCB name is placed on the DCB parameter on the DD statement that creates the generation data group. What is the parameter to be passed in the job card for the unlimited time. The DD statement will refer to all generations. Minimum number of dataset names (PDS) in one directory block? 6 77. irrespective of the job class TIME=1440 71. 68. For how long a job can be executed continuously in a Mainframe? 248 Days 73.cataloged. omit the generation number. This is used for Queuing the Outputs that are intended for Printing and are first stored in SPOOLDASD. 69. . Maximum number of DD statement in a JOB? 3273 How much space OS allocates when you create a PS or PDS? 56 KB 76. How many Instream-Procedures (procs) can be coded in a single Job? 15 72. this will not work. Otherwise to have all generations of a generation data group.

Datasets must be of the same type (disk or tape) All datasets must have the same logical record length The dataset with the largest blocksize must be listed first.. IEBCOPY and REPRO in IDCAMS utility? IEBGENER – This is a dataset utility for copying sequential datasets which produces a PDS or a member from a sequential dataset. How many levels of nesting is allowed in PROCs? 15 80. How much memory space involved.p) for a PDS where n. and p are numbers. What is the main difference between creating a new sequential flat file and a partitioned dataset? SPACE=(n. What is DSNDB06? This is the Place where DB2 Catalog resides 83. What is DATACOM DB? It is a database used with VSE.79. when we code BLOCKSIZE. While Allocating a dataset you don't have to run any utility [this could be done by giving DISP=NEW in DD statement]. statement in JCL[when used it wouldn't perform any task]. 82. e.. c. What is a Dummy Utility and What it does? IEFBR14 is a Dummy utility and it is used for the sake of EXEC PGM= . What is the purpose of Identification Division? Documentation.. 81.m. b. On the DD statement. What is the difference between IEBGENER. .g. 88. 87. it is used. 85. What are three guidelines do we have to follow when concatenating DD statements? a. But for a PGM name must be given in EXEC statement. m. TRK & CYL? One block constitutes 32KB of formatted memory/ 42KB of Unformatted memory.m) for a sequential file SPACE=(n. 89. 6 blocks makes one Track & 15 Tracks makes one cylinder. 86. The maximum number of instream procedure you can CODE in any JCL is? 15. What is the use of DSNDB07? This is the area where sorting takes place in DB2 84. The p designates how many directory blocks to allocate.

Any JES2 or JES3 control statements 96. More or less same as the IEBGENER. What is the difference between catalog procedure and In-Stream procedure? Insream procedures are set of JCL statements written between JOB and EXEC statements. the called program is a stand a log program. They are called Instream procedure and catalogued procedure. Mainly used to test cataloged procedures. A procedure is initiated with the keyword PROC.intrdr) write your JCL to this file. There are two types of procedures in JCL. It is also one that other programmers or users can follow logically and is easy to read and understand. How do you submit JCL via a COBOL program? Use a file //dd1 DD sysout=(*. 92. JOB. JOBLIB or JOBCAT DD statements 3. 97. or Null statements 2. the called program is not an executable program it can executed thru the called program 93. REPRO – This is for copying sequential datasets. As about Dynamic call. it is an executable program. What is a Procedure? A set of pre-coded JCL that can be modified through the use of parameters or override cards. Cataloged procedure is cataloged on the procedure library and is called by specifying the procedure name on the EXEC statement. 94. 90. DD * or DATA statements 4. What is the difference between static call & Dynamic call? In the case of Static call. 95. How to execute a set of JCL statements from a COBOL program Using EXEC CICS SPOOL WRITE(var-name) END-EXEC command. Delimiter(/*). Can we browse or edit the GDG dataset if it is a tape entry? No . start with PROC and end with PEND statement. During run time we can call it in our called program.IEBCOPY – This is a dataset utility for copying one PDS to another or to merge PDSs. Varname as a COBOL host structure containing JCL statements. The Procedure helps to minimize duplication of code. Name some of the JCL statements that are not allowed in PROCs? Some of the JCL statements which are not allowed in procedures are: 1. 91. What do you feel makes a good program? A program that follows a top down approach.

What does SYSIN * indicate? Instream data follows this card and is terminated when followed by a card containing // or /* in columns 1 and 2. KEEP. How do you continue a JCL card? A comma should follow the last entry on the original card. and the rest of the Parms must start in or before column 16. SHR. 2 GB for MVS/XA and MVS/ESA. How to get cursor position from system in CICS environment? Get it from EIBCURPOS 100. What are the maximum and minimum sizes of any CONTROL AREA (VSAM datasets) ? Minimum Size: 1 Track Maximum size: 1 Cylinder 99. The continuation card must have // in columns 1 and 2. TSO for On-Line Users. OLD. How many parameters are there to a DISP statement and what are their uses. 105. It is also one that other programmers or users can follow logically and is easy to read and understand. followed by a least one blank. What is COMM? COMM – Half Word binary 103. What do you mean by a ADDRESS SPACE? A address Space is the amount of Virtual Storage Seen by the Job. KEEP. MOD) Parameter 2: Normal close action for data set (CATLG. What do you feel makes a good program? A program that follows a top down approach. There are three parameters. DELETE) Parameter 3: Abend action for data set (CATLG. DELETE) 101.98. 104. What is the error code SOC01 indicate? Operation exception error For example: a dataset open error 102. Parameter 1: Current data set disposition (NEW. . Batch Jobs execute in an Intiator Address Space 106.

SORTWK02.. but a minimum of 3 is required. S0C4. In the JCL.//sysin dd * here u code the parameters(value) to pass in to cobol program/*and in program you use accept variable name(one accept will read one row)/.it will take john inside to read next value u have to code another variable in the same way above mentioned. 110.2? It decides how many members you want to have under one PDS. What are S0C1.'david' in cobol program you have to code linkage section in that for first value you code lenth variable and variable name say. S0C5 and S0C7 ABENDs? S0C1 (Operation Exception Error) .May be due to • Missing or misspelled DD name • Read/Write to unopened dataset • Reading a dataset opened output mode • Writing into a dataset opened input mode • Called subprogram not found S0C4 may be due to • Missing Select statement (during compile) • Bad Subscript/index • Protection Exception • Missing parameters on called subprogram • Read/Write to unopened file • Move data from/to unopened file S0C5 May be due to • Bad Subscript/index • Close an unopened dataset • Bad exit from a perform • Access to I/O area (FD) before read S0C7 may be due to .. In jcl using parm statement ex: In exec statement parm='john'. abc pic x(4)..107. One directory block can contain 5 members 109.another way. What is the directory block size in option 3... 111. DD names in the step. How do you code Cobol to access a parameter that has been defined in JCL? And do you code the PARM parameter on the EXEC line in JCL? Using JCL with sysin . 108. How do you define a SORT file in JCL that runs the COBOL program? Use the SORTWK01. Number of sort datasets depends on the volume of data being sorted. how do you define the files referred to in a subroutine? Supply the DD cards just as you would for files referred to in the main program.

Max.: READING a file that is not open. These dumps provide the offset of the last instruction at which the abend occurred. What are SD37. SE37 abends? All indicate dataset out of space. e. 116. Examine that possibility first. 115. SB37 . What is 'S0C7' abend? S0C7 is Caused by invalid data in a numeric field. Could indicate an infinite loop.can be due to various reasons. and no further volumes specified. To get capture the runtime dumps. SD37 . SB37. What do you do to resolve SOC-7 error? Basically you need to correct the offending data. invalid address referenced due to subscript error. Then you can look at the source code to find the bug.Division by Zero 112. 114.end of vol. Some installation might have batch program debugging tools. What does SOC4 error mean? S0C4 is a Storage violation error .g. Many installations provide you a dump for run time abends (it can be generated also by calling some subroutines or OS services through assembly language). you will have to define some datasets (SYSABOUT etc) in the JCL. The main reason for this error is that a variable is defined with fewer characters and we are trying to move data which is larger than the actual storage space. 113. What is S322 abend? Indicates a time-out abend. Many times the reason for SOC7 is an un-initialized numeric item. Your program has taken more CPU time than the default limit for the job class.• • • Numeric operation on non-numeric data Un-initialized working storage Coding past the maximum allowed subscript S0CB might be due to 1. How do you trap abends in the JCL? Use IF ABEND statement in the JCL . 117.no secondary allocation was specified. Use them. If none of these are helpful. use judgment and DISPLAY to localize the source of error. of 16 extents already allocated. SE37 . This error is faced when we execute the COBOL program. Examine the compilation output XREF listing to get the verb and the line number of the source code at this offset.

How do you restart a PROC from a particular step? In job card. A PROC has five steps.yyyy' and u try to create one with disp=new.. At this point since an entry already exists the catlg would fail and give this message. 126. How do you skip a particular step in a proc/JOB? Can use either condition codes or use the JCL control statement IF (only in ESA JCL) 123. The program open and write would go through and at the end of the step the system would try to put it in the system catalog. Step 3 has a condition code. How can you override/nullify this condition code? Provide the override on the EXEC stmt in the JCL as follows: //STEP001 EXEC procname.RLSE) 120. and then override it in JCL with instream data. 119.50)..(50. The dataset will not be retained once the job completes.catlg. you would get this error. What is NOTCAT 2 This is an MVS message indicating that a duplicate catalog entry exists. 125.g.g.118. 124. We use them to carry the output of one step to another step in the same job. PARM have to be overridden like this.COND.STEPNAME.. One way is to code SYSIN DD DUMMY in PROC. 121.stepname=value All parameters on an EXEC stmt in the proc such as COND. Can you code in-stream data in a PROC? How do you overcome if there are limitations? No. . if you already have a dataset with dsn = 'xxxx. SPACE=(CYL. E. How do you override a specific DDNAME/SYSIN in PROC from a JCL? //<stepname. Where PROCNAME = Name of the JCL step that invoked the procedure and STEPNAME = name of the procedure step where you want execution to start 122. How many extents are possible for a sequential file ? For a VSAM file? 16 extents on a volume for a sequential file and 123 for a VSAM file. What do you do if you do not want to keep all the space allocated to a dataset? Specify the parameter RLSE ( release ) in the SPACE e.dd> DSN=. How do you create a temporary dataset? Where will you use them? Temporary datasets can be created either by not specifying any DSNAME or by specifying the temporary file indicator as in DSN=&&TEMP. You can fix the problem by deleting/uncataloging the first dataset and going to the volume where the new dataset exists (this info is in msglog of job) and cataloging. specify RESTART=PROCNAME.

The DISP applies to the PDS and not to a specific member. What does IEBGENER do? Used to copy one QSAM file to another. 130. How do you send the output of a COBOL program to a member of a PDS? Code the DSN as PDS(member) with a DISP of SHR. 132. Source dataset should be described using SYSUT1 ddname. Destination dataset should be described using SYSUT2. 133. 129. and then override it in JCL with instream data. REGION specifies the max region size.127. I have a COBOL program that ACCEPT 's some input data. . What does the TIME parameter signify ? What does TIME=1440 mean? TIME parameter can be used to overcome S322 abends for programs that genuinely need more CPU time. Why do you want to specify the REGION parameter in a JCL step? To override the REGION defined at the JOB card level. How do you check the syntax of a JCL without running it? TYPERUN=SCAN on the JOB card or use JSCAN. IEBGENR can also do some reformatting of data by supplying control cards via SYSIN. Can you code in-stream data in a PROC? How do you overcome this limitation? No. One way is to code SYSIN DD DUMMY in PROC. 128. What is the significance of TIME parameter in EXEC statement? Time parameter is used to specify the amount of CPU time that a job or job step is permitted to use before it terminates TIME parameter can be specified both on JOB and EXEC statements The Time parameter specified in EXEC statement will override the TIME parameter specified on the JOB statement. TIME=1440 means no CPU time limit is to be applied to this step. I have multiple jobs (JCL 's with several JOB cards) in a member. 134. REGION=0K or 0M or omitting REGION means no limit will be applied. How do you code the JCL statement for this? (How do you code in-stream data in a JCL?) //SYSIN DD* input data /* 135. What happens if I submit it? Multiple jobs are submitted (as many jobs as the number of JOB cards). 131.

.Partitioned.MYPROCLIB. JOBLIB? What is it used for? Specifies that the private library (or libraries) specified should be searched before the default system libraries in order to locate a program to be executed.LINKLIB. What are the valid DSORG values? PS .136. 144. PO . 138..) LIB(. STEPLIB has got higher priority over JOBLIB.. What happens if both JOBLIB & STEPLIB is specified? STEPLIB will be given first priority. What is STEPLIB. STEPLIB is available to the particular step only.) PARMS(.. 140. Where in the job-stream is the JOBLIB statement placed? After the JOB statement and before the EXEC or PROC statement 139.. What happens? Records will be written to end of file (append) when a WRITE is done in both cases. then the system libraries such as SYS1. How to change default PROCLIB? //ABCD JCLLIB ORDER=(ME.QSAM. 141.. JOBLIB is ignored.PROCLIB) 143.) RUN PROGRAM(MYPROG) PLAN(. What is order of searching of the libraries in a JCL? First any private libraries as specified in the STEPLIB or JOBLIB.. 142. How do you run a COBOL batch program from a JCL? How do you run a COBOL/DB2 program? To run a non DB2 COBOL program: //STEP001 EXEC PGM=MYPROG To run a DB2 COBOL program: //STEP001 EXEC PGM=IKJEFT01 //SYSTSIN DD * DSN SYSTEM(. The system libraries are specified in the linklist. What happens? The DISP in the JCL is SHR and the PGM opens the file in EXTEND mode. The DISP in the JCL is MOD and the program opens the file in OUTPUT mode. SYS1. JOBLIB belongs to all the steps in the Job and should be immediately followed by job statement.. IS – ISAM .... When you specify multiple datasets in a JOBLIB or STEPLIB.) /* 137. what factor determines the order? The library with the largest block size should be the first one..

How is the keyword DUMMY used in JCL? For an output file DUMMY specifies that the output is to be discarded. It is defined by an IDCAMS define generation datagroup execution. &symbol=value. in a JOBLIB statement where the load module can exist in one of many datasets. An override replaces the PROC's statement with another one. What is a GDG? How is it referenced? How is it defined? What is a MODELDSCB? GDG stands for generation data group. it will search in all the datasets specified in the include dataset. What are the keywords associated with DCB? How can you specify DCB information? What is the OS precedence for obtaining that DCB information. Where does the system look for it first? The keywords associated with the DCB parameter are LRECL. It matches the internal name specified in the steps executing program. BLKSIZE and DSORG. It is a dataset with versions that can be referenced absolutely or relatively. 152. 153.760. 150. 151. What is the purpose of the PARM keyword in the EXEC statement? The value after the PARM= specifies control information to be passed to the executing program of the job step.145. it substitutes for the entire statement. For input it specifies that the file is empty. Dataset name is the operating system (MVS) name for the file. 147. ie. The system looks for DCB information in the program code first. The DCB information can be supplied in the DD statement. When we specify the dataset name in include. the value for the symbolic is supplied when the PROC is invoked.Based on that we can calculate efficient number of Records in a Block 146. What is the max block-size for a Tape file? It is 32. In COBOL that's the name specified after the ASSIGN in the SELECT ASSIGN statement. Datasets can be grouped in a DD statement one after another. 149. 148. What is the meaning of data definition name (ddname) and dataset name (dsname) in the DD statement? Data definition name is the eight character designation after the // of the DD statement. What is the difference between a symbolic and an override in executing a PROC? A symbolic is a PROC placeholder. What is the purpose of include statement in a JCL? It is used as an alternative for STEPLIB. eg. eg. RECFM. Explain concatenating datasets. .

like a tape From the VTOC .154. What does the keyword DCB mean and what are some of the keywords associated with it? DCB stands for data control block. In // SYSPRINT DD SYSOUT=*. Keywords associated with it are BLKSIZE. How do you describe the input data. What is the difference between * and DATA? DD * and DD DATA describe the input data which follows the above mention cards. It consists of the following sub-parameters: SPACE=(BLKS/CYL/TRK. where as BLKSIZE is multiples of LRECL 156. What happen if I submit that member? All the jobs in a member are submitted 157. What is a Label? The LABEL parameter tells the type of label.for Dasd From the JCL . 163. 159. When should be NL be specified as a type of label processing? NL should be specified when a program needs to process unlabeled tapes 161. what is mean for ‘*’? * . 155.FD: BLOCK CONTAINS 3 RECORDS RECORD CONTAINS 100 CHARACTERS The label . What is the difference between BLKSIZE and LRECL? LRECL is the logical record length . JCL contain several JOB cards in a member.(primary.RLSE.CONTIG) . index). 160. How does the system get information about the block size? DCB info comes from: Program . and whether the data set is to be protected for input or output.DCB=BLKSIZE=nnn. 3. which is a part of the input job stream? You should use either DD * or DD Data. DEN. 1. 2. It actually refers the same output device specified in the "MSGCLASS" parameter of JOB statement 158. 162. which should allocated on the DD statement for the output data sets stored on the disk. What is the purpose of SPACE parameter? It is a keyword parameter. it is a keyword for the DD statement used to describe datasets. the relative file number. LRECL and RECFM. If the input data contains record switch // in col 1 and 2 then DD Data should be used. secondary. 4.Means not the DEFAULT class.

How do you override a specific DDNAME/SYSIN in PROC from a JCL? //<stepname. 170. etc. Program . 165. It permits you to allocate more space than perhaps. What is a CONTIG? CONTIG requests the primary space be allocated only on contiguous tracks and cylinders.FD: BLOCK CONTAINS 3 RECORDS RECORD CONTAINS 100 CHARACTERS 2. What kind of information DCB parameter provides? It provides what kind of record will be processed. What is a RLSE? RLSE releases all unused space when the data set is closed. How does the system get information about the block size? DCB info comes from: 1.DCB=BLKSIZE=nnn 172. What is the use of a delimiter statement? It is normally used for instream input and specifies where the instream starts and where it ends. 167. the cylinders are also contiguous. such as fixed block or variable block.like a tape 3. The label .dd> DSN=… . and if more than one cylinder is needed. Also some other kinds of information also provided such as DSORG.164. it needed without wasting space. How do you read input that is mentioned in the sysin card of JCL through COBOL program? Using ACCEPT Statement 168. From the JCL . Space is released only if the data set is not empty and if the data set is closed after being opened. blocksize. What is the DD name. OPTCD. What is the significance of OUTLIM parameter? The OUTLIM parameter is coded on the DD statement and is used to limit the number of lines that are output to the destination specified in the SYSOUT. 166. 171. where all your DISPLAY statements will be routed? SYSOUT 169.for Dasd 4. that is all tracks on a cylinder are contiguous. From the VTOC . length of the record. But it is very much obsolete now.

dd names in the step. How do you define a sort file in JCL that runs the COBOL program? Use the SORTWK01.. . What is meant by INCLUDE statement in SORT step? The Include statement is coded in the sort program to select only specified records which meet the specified criteria. How would you limit the time allotted for a JOB to forty-five seconds? With a TIME Parm on the JOB statement in the form: TIME=(. The DISP applies to the PDS and not to a specific member 180. Where as IEBCOPY is used to copy members of a Partitioned dataset. Compare IEBGENER and IEBCOPY utilities? IEBGENER is used to copy one sequential data set to another dataset. to load tape data sets to direct access devices and to compress datasets 181. What JCL statement will you use to activate a dump if there is an abend? SYSUDUMP DD SYSOUT=A or MSGCLASS 179. 182.. How do you send the output of a COBOL program to a member of PDS? Code the DSN as PDS(member) with a DISP of SHR.173.. but a minimum of 3 is required. 183. What is meant by SUM FIELDS = NONE in the SORT utility? Duplicate records will be eliminated. How do you change LASTCC and MAXCC values in the JCL? Using SET command like SET MAXCC = 8 178. What are LASTCC and MAXCC? LASTCC implies the resultant code resulted from the last step MAXCC implies the max return code resulted from all the previous steps 177. What happens if you submit a job without a jobcard? The job will be terminated by the computer stating that no jobcard is present. 175. Number of sort datasets depends on the volume of data being sorted. In case of Temporary Data Sets.. 45) 174. The dataset will not be retained once the job completes 176.. SORTWK02. can we retain the data set once the job completes? NO.

How can I use DFSORT to create reports? DFSORT has some powerful reporting capabilities. INREC reformats the record layout before it is passed through the sort. You simply specify the fields to be included in the new record.10. Here's some examples: SORT FIELDS=(1.CH.184. Method 2 uses DDNAMEs defined by DFSORT in the form SORTOFxx. followed by the 4 bytes starting at position 50.CH. followed by the 4 bytes starting at position 40. Both methods use the OUTFIL keyword. You can also define multiple reports using the same techniques as for multiple output files.C'B') In this example the sort file is split into 2 files SORTOF1 and SORTOF2. INCLUDE=(1.10.A) OUTFIL FILES=1. SORT FIELDS=(1.PD. including Headings.10. There are two different ways to do this. and are identical except in how you specify the DDNAME. CUST1 and CUST2.A) INREC=(1.50.4.CH.10. while OUTREC will reformat the record layout after the record has been sorted.INCLUDE=(1. Can I sort records into different files? DFSORT allows you to write to multiple output files. SORTOF1 and SORTOF2 must be defined as DDNAMEs in the JCL.1. 186.10. You can use the OUTFIL keyword to define the report layout. depending on whether the first character is A or B.INCLUDE=(1.EQ.C'A') OUTFIL FNAMES=CUST2. Example: . 185.CH.4.1.EQ.4) Both examples will reformat the record so that it consists of the first 10 bytes of the input record.A) OUTREC=(1.CH. Can I reformat a record layout before/after sorting? You can change the layout of a record both before and after it is sorted using the INREC and OUTREC keywords.CH.EQ.10. trailers and control breaks.CH.1.4.40.1.C'A') OUTFIL FILES=2.PD) SORT FIELDS=(1. depending on whether the first character is A or B. Method 1 allows you to specify the DDNAME to be written to: SORT FIELDS=(1. INCLUDE=(1.EQ.C'B') In this example the sort file will be split into 2 files. CUST1 and CUST2 must be defined as DDNAMES in the JCL. record counts.50.40.CH.A) OUTFIL FNAMES=CUST1.CH.

189. HEADER2=(10:'Invalid Keys '.MASTER. DISP=SHR //ALTMSTR1 DD DSN=TEST.A) SUM FIELDS=NONE 188.A) OUTFIL HEADER1=(5:'CONTROL REPORT'. These 1. This will remove any records with equal sort fields. 5:'KEY'.SL).43.'PAGE: '. 20:'***** END OF REPORT *****') 187./.MSTR.10X. How can I remove records with duplicate keys? You can remove duplicates by specifying SUM FIELDS=NONE.5X.ALTPATH.15X.74X).&DATE=(DM4/).'NAME'). TRAILER1=(15:'TOTAL NO OF RECORDS IS '.13. Is it possible to know the remaining free space in control interval / control area. Example: SORT FIELDS=(1.CH.SL). E. LABEL=(3.A.5X.SL). What are the maximum and minimum sizes of any CONTROL AREA? Minimum Size : 1 track Maximum size : 1 cylinder 191. Then JCL should be coded as followed //ALTMSTR DD DSN=TEST. once an insertion is made? You can find using LISTCAT command 192.20.g: In the Cobol program the input-output section is coded as below and file accessed using VSAM file.&PAGE.30. LABEL=(2. What is the use of single & double ampersand in the JCL or PROC? The single ampersand is used to represent symbolic parameter and double ampersand is used to represent temporary datasets.SORT FIELDS=(1./.10. OUTREC=(5:1.'PAGE: ' &PAGE).CH. how? By using LABEL parameter and specifying the numbers of the datasets in order.10.30X.CLUSTOR.CH. How do you specify the DD card in JCL when you want to read records from VSAM file based on alternate index in the COBOL program? You need to mention in the JCL base cluster and Path for the alternate index. 2 or 3 shows the order of the datasets placed in the tape. DISP=SHR .COUNT. Can more than one dataset be stored in a tape? If yes.5. such as: LABEL=(1. SELECT ALT-VSAM FILE ASSIGN TO ALTMSTR 190.

DATA. How are datasets concatenated? Datasets are concatenated by writing a normal DD statement for the first dataset and then adding a DD statement without a DDNAME for each dataset to be concatenated in the order they are to be read. What is the difference between BLKSIZE AND LRECL? LRECL is the logical record length.DISP=SHR DD DSN=MAR. The following is an example of three datasets concatenated: //YEARDAT // // DD DSN=JAN. How do you convert ASCII data format to EBCDIC? Use OPTCD sub parameter in the DCB parameter . where as BLKSIZE is multiples of LRECL 195.DISP=SHR 194.DISP=SHR DD DSN=FEB.DATA.DATA.193.

NOTIFY=T0DPFDS //STEP1 EXEC PGM=PROGRAM1 //STEPLIB DD DSNAME=LIBRARY.DISP=SHR //SYSOUT SYSOUT=A //STEP02 EXEC PGM=PGM02 //INFILE DD DSN=TEST.20)).DATA.DELETE).PAYROLL.(100.DISP=SHR DSN=INFILE.DATA.PAYROLL.KEEP) 2.'Frank Smith'.DISP=(NEW.'FRANK SMITH'.PAGELIMIT=45 PRTOUT DD NODE=HOUSTON.PROD.KEEP) SAME=TEST.PAGESIZE=45 SYSOUT DD LOC=HOUSTON.DATA. // AVGREC=U.DATA.DISP=EXCL DSN=INFILE.DISP=(NEW.PAYROLL.U202.DISP=(NEW.KEEP) COPY=TEST.DATA.DATA.PROD.BENEFITS.PROD. which line.LINECT=45 SYSPARM DD SYSTEM=HOUSTON.KEEP) LIKE=TEST. //T0DPFDSI JOB (00010.PERSONEL.TEST.PAYROLL.DATA.KEEP) CLONE=TEST.DATA.DISP=(NEW.G000600.DISP=(NEW.DISP=SHR //SYSOUT DD SYSOUT=A //FILEIN DD DSNAME=FILE1.1.PROD.DISP=SHR Referring to the above coding.DISP=(NEW.DATA.CLASS=E.08E1).DATA.SPACE=(80.TEST. // DCB=(LRECL=80. // MSGCLASS=L.LINELMT=45 3. Which statement transmits print output to the remote location called DETROIT? A) B) C) D) E) /*TRANS PRINT DETROIT \\*XMIT REPT DETROIT //*XMIT PRINT DETROIT /*ROUTE PRINT DETROIT \*XCHG REPORT DETROIT 4.DATA.TEST. //MYJOB JOB(T.DISP=OLD DSN=INFILE.RECFM=FB) . added to STEP03.DISP=SHR //SYSOUT SYSOUT=A //STEP03 EXEC PGM=PGM03 //OUTFILE DD DSN=TEST.SH1).LOADLIB.PROD.DISP=RESV DSN=INFILE.DATA.DATA.DATA. Which line defines that the SYSOUT dataset will print 45 lines to a page and print at the offsite location called HOUSTON? A) B) C) D) E) //H002 //HOU1 //H003 //HOU2 //H001 SYSPRT DD REMOTE=HOUSTON.CLASS=A //STEP01 EXEC PGM=PGM01 //INFILE DD DSN=TEST. gives the OUTFILE dataset the same attributes as the INFILE dataset in STEP01? A) B) C) D) E) // // // // // DUP=TEST. Which of the following JCL statements obtains exclusive use of a dataset? A) B) C) D) E) //INFILE //INFILE //INFILE //INFILE //INFILE DD DD DD DD DD DSN=INFILE.LINEPAGE=45 OUTPUT DD DEST=HOUSTON.DISP=LOCK 5.DISP=SHR //FILEOUT DD DSNAME=FILE2.DATA.PAYROLL.PAYROLL.

// OVERRIDE=(A10010.CLASS=E. // MSGCLASS=L.50). // SPACE=(800.DISP=(NEW.DELETE).STEP2 DD SPACE=(800..(250.50). // DCB=(LRECL=80.LOADLIB.50).20)).50). // DCB=(LRECL=80.(100.TEST. B) Device Time Out D) Operator Cancellation //A10010 PROC //STEP2 EXEC PGM=PROGRAM2 //STEPLIB DD DSNAME=LIBRARY.DISP=SHR //FILEOUT DD DSNAME=FILE3.'Frank Smith'.(250.TEST.STEP2 DD SPACE=(800.TEST.20).TEST.RLSE).(250.RLSE) //STEP1 EXEC PROC=A10010 /* OVERRIDE A10010.DATA.DELETE).SPACE=(80.TEST.ACCOUNTING.RLSE)) //STEP1 EXEC PROC=A10010.(250.08E1).DATA when the following EXEC statement invokes the proc A10010? //STEP1 EXEC PROC=A10010 A) B) //STEP1 EXEC PROC=A10010 //STEP2.4) 8.DATA.G000600.DATA.4) C) // TAPE=SER=4 E) // SERIES=(4) B) // VOL=(.NOTIFY=T0DPFDS //STEP1 EXEC PGM=PROGRAM1 //STEPLIB DD DSNAME=LIBRARY.RLSE) //STEP1 EXEC PROC=A10010 // DD * FILEOUT.DISP=SHR //SYSOUT DD SYSOUT=A //FILEIN DD DSNAME=FILE1.BLKSIZE=800) Referring to the above coding.FILEOUT DD SPACE=(800.DATA. //INFILE DD DSN=PROD.RLSE) C) D) E) 7.4) D) // SER=NUM=(. Which one of the following parameters calls for the fourth tape of the above multi-volume tape dataset? A) // VOL=SER=(5. what statement can you add to change the space parameter of FILE3.DISP=OLD.LOADLIB.TEST.SPACE=(800.DISP=SHR //SYSOUT DD SYSOUT=A //FILEIN DD DSNAME=FILE2.MASTER. //T0DPFDSI JOB (00010.(250.DISP=(NEW.(100.CATLG.FILEOUT=(SPACE=(800.50).FILEOUT.What would cause the above job to fail if it terminated on an S222 error? A) Exceeded Line Limit C) Security Access Denied E) System Time Out 6.RECFM=FB) What caused the above job to fail if it terminated in STEP1 on an S913 error? .RLSE) //STEP1 EXEC PROC=A10010 //SUBSTITUTE A10010. // AVGREC=U.TEST.RECFM=FB.DISP=SHR //FILEOUT DD DSNAME=FILE2.

GV(12).ARST=OP PGM=PGM01. // UNIT=(3480.PAYROLL.TEST.DISP=SHR //SYSOUT SYSOUT=A Which change to STEP01 above will specify that STEP01 can be Automatically restarted by an operator if that step fails during execution? A) B) C) D) E) //STEP01 //STEP01 //STEP01 //STEP01 //STEP01 EXEC EXEC EXEC EXEC EXEC PGM=PGM01..DATA.U202.DISP=(.DATA? A) B) C) D) E) //INFILE //INFILE //INFILE //INFILE //INFILE DD DD DD DD DD DSN=INFILE.DATA. //MYJOB JOB(T.'FRANK SMITH'. // DEV=3480.DISP=(.DATA.DISP=(. // VOL=(565501.DISP=SHR DSN=INFILE.TEST.VOL=HOLD C) //FILEIN1 DD DSNAME=FILE1.DISP=SHR DSN=INFILE.CATLG.DATA.DISP=(. // UNIT=(3480.WAIT) D) //FILEIN1 DD DSNAME=FILE1.CLASS=A //STEP01 EXEC PGM=PGM01 //INFILE DD DSN=TEST.CATLG.AR=OS PGM=PGM01. // DEVICE=(3480.SH1).RD=R PGM=PGM01.CATLG.CATLG. Security Access Denied Operator Cancellation System Time Out Device Time Out Exceeded Line Limit Which JES2 statement specifies that the job is to run on the system called N002? A) /*JOBNODE SYS=N002 C) /*SYSTEM NODE=N002 E) /*SYSNODE SYSID=N002 B) /*SYSID SYSNAME=N002 D) /*JOBPARM SYSAFF=N002 10.DATA.DEFER) B) //FILEIN1 DD DSNAME=FILE1.DELETE). Which statement transmits print output to the remote location called DETROIT? A) B) C) D) E) /*TRANS PRINT DETROIT \\*XMIT REPT DETROIT //*XMIT PRINT DETROIT /*ROUTE PRINT DETROIT \*XCHG REPORT DETROIT .OP=RST 13.DATA.RST=OP PGM=PGM01.DELETE).DATA.DELETE).DELETE)..TEST.CATLG.GEN(12).DATA.DISP=SHR DSN=INFILE.DATA..DELETE). Which line suspends tape-volume requests until the dataset has been opened? A) //FILEIN1 DD DSNAME=FILE1.SUSPEND) 11.DATA.WAIT) E) //FILEIN1 DD DSNAME=FILE1. Which JCL statement acquires the 12th generation of the generation dataset INFILE.DISP=(.TEST.G0012V00.DISP=SHR 12.DATA(12).TEST.DISP=SHR DSN=INFILE.GEN=12.A) B) C) D) E) 9.

// DCB=(LRECL=80.MASTER. // SPACE=VSTOR E) //TEMPDS2 DD DSNAME=TEMP.RECFM=FB.DISP=(NEW.REGION.PASS).DISP=(NEW.DISP=(NEW.DISP=(NEW. Which statement.TEST.DATA. alters the job's position in the JES spool? A) C) E) //FACTOR 12 /*PRIORITY 12 //SCHEDULE 12 B) D) /*SPOOL 12 //POSITION 12 17.DISP=(NEW.DISP=(NEW.MASTER) Which one of the following.STEP2.BLKSIZE=800) If the default region size for the job is 528 kilobytes.PASS).PARM. added to the above generation data group definition.PASS).STEP2=(REGION.0) // DCB=(DSORG=PS. removes all generations.WEEKLY.STEP2=2M A10010.CLASS=A // EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=A //MODEL DD DSN=PAYROLL. // SPACE=(TRK. //SYDOEJ JOB USER=SYDOE.STEP2(TIME=2M) A10010.DELETE).RECFM=FB) //SYSIN DD * DEFINE GDG ( NAME(PAYROLL.KEEP).PASS).DATA.DISP=(NEW.DATA.DISP=SHR //FILEOUT DD DSNAME=FILE3.UNIT=3380.14.15) C) //TEMPDS2 DD DSNAME=TEMP.UNIT=VIRT.15) How can the above code be altered to make the above dataset reside in virtual storage? A)//TEMPDS2 DD DSNAME=TEMP. // SPACE=(TRK.DATA.UNIT=3380.DATA.DATA.UNIT=3380. added before the jobcard. when the limit of 32 generations is exceeded? A) ALL B) CLEAR C) EVERY D) EMPTY E) REMOVE 15.2M) A10010.PASS).DISP=(NEW.CATLG.SPACE=VIRT B) //TEMPDS2 DD DSNAME=TEMP.LOADLIB.UNIT=3380.2MEG) A10010. // SPACE=(TRK.PASS).UNIT=VIO. // SPACE=(800. //A10010 PROC //STEP2 EXEC PGM=PROGRAM2 //STEPLIB DD DSNAME=LIBRARY.REGION=(STEP2.DISP=SHR //SYSOUT DD SYSOUT=A //FILEIN DD DSNAME=FILE2. // UNIT=SYSDA.DATA.20).(100.TEST.WEEKLY. //TEMPDS2 DD DSNAME=TEMP. how can you override STEP2 of the above procedure to have a 2-megabyte region size when it is executed? A) B) C) D) E) //A10010 //A10010 //A10010 //A10010 //A10010 EXEC EXEC EXEC EXEC EXEC A10010.REGION=2M .DATA. excluding the current generation. // SPACE=VIRTUAL D) //TEMPDS2 DD DSNAME=TEMP.15) 16.TEST.SPACE=(TRK.RLSE).

DISP=(NEW.PAYROLL. //MYJOB JOB(T.DATA.KEEP) CLONE=TEST.PAYROLL.SH1).DATA. gives the OUTFILE dataset the same attributes as the INFILE dataset in STEP01? A) B) C) D) E) // // // // // DUP=TEST.DISP=SHR Referring to the above coding.DISP=SHR //SYSOUT SYSOUT=A //STEP02 EXEC PGM=PGM02 //INFILE DD DSN=TEST.DATA.DATA.PERSONEL.PAYROLL.DISP=SHR //SYSOUT SYSOUT=A //STEP03 EXEC PGM=PGM03 //OUTFILE DD DSN=TEST.DATA.18.DATA.'FRANK SMITH'.U202.DISP=(NEW.DATA.PAYROLL.DATA.BENEFITS. which line.KEEP) SAME=TEST.DISP=(NEW.KEEP) COPY=TEST.PAYROLL.DISP=(NEW.DISP=(NEW. added to STEP03.PAYROLL.CLASS=A //STEP01 EXEC PGM=PGM01 //INFILE DD DSN=TEST.KEEP) .KEEP) LIKE=TEST.

Sign up to vote on this title
UsefulNot useful