Top JCL Interview Questions (2021) - InterviewBit

### Before you go!

Take this "JCL Interview Questions" interview guide with you

## Welcome to Interviewbit, help us create the best experience for you!

Currently, You are a:

College/University *
Enter the name of your college
Branch *
Year of completion *

College/University *
Enter the name of your college
Branch *
Year of completion *

Current Company *
Enter company name
Experience *

## You're all set!

Full name *
Email *

By creating an account, I acknowledge that I have read and agree to InterviewBit’s Terms and Privacy Policy .

Email *

# JCL Interview Questions

Full name *
Email *

By creating an account, I acknowledge that I have read and agree to InterviewBit’s Terms and Privacy Policy .

## Welcome back!

Email *

### What is JCL (Job Control Language)?

The most commonly used operating systems on IBM mainframe computers are MVS (Multiple Virtual Storage) and Z/OS. If you want MVS or z/OS to perform work for you, you must describe the tasks you want, and what you need from them. 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. This is where JCL comes in.

Job Control Language (JCL) is a scripting language and command language of MVS (Multiple Virtual Storage) that describes jobs (units of work) to the IBM mainframe operating system. As a result, JCL functions as an interface between your application program or jobs (e.g., COBOL, PL/1, etc.) and the mainframe OS (e.g., MVS, Z/OS). Basically, it consists of job control statements (JOB, EXEC, and DD statements) that tell the OS what needs to be done in order to run a job/application program.

• Giving OS an idea of who you are.
• Telling OS what your time and space needs are.
• Informing OS what data sets the programs to require.

In a mainframe environment, programs can be executed either in batch or online mode, and JCL can be used if you want to run a program in batch mode i.e., execution of a series of programs or jobs on a computer without manual intervention.

Crack your next tech interview with confidence!
Take a free mock interview, get instant⚡️ feedback and recommendation💡

## JCL Interview Questions for Freshers

### 1. What are the benefits of using JCL?

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

### 2. Explain different types of Job control statements or JCL statements.

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

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

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

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

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 

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

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.

### 6. State difference between JOBLIB and the STEPLIB statements.

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.

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

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.G0001V00
MYLIB.URMI.SAMPLE.G0002V00, and so on.

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

### 8. What are symbolic parameters and why is it required?

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. What is a temporary dataset in JCL? How to create a temporary dataset?

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.

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

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.

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

### 11. Explain Msglevel parameter and its significance.

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

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

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

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

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

### 14. What are the hierarchy levels in JCL?

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.

### 15. What is the meaning of DISP=OLD and DISP=SHR?

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.

## JCL Interview Questions for Experienced

### 16. What is the significance of using the "//" symbol in JCL?

It is an important symbol used in JCL statements since every JCL statement must begin with it. JCL statements must satisfy this rule in order to execute properly. Otherwise, the JCL statement will fail. During JCL execution, the system checks for the symbol (//) at the beginning of each statement. This prevents runtime exceptions.

Example:

//STEP010 EXEC PGM=MYCOBOL,PARAM=CUST1000

Here,

• // is the identifier of the JCL statement.
• STEP010 is the name assigned to the job step.
• PGM specifies program name.
• PARAM passes input data to the program.

### 17. What do you mean by Condition checking in JCL?

Yes, condition checking is possible in JCL, both at the job level and at the step level. Obviously, this is done using the COND keyword along with a return code and operand that are defined in JCL. The concept of conditional checking is similar to the concept of (if else) in many programming languages (such as C, C++, Java, etc.).

Syntax:

COND=(RC,OP)
COND=(RC,OP,STEPNAME)
COND=EVEN
COND=ONLY 

Here, RC stands for Return code, OP for Operator, and STEPNAME for Step name.

RC can be assigned any value from 0 to 4095, but in most cases, it will be assigned a value from 0 to 16 as follows:

0 (Successful execution of a program i.e., Normal execution).

4 (Successful execution of a program with some warning).

8 (Error)

12 (Severe Error)

16 (Fatal Error)

‘OP’ can be any one of the following:

EQ (Equal to)

NE (Not Equal to)

LT (Less than)

LE (Less than or Equal to)

GT (Greater than)

GE (Greater than or Equal to)

### 18. What happens when COND is coded in JOB statement and EXEC statement?

In JCL, a COND parameter can be incorporated into the JOB statement or EXEC statement. This parameter can be used to skip steps based on return codes from previous steps. Here, we are testing the return code from the previous job steps. In the event that the test is deemed to be true, the current job step execution is bypassed. Bypassing a job step is not an abnormal termination, but simply an omission.

• COND is coded in JOB statement: Every step of the job is tested when COND is coded into a JOB statement. At any given job step, if the condition is true, it is bypassed along with the subsequent steps.
• COND is coded in EXEC statement: In case COND is coded in the EXEC statement of a job step and finds to be true, only that job step will be skipped, and execution will continue from the next job step.

Example:

//MATEKSD JOB MSGLEVEL=(1,1),NOTIFY=&SYSUID, COND=(0,NE)
//STEP01   EXEC PGM=CONDPGM1
//STEP02   EXEC PGM=CONDPGM2,COND=(0,EQ)
//STEP03   EXEC PGM=CONDPGM3,COND=(4,EQ)

Explanation of COND=(0 NE)

As you can see, the COND parameter is set to (0,NE) at the JOB level. In particular, it will check if the return code 0 does not equal the return code of any of the steps in JCL? If this is true, then the job should be terminated. As a result, if any of the steps (such as STEP01, STEP02, or STEP03) returns a non-zero return code, this condition will be true and the job will be terminated.

### 19. What do you mean by “Cond=even” and “Cond=only”?

CODE-EVEN: By coding COND=EVEN, the current job step is executed regardless of whether the previous steps have terminated abnormally. In the case of other RC conditions  (return code conditions) being coded alongside COND=EVEN, the job step will execute if none of the RC conditions is true.

CODE-ONLY: By coding COND=ONLY, the current job step will only be executed when one of the previous steps terminates abnormally. In the case of other RC conditions being coded alongside COND=ONLY, the job step will execute when none of the RC conditions is true and any previous job steps are abnormally failed.

### 20. Explain utilities in JCL.

JCL utilities are pre-written programs that are widely used by system programmers and application developers to meet day-to-day requirements, organize and maintain data. Reorganizing, modifying, or comparing data at the record or data set level is done with them. Here are a few of them, along with their functionality:

• IDCAMS: Although IDCAMS provides other functions, it is primarily used for defining and managing VSAM data sets and integrated catalog facilities catalogs.
• IEBCOPY: This program copies one or more members of an existing dataset onto a new or existing PDS dataset. It also compresses PDS, loads PDS to TAPE, and unloads from TAPE onto DISK.
• IEBGENER: Often used for copying or printing sequential data sets, it is also a tool for copying TAPE files to DISK and vice versa.
• IEBUPDTE: This utility can create new members within a partitioned data set, or update records within an existing member. This is mostly used to create or maintain assembler macro libraries and JCL procedure libraries.
• IEHMOVE: It is typically used to move datasets between volumes.

### 21. Explain the usage of coding class parameters in JCL.

In JCL, the CLASS is a keyword parameter that is used to classify the jobs that run in a particular OS installation. CLASS informs the operating system about the nature of the job that is being submitted. It prevents contention between jobs that use the same resource. A parameter like this aids in balancing the load of all the jobs running in an environment. It can also be used to prioritize the execution of jobs.

Syntax:

CLASS= JOB-CLASS 

Below are the possible values for the JOB-CLASS:

• Any character from A to Z
• Any number from 0 to 9

Example:

//JCL1234 JOB ‘max021’,’Ashish’CLASS=A

### 22. What do you mean by PROC? State difference between an instream and a catalogued Proc.

PROC represents Procedure. A JCL Procedure is a collection of statements within a JCL that perform a particular function. The JCL Procedures work the same way as language compilers and linkage editors across multiple JCL's. The EXEC statement may be used directly to code the procedure instead of the PROC keyword.

Syntax:

//Step-name EXEC PROC=Procedurename
Or
//Step-name EXEC Procedurename

Here,

• Step-name specifies the assigned name to step.
• EXEC specifies the type of JCL statement.
• PROC specifies Procedure name.

Example 1:

//STEP05  EXEC PROC=MTHPROC
Or
//STEP05  EXEC MTHPROC

Use of PROC

• It eliminates repetitive coding.
• Code errors are eliminated.
• Eliminates redundancy.

Types of procedures

• In-Stream Procedures: In-stream procedures are those written within the same JCL. Ideally, it should begin with a PROC statement and end with a PEND statement.
• Cataloged Procedures: A cataloged procedure is one that is separated from the JCL and coded in a different data store.

### 23. Can you code instream data in PROC.

No, it is not possible to use instream data inside a PROC. This is a rule. It is usually better to code a few dummy statements inside the PROC and override the DD statements from the JCL before executing it.

### 24. What do you mean by abends in JCL? Write different JCL abend codes.

Using the SUBMIT command, the operating system will be informed about the work to be done in JCL. An abend occurs when a program terminates abnormally during a step. Some of the JCL Abend codes are listed below:

• S0C4: Storage violation error due to a subscript that is out of range.
• S0C5: This is caused by an invalid address specification, i.e., the address points to a control word, instruction, or data that cannot be cached.
• S0C7: Bad data causes this error, known as a Data Exception. Whenever we're converting an alphanumeric field to a numeric computational field, we encounter this problem.
• S222: This error occurs when the operator cancels a job because the program requests an unavailable resource.
• S237: This error occurs when the end of the volume is reached.
• S322: This error occurs when CPU time allocated to a job, job step, or procedure has exceeded the limit, i.e., Timeout error.
• S522: This error occurs if the waiting state exceeds the installation-defined time limit.
• SB37: This error occurs when there is insufficient disk space (End of volume with no further volume specified).
• SD37: This error occurs when there is insufficient disk space (the secondary allocation has not been specified).
• SE37: This error occurs when there is insufficient disk space (max. 16 extents are currently allocated).

### 25. Explain NOTCAT 2- GS.

Basically, NOTCAT 2-GS is an MVS (Multiple Virtual Storage) message indicating the existence of duplicate catalog data. This would happen, for instance, if we already had a dataset with DSN = 'xxxx.yyyy' and wanted to create a new one with disp new, catlg. In this case, we can correct the situation by deleting the first data set and cataloguing the new data set on the volume where it resides.

### 26. What is the usage of the Include statement in JCL?

INCLUDE statements can be used to identify and include a set of JCL statements coded within a member of a PDS (Partitioned data set) into a JCL stream. For example, some of the common files used in many JCLs can be coded as DD statements within an INCLUDE member and used within the JCL.

Syntax:

//name INCLUDE MEMBER=member-name      

An INCLUDE statement cannot contain a dummy DD statement, a data card specification, or JOB, PROC statements. Within an INCLUDE member, an INCLUDE statement may be coded, and nesting may go up to 15 levels.

### 27. What are different ways in which data can be passed to a COBOL program from JCL?

The following methods can be used to pass data from JCL to COBOL:

• SYSIN DD statement: Data can either be provided directly in SYSIN or as a file. If we want to read that in COBOL, we use the ACCEPT keystroke.
• PARM parameter: On the JCL EXEC statement, we use PARM='Parameter value' to pass input from JCL to the program. In COBOL, this can be done in the Linkage section.

### 28. Explain DISP=(NEW,PASS,DELETE)?

We use DISP=(NEW, PASS, DELETE) to create temporary data sets. DISP NEW allocates space and creates a new data set. Once the current step has been successfully completed, DISP PASS passes the data set to the next step. Once the step abends, DISP DELETE removes the available data set so that only non-abended data sets remain.

## JCL Scenario Based Interview Questions

### 29. Explain how you will check the syntax of JCL without running it.

JCL syntax can be checked without running it by putting TYPERUN=SCAN on a job card or using JSCAN. The TYPRUN command is used to request special job processing, such as checking or scanning a job for syntax errors. SCAN checks the syntax errors without actually executing the job. Otherwise, JSCAN can also check a JCL's syntax without running it.

### 30. Does JCL support Automatic start? If yes, then explain how.

It is possible to restart JCL automatically through a predefined keyword parameter, such as RD (Restart definition) keyword. However, this usually results in irregular program termination. RD ("restart definition") triggers the start of the job at the checkpoint automatically. At various points of the job, checkpoints act as markers for the execution of the job. RD begins by looking for the last successful checkpoint and starts from there.

### 31. How do you explain the term job time-out and what can you do to overcome it?

When a program takes longer than the specified time limit for the particular selected class, a job timeout occurs. It is usually referred to as an "S322 abend." In this situation, the program does not complete due to circling errors.

The TIME parameter can be coded as TIME = 1440 if the information being handled in the program is really huge and needs more time to complete the job.

### 32. What does DISP=(NEW,CATLG,KEEP) mean?

DISP NEW creates a new dataset and allocates new memory. DISP CATLG is capable of cataloging the data set when the step is complete. DISP DELETE deletes the dataset if the step abends/fails.

### 33. What does DISP=(NEW,CATLG,KEEP) for a DSN mean?

DISP NEW creates a new dataset and allocates new memory. DISP CATLG is capable of cataloging the data set when the step is complete. A cataloged dataset can be referenced by name without the user having to specify where it is located. DISP KEEP retains the dataset. If the step abends, the catalog is not retained. The three operations are reliable and ensure the data set is handled correctly every time.

### 34. If you have seven jobs to do, but you want to hold one at the same time, how can I accomplish this?

Holding a job among the available ones is just a matter of following a set of predefined rules. As per JCL's predefined job rules, each job has a keyword. If TYPRUN is specified on the job statement, a job can be held for later execution. The TYPRUN holds a job with its variable name set to HOLD.

Syntax:

TYPRUN=HOLD     

Example: If you want to hold the job you want

 //JTP JOB (P007),'Aayush' TYPRUN=HOLD 

### 35. What is the best way to check if a file is empty in JCL?

JCL allows you to identify one empty file, but you need to make sure that it is an input for IDCAMS. IDCAMS (Integrated Data Cluster Access Method Services) is a utility used for creating, modifying and deleting VSAM (Virtual Storage Access Method) datasets. When the file is input into IDCAMS, an error is thrown (return code 4 i.e., RC=4) if it's empty.

### Conclusion

Getting your feet wet with the JCL Interview Questions is necessary if you are looking for a job related to JCL. In preparation for your interview, our team has compiled a list of relevant JCL interview questions and answers. These JCL Interview Questions are intended to help you become acquainted with the type of questions that might be asked during an interview. This will come in handy for future projects and interviews.

As an additional piece of advice, review past assignments you have done on the topic so that you are confident in your ability to speak about them. The interviewer expects you to answer basic questions if you are fresher, so you'll need to strengthen your basic concepts. Try to stay confident throughout the interview.

## JCL MCQ

1.

Which of the following is not a valid operation code in JCL?

2.

JCL stands for__.

3.

What is the purpose of the DSN parameter in DD statements?

4.

In a DD statement, which types of parameters are there?

5.

What is the statement that marks the end of an Instream or Catalogue procedure?

6.

What is the optimal way to test return codes before executing job steps?

7.

To limit the CPU time consumed by the job, what parameter is used in the job statement?

8.

In JCL, what is the purpose of the JOB statement?

9.

If condition checking in JCL is possible, where?

10.

Which of the following is the correct syntax for a JCL JOB statement?

11.

Which of the following JCL statements cannot be used in procedures?

12.

JCL uses the ___________ statement to identify the location of the program to be executed.