Introduction
The MVS (Multiple Virtual Storage) Job Control Language (JCL) is a scripting and command language used to specify jobs (units of work) to the IBM mainframe operating system. JCL thus bridges your application program or jobs (such as COBOL, PL/1, etc.) and the mainframe OS (such as MVS, Z/OS). It mainly comprises task control statements (JOB, EXEC, and DD instructions), which instruct the OS on what must be done for a job/application program to function.
In a mainframe environment, programs can run in batch or online mode. JCL can be used to run a program in batch mode, which is the automatic execution of several programs or tasks on a computer.
Some JCL Interview Questions are important and must be done before an interview. So let us go through some of the top JCL Interview Questions.
JCL Interview Questions For Freshers
Here are most asked JCL Interview Questions for freshers.
1. What is JCL (Job Control Language)?
JCL or Job Control Language, this language controls jobs. On the IBM mainframe operating system, a scripting language called JCL is used to give instructions to the system for a batch process. It is a collection of instructions you program to inform the operating system of the action you wish to take. Occasionally, this set of statements is rather vast, but most jobs can be completed with just a tiny portion of them.
JCL instructions inform OS where to look for the necessary input, how to handle it, and what to do with the processed input's output.
2. Does JCL support automatic restart?
By using a specified keyword parameter, it is possible to have an automatic restart in JCL. One of those keywords used to restart is the RDkeyword. In most cases, it is successful in causing the program to end unexpectedly. We must weigh the significance of checkpoints, which specify the task execution at various places in the program in question, against the location of the automated restart.
3. Explain the JOB statement in JCL?
The Operating System (OS) in the spool and the scheduler receive the job identifier from the JOB statement. It is the JCL's opening control statement. The JOB statement's available parameters aid the OS in choosing the appropriate scheduler. It is helpful for alerting the user and determining how much CPU time is needed.
SYNTAX - //Job-name JOB Positional-param, Keyword-param
4. What are the benefits of using JCL?
JCL has many advantages, including the ability to merge and sort diverse data files, delete and create numerous data sets, use VSAM (Virtual Storage Access Method) Clusters and GDGs, and compare files with varied PDS (Partitioned Data Set) members.
5. Explain different types of Job control statements or JCL statements.
There are 3 JCL statements. A job specifies a certain workload that z/OS will handle. EXEC gives the name of an application program or JCL procedure that the system intends to execute. In the EXEC statement, DD specifies the program's or procedure's input and output.
6. State the difference between positional parameter and keyword parameter in JCL.
Position parameters in a program have a defined order; if you wish to skip a particular parameter, you must write a comma. It always adheres to JCL's job description. In contrast to positional parameters, keyword parameters can be entered in any sequence.
7. Explain some of the commonly used parameters in the EXEC statement.
The EXEC statement may also include roughly a dozen keyword parameters in addition to the two positional parameters. The system's intended program is identified by the PGM parameter. The system will execute the catalogued or in-stream procedure specified by the PROC parameter or procedure name.
8. What is a temporary dataset in JCL? How to create a temporary dataset?
Data sets that are created and deleted in the same task are considered transitory data sets. Temporary datasets are dynamically allocated on disc by default. Dynamically allocated datasets may hold up to 3.1 MB of data and don't require DD statements in the JCL.
9. What are the symbolic parameters and why is it required?
In general, a parameter should be regarded as symbolic if it changes with each program execution. The process is made more adaptable by employing symbolic parameters. The process won't need to be changed every time a modest, frequent change is made elsewhere. The string of 1 to 7 alphanumeric characters is preceded by an ampersand (&) in symbolic parameters. You must follow & with an alphabetic character. JCL statements only allow symbolic parameters to appear in the operand field; they do not allow them to appear in the name or operation fields. If more than one symbolic argument is assigned to a PROC or EXEC statement, only the first is used.
10. Explain the JCL EXEC statement?
Numerous job steps can be included in a JCL, and a job step can either invoke a procedure or directly execute a program. JCL can therefore run one or more programs (job steps). The EXEC statement is the one that carries the job step program information. The EXEC statement's goal is to supply the necessary data. The software that runs during the job phase receives this information.
SYNTAX - //Step-name EXEC Positional-param, Keyword-param
11. Explain the DD statement in JCL?
The records are contained in datasets, which are mainframe files structured in a particular way. These files serve as fundamental data storage areas and are kept on the mainframe's Direct Access Storage Device (DASD) or Tapes. If a batch application is needed to manipulate these data, the physical dataset name and file format are coded in a JCL.
The dataset definition used in JCL can be found in the DD statement's help. A DD statement must specify the input and output resources needed for a work phase. These resources must be described in detail, including the dataset organization, the amount of storage required, and the record length.
12. What are different parameters for DD (Data Definition) statement?
The following are some of the key parameters for DD statement:-
- DDNAME: Specifies a symbolic name for the data set, allowing the program to reference it by name rather than by data set name
- DSN (Data Set Name): Specifies the name of the data set, which includes the high-level qualifier (HLQ) and the low-level qualifier (LLQ)
- DISP (Disposition): Specifies how the system should handle the data set after completing the job step
- SPACE: Defines the allocation and space management parameters for the data set, including attributes like primary space, secondary space, and space units
13. Explain the difference between JOBLIB and the STEPLIB statements.
In Job Control Language or JCL, JOBLIB specifies a library of programs or procedures that are available for all the steps within a job. STEPLIB specifies a library of programs or procedures that are specifically available to a particular job step.
14. How can a JCL's syntax be checked without running it?
By entering TYPERUN=SCAN on the JOB card or using JSCAN, we can examine the syntax of JCL without running it.
15. Why include statement is used in a JCL?
It serves as a substitute for STEPLIB. All the datasets defined in the included dataset will be searched when the dataset name is specified in the include statement.