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

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

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

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

column, The first character must be an alphabet.

field identifies the statement. It should be of a maximum of 8 characters long, should start from 3rd

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

JCL Statements JOB Jobname, (ACCTNUM, ACCTNAME) (positional parms),'Name' (positional parm), CLASS= , PRTY= ,

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

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

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 and followed by JCL statements that constitute the procedure.

statement) or SYS1.PROCLIB system library. It begins with PROC

)

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

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.

Generation Data Group

Generation Data Group Generation Data Group is a group of datasets that are logically or chronologically

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

EMPTY|NOEMPTY Specifies what action is to be taken when the maximum number of GDSs for

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 )

-

/*

What is a Utility?

What is a Utility? • A UTILITY program performs a basic function, i.e., it does a

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

control of the utility. The three classes are: the system utilities, the data set utilities, and the

utilities.

the function performed and the type of

independent

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

Job Control Statements

Job Control Statements //JOB CARD //STEPNAME EXEC PGM=SORT //STEPLIB DD Defines the library containing the DFSORT

//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

The following are the data format codes that can be specified. DATA FORMAT CODE EBCDIC

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 SORT FIELDS=(110,5,CH,A)

Example 2

71

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

//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)

/*

UNIT=3380,SPACE=(TRK,(1,1))

Tailoring the Input file . • Input file can be tailored by either Specifying an

Tailoring the Input file.

Input file can be tailored by either Specifying an INCLUDE control statement for the records to be included Specifying an OMIT control statement for the records to be omitted

OR

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)

------------------------------------------------------

Reformatting

Reformatting records with OUTREC

Reformatting Reformatting records with OUTREC After records are sorted they can be reformatted by using 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,

//

// UNIT=DISK,VOL=SER=TRG001, // DCB=(RECFM=FB,LRECL=79,BLKSIZE=790), // SPACE=(TRK,(5,2,),RLSE)

DISP=(NEW CATLG,DELETE),

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,

statement has to be given - OUTREC FIELDS=(20X,1,75,4Z,162,4) and the LRECL on the SORTOUT DD statement should be 103

the following control

Reformatting records with INREC

Reformatting records with INREC The INREC control statement allows to reformat the input records before they

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

OUTREC
OUTREC

IEBGENER

You can use IEBGENER to:

IEBGENER You can use IEBGENER to: • Create a backup of a sequential data set or

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

//SYSPRINT DD

EXEC PGM=IEBGENER

Defines a sequential data set for messages (System output device / Tape volume / DASD volume)

//SYSUT1

DD

Defines the INPUT data set

//SYSUT2

DD

Defines the OUTPUT data set

//SYSIN

DD

Defines the CONTROL data set

(Sequential data set / Member of a PDS)

(Sequential data set / PDS / Member of a PDS)

(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,

//

//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

//SYSIN DD DUMMY

LABEL=(,SL)

SYSOUT=A

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)

MAXNAME=N Specifies a number, from 1 to 3276, that is no less than the total

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.

Example 2

Example 2 Create a partitioned dataset (consisting of three members, their names being MEMBER1 MEMBER2, MEMBER3)

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

//SYSUT1 DD DSN=INSET,DISP=OLD //SYSUT2 DD DSN=NEWSET,UNIT=DISK, // DISP=(NEW CATLG,DELETE),

SYSOUT=A

//

VOL=SER=TRG001,

//

SPACE=(TRK,(10,5,5)),

// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800) *

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

/*

//SYSIN

DD

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

/*

 
 

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

 

IEBCOPY

You can use IEBCOPY to

IEBCOPY You can use IEBCOPY to • Create a backup of a partitioned data set •

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

//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

EXEC PGM=IEBCOPY

Example 1

Example 1 To copy members from three partitioned data sets (DATASET1, DATASET2, DATASET3) to an existing

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

/*

Example 3

INDD=((INOUT6,R))

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))

/*

Example 5

Example 5 Suppose in EXAMPLE 4 the members C and D are renamed J and K

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,

/*

Example 8

INDD=DATASET1

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)

IEWL

Fundamentals

IEWL Fundamentals Modular programming : Aims to split a problem into small, manageable units of work

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.

• Creating multiple copies of a load module. • Providing special processing and diagnostic output

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.

SYSLIN DD statement It is the linkage editor SYSIN card. It describes the primary input

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

// 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

/*

EXEC PGM=IEWL,

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.

3 Example on defining aliases

3 Example on defining aliases //SYSLMOD DD DSN=TRG1T.MYDSN,DISP=OLD,UNIT=DISK //SYSLIN DD

//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.

Question and Answers

Question and Answers 1. What is JCL? JCL is Job Control Language and is used for

1. What is JCL? JCL is Job Control Language and is used for Batch processing.
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).
6. What is a DD statement?   Data Definition   7. What is the DD

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.

 

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

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.

 

24. What will happen if you attempt to restart a job in the middle of

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 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.

 

34. How do you submit JCL via a COBOL program? For the above question the

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' And close this file. Then TESTJOB will be submitted.

TO JCL-REC.

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

 
 

40. What do you mean by INCLUDE statement in JCL? An INCLUDE statement identifies a

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

 

51. What do you do if you do not want to keep all the space

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.

 

58. How to create GDG?   To create a GDG we create a GDG index

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

 

cataloged. The model DSCB name is placed on the DCB parameter on the DD statement

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

 

79. How many levels of nesting is allowed in PROCs? 15 80. The maximum number

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.

 

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

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

 

98. What are the maximum and minimum sizes of any CONTROL AREA (VSAM datasets) ?

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.

 
 

107. How do you code Cobol to access a parameter that has been defined in

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

 

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

allowed subscript S0CB might be due to 1.Division by Zero 112. What is 'S0C7' abend? S0C7

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

 

118. How many extents are possible for a sequential file ? For a VSAM file?

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.

 

127. Why do you want to specify the REGION parameter in a JCL step? To

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.

 

136. How do you run a COBOL batch program from a JCL? How do you

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

 

145. What is the max block-size for a Tape file?   It is 32,760.Based on

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.

 

154. What does the keyword DCB mean and what are some of the keywords associated

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)

 

164. What is a RLSE? RLSE releases all unused space when the data set is

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=…

 

173. How would you limit the time allotted for a JOB to forty-five seconds?  

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.

 
 

184. Can I reformat a record layout before/after sorting? You can change the layout of

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?