Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

What is the meaning of DISP=OLD and DISP=SHR?

Answer»

DISP=OLD -> This refers to a dataset that has already been created.

DISP=SHR -> It MEANS that more than one user may SHARE DATA. However, it is a read-only file.

2.

What are the hierarchy levels in JCL?

Answer»

Every STATEMENT of JCL consists of the HIERARCHY levels:

  • Identifier field
  • Name field
  • Operation field
  • Parameter field (POSITIONAL, KEYWORD)
  • COMMENT field (if any)

Example:

//STEP1 EXEC PGM=MYPROGRAM,TIME=1440   //* JCL Statement Structure

Here, 

  • // is the identifier of the JCL statement.
  • STEP1 is the name ASSIGNED to the JOB step.
  • EXEC is a keyword used to indicate that it is an EXEC statement.
  • PGM is a positional parameter and specifies the name of the program to be executed
  • TIME is the keyword parameter that specifies the maximum amount of processor time the step can use.
  • //* is the identifier of the comment field and ‘JCL statement structure’ is the comment.
3.

Name different JCL statements that are not permitted in the procedures.

Answer»

The following JCL statements are not PERMITTED in the PROCEDURE

  • JOB, Delimiter(/*), or NULL statements
  • JOBLIB or JOBCAT DD statements
  • DD * or DATA statements
  • Any JES2 or JES3 control statements
4.

How can we convert a FB (Fixed block) file to VB (Variable block) file using a sort program?

Answer»

By using the FTOV option in SORT, you can convert a FB file to a VB file. Input RECORDS of fixed LENGTH are converted to output records of VARIABLE length using this parameter. VB files should have 4 extra bytes for RDW (Record Descriptor Word). Accordingly, the length of the record in the VB file is the RDW (4 bytes) + the actual length of the record. 

EXAMPLE: 

SORT parameters: SORT FIELDS=COPY                 OUTFIL FNAMES=SORTOUT1,FTOV

Here, SORTOUT1 is the VB output file. 

If you input an 80-byte FB file, then the output will be an 84-byte VB file (4 bytes for RDW). 

5.

Explain Msglevel parameter and its significance.

Answer»

With the Msglevel parameter, you can control or set the listing of the JOB output for each specific job. It controls the way ALLOCATION messages, and termination messages will appear in job output (SYSOUT). Msglevel can be used to inform JCL about the messages we wish to print.

Syntax: 

MSGLEVEL=([STATEMENTS][messages])

Here, 

  • Statements can be numbered 0, 1, or 2. (0 to print Job-related statements, 1 to print all JCL statements along with procedures, and 2 to print only input JCL statements)
  • Messages can be numbered 0 or 1. (0 to not show any message except RETURN code i.e., allocation and termination, and 1 to show all messages, i.e., whether it is an allocation or termination, all details will be visible in the spool).
6.

What is the time parameter in JCL? Explain what does TIME=1440 mean?

Answer»

JCL TIME is an optional Keyword parameter that SPECIFIES how long a job MAY use the processor. In simple words, TIME specifies the max CPU usage time that can be used for the job's execution. It is possible to code the TIME parameter at the Job and Step levels as well. Once the specified execution time is reached, the system will stop the JOB execution automatically. Thus, the TIME parameter will inform OS of the maximum CPU utilization time, and once the specified time has been consumed by the job, OS will cancel the job automatically.  

Additional options for TIME Parameter  

  • TIME=1440

It indicates that the job or step has no time limit and can be executed indefinitely.  

  • TIME=MAXIMUM

This means the job or step can use the most CPU time possible. 

7.

What is a temporary dataset in JCL? How to create a temporary dataset?

Answer»

Temporary datasets are datasets (FILE holding one or more records) that are only needed for the DURATION of the job and are deleted when the job is completed. They need storage only for the job duration and once the job is completed, they are deleted. These datasets typically are represented as DSN=&&name or simply without specifying a DSN. By using them, we can FORWARD the output of one step to another step in the same job. 

8.

What are symbolic parameters and why is it required?

Answer»

In general, any parameter that varies with every execution of a program should be considered a symbolic parameter. By using symbolic parameters, the procedure becomes more flexible. The procedure will not have to be altered each and every time a small and recurring change is made at a particular place. 

In symbolic parameters, an ampersand (&) PRECEDES the STRING of 1 to 7 alphameric characters. It is mandatory to put an alphabetic character after &. JCL statements do not permit symbolic parameters to appear in the name or operation fields; they may only appear in the operand field. On a PROC or EXEC statement, if more than ONE symbolic parameter is ASSIGNED, only the first is used. 

9.

Explain what you mean by Generation data group (GDG).

Answer»

Generation Data Group (GDG) is an important concept in JCL. GDG consists of groups of RELATED data sets arranged chronologically. Each of these related sets shares a unique name. A generation number and a version number are added to the end of the name of each data set within a group to make it unique. 

Syntax:

ABC.PQR.XYZ.GnnnnVmm

Here, the GDG BASE is ABC.PRQ.XYZ. 

G represents the Generation number (Value range 0000 – 9999), and V represents the Version number (Value range 00 – 99). 

Example:  

MYLIB.URMI.SAMPLE.G0001V00MYLIB.URMI.SAMPLE.G0002V00, and so on.

Here, the GDG base is MYLIB.URMI.SAMPLE. 

10.

State difference between JOBLIB and the STEPLIB statements.

Answer»

The mainframe OS has to search for and locate the program you specify in a JCL statement in order to run it. In order to locate programs, a private library must be SEARCHED before the system program library. If you wish to run a program residing in a private program library, you must either specify the JOBLIB DD (Data definition) statement or the STEPLIB DD (Data Definition) statement to enable OS to locate the program successfully. Both JOBLIB and STEPLIB are DD (Data definition) STATEMENTS. Although JOBLIB DD and STEPLIB DD specify a private library as the location of a SPECIFIED program, each will behave differently for OS search.  

1. JOBLIB Statement: Every step of the JOB is searched in the private libraries according to JOBLIB DD. The location of the program to be executed in JCL is referenced by it. This statement follows the JOB statement, but before the EXEC statement. It is only applicable to procedures and programs running in-stream.

Syntax: 

//JOBLIB DD DSN=dsnname

Here, 

  • The keyword JOBLIB specifies the JOBLIB statement.
  • DD specifies the Data definition statement.
  • DSN specifies the location of the program/job to be executed.

2. STEPLIB statement: The only single step of the JOB is searched in the private libraries according to STEPLIB. The location of the program to be executed within a Job Step is referenced by it. This statement follows the EXEC statement, but before the DD statement of the job step.

Syntax:

//STEPLIB DD DSN=dsnname

Here, 

  • The keyword STEPLIB specifies the STEPLIB statement.
  • DD specifies the Data definition statement.
  • DSN specifies the location of the step to be executed.
11.

Explain some of the commonly used parameters in the EXEC statement.

Answer»

EXEC stands for EXECUTION. The EXEC statement specifies a program/job step, as well as utilities and procedures to be executed.

Syntax: 

//Step-name EXEC Positional-param, Keyword-param

Some of the COMMONLY used positional and keyword parameters in EXEC statement INCLUDE

  • PGM: It specifies the name of the program that will be executed in the job step.
  • PROC: It specifies the name of the PROCEDURE that will be executed in the job step.
  • ACCT: It specifies the accounting details of the job step.
  • ADDRSPC: For job steps, it specifies whether REAL or virtual storage is needed for execution.
  • COND: It specifies conditions for executing subsequent job steps if the previous job step fails abnormally.
  • PARM: It provides parameterized data to the job steps.
  • REGION: It specifies how much space or region size should be allocated for a specific job/job step.
  • TIME: It describes the time limit of a job or job step.
12.

What are different parameters for DD (Data Definition) statement?

Answer»

Some of the parameters for the DD statement are listed below. BASED on your needs, you can select one or more parameters separated by commas. 

1. DSN Parameter: It is used to specify the name of a newly created or existing dataset. There can be a total of 44 characters in the DSN value. The sub-names can be 1 to 8 characters in length, separated by periods.

Syntax:  

DSN=Physical Dataset Name

Here, 

  • The keyword DSN specifies DSN parameter.
  • Physical dataset name refers to the name of the newly created or existing dataset.

2. DISP Parameter: "DISP" stands for Disposition, a keyword parameter used in JCL to describe a data set's status to OS. Essentially, it indicates how the OS should handle the dataset after JOB/STEP termination. It contains three sub-parameters: status, normal and abnormal termination activities of the JOB.

Syntax: 

DISP=({status},{normal Disposition},{abnormal Disposition})

Here, 

  • The keyword DISP specifies the Disposition parameter.
  • Status can be NEW (specifies that the dataset is new), OLD (specifies that the dataset exists when the step begins.), MOD (EXTENDS the dataset if the dataset already exists or creates a new one if it is not existing.), or SHR (specifies that the dataset can be shared (read access) with other jobs).
  • The normal disposition specifies what is to be done with a dataset after a normal termination. It takes one of the values CATLG, UNCATLG, PASS, KEEP, or DELETE.
  • The abnoram disposition specifies what is to be done with a dataset after a normal termination. It takes one of the values CATLG, UNCATLG, KEEP, DELETE.

3. DCB Parameter: DCB (Data control block) parameter provides information about the physical characteristics of a dataset. For newly created datasets, this parameter is required.

Syntax: 

DCB=<List of parameters>

Here,

  • The keyword DCB specifies the data control block parameter.
  • List of parameters can be RECFM (specifies record format of the dataset), LRECL (defines the length of logical records), BLKSIZE (defines the size of a block of record), DSORG (specifies the organization of the data set as physical SEQUENTIAL (PS), partitioned (PO), or direct (DA)).

4. SPACE Parameter: The SPACE parameter indicates how much space is required to store a dataset on a Direct Access Storage Disk.

Syntax: 

SPACE=(Unit of Space,(Primary,Secondary,Directory),RLSE,CONTIG,ROUND)

Here,

  • The keyword DCB specifies the data control block parameter.
  • The unit of space is SPECIFIED in Tracks (TRK), Cylinders (CYL), block length (BLKLGTH), record length (RECLGTH).
  • Primary specifies the amount of primary space required in terms of the space unit (tracks/cylinders/number of data blocks)
  • Secondary specifies the secondary quantity of units if the primary is exceeded but ALLOCATED only when the dataset expands.
  • The directory specifies the number of directory blocks to be allocated.
  • RLSE specifies releasing the unused space requested.
  • CONTIG specifies to allocate contiguous primary space.
  • ROUND specifies allocation by block length rounded to integral cylinders.

5. SYSOUT Parameter: We have discussed so far the parameters of DD statements that correspond to data stored in datasets. According to the class specified, SYSOUT directs the data to the output device.

Syntax: 

SYSOUT=class
13.

State the difference between positional parameter and keyword parameter in JCL.

Answer»
  • Positional Parameters: Positional parameters are those that FOLLOW a fixed position in terms of the order in a statement JCL. Their order in the JCL statement is ALWAYS fixed therefore they should be specified in the specified order. Changing the position of the positional parameters will RESULT in an error in the JCL.  
    Examples: ACCT (ACCOUNTING Information), PGM (Programmer Name), etc. 
  • Keyword Parameters: There is no need for a fixed position for these parameters. It doesn't matter in what order you code the keyword parameters; you won't get any errors.  
    Examples: TIME, REGION, MSGLEVEL, CLASS, etc. 
14.

Explain different types of Job control statements or JCL statements.

Answer»

For each job that you submit, you need to specify where the input should be found, how it should be processed, and what should be done with the output. The INFORMATION is conveyed to MVS (Multiple Virtual Storage) through a set of statements called job control statements in JCL. MVS can glean a great deal of information from JCL's extensive set of job control statements. A very small set of these control statements can, however, be used to run most jobs. In time, you may discover that you only need to know the DETAILS of a few of the control statements as you become familiar with the jobs you TYPICALLY run. 

Types of Job Control Statements

 Job control statements can be classified into the following three types:  

  • JOB Statement: It is the first of three control statements in JCL, which tells the mainframe OS (Operating System) about the job identity. Besides Job name and accounting data, there are other parameters in the JOB statement such as class, msgclass, and msglevel. These parameters facilitate the OS in allocating the appropriate scheduler. Also, it is useful for monitoring CPU utilization and sending notifications to the user.

Syntax:  

//Job-name JOB Positional-param, Keyword-param

Here, 

  • Job-name specifies a name for the job and APPEARS after "//". It can have a length of 1-8 alphanumeric characters.
  • The keyword 'JOB' identifies it as a JOB statement.
  • Positional-param means positional parameters and keyword-param means keyword parameter.

Example:

//JOB011 JOB (456),'INTERVIEWBIT', //  CLASS=A
  • EXEC Statement: It stands for EXECUTION. The EXEC statement specifies a program/job-step, as well as utilities and procedures to be executed. There can be 255 steps in a JCL, which means it can have 255 'EXEC' statements.

Syntax: 

//Step-name EXEC Positional-param, Keyword-param

Here, 

  • Step-name specifies a name for the job step and appears just after “//”.
  • The keyword 'EXEC' identifies it as an EXECUTION statement.
  • Positional-param means positional parameters and keyword-param means keyword parameter.

Example:

//STEP01 EXEC PGM=INTERVIEWBIT
  • DD Statement: DD stands for Data Definition and helps in SPECIFYING the data sets used by a program or procedure. For each job step, the required input and output resources must be described in a DD statement. DD statements are required for every data set used or created in a job step. Up to 3273 DD statements are allowed in a step.

Syntax: 

//DD-name DD Parameters 

Here, 

  • DD-name specifies a name for DD-statement and appears just after “//”.
  • The keyword 'DD' identifies it as a DD statement.
  • Parameters represent different types of parameters for DD statements.

Example:

//STEPLIB DD  DSN=hlq.xxxxxxxx.CDBALOAD,DISP=SHR
15.

What are the benefits of using JCL?

Answer»

JCL offers the following advantages:  

  • You can delete and create lots of data sets, VSAM (Virtual Storage Access Method) Clusters, and GDGs (Generation Data Groups) using JCL.
  • Comparing files with different PDS (Partitioned Data Set) members can be done with it.
  • Using it, you can merge and sort various data files.
  • Moreover, it is capable of executing and COMPILING batch-based programs (scheduled programs that are assigned through JCL to run on a computer WITHOUT further user interaction) too.
  • JCL is easy to modify and therefore it is easy for beginners to learn.
  • In addition, it PROVIDES a number of utilities such as IEDCOPY, IDCAMS, etc., which help in executing tasks in an easier and more convenient manner.