Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Table of contents
1.
Introduction
2.
JCL Interview Questions For Freshers
2.1.
1. What is JCL (Job Control Language)?
2.2.
2. Does JCL support automatic restart?
2.3.
3. Explain the JOB statement in JCL?
2.4.
4. What are the benefits of using JCL?
2.5.
5. Explain different types of Job control statements or JCL statements.
2.6.
6. State the difference between positional parameter and keyword parameter in JCL.
2.7.
7. Explain some of the commonly used parameters in the EXEC statement.
2.8.
8. What is a temporary dataset in JCL? How to create a temporary dataset? 
2.9.
9. What are the symbolic parameters and why is it required?
2.10.
10. Explain the JCL EXEC statement?
2.11.
11. Explain the DD statement in JCL?
2.12.
12. What are different parameters for DD (Data Definition) statement?
2.13.
13. Explain the difference between JOBLIB and the STEPLIB statements.
2.14.
14. How can a JCL's syntax be checked without running it?
2.15.
15. Why include statement is used in a JCL?
3.
JCL Interview Questions for Experienced
3.1.
16. What does JCL's temporary dataset mean? How can a temporary dataset be made?
3.2.
17. What’s the use of symbol // in JCL?
3.3.
18. Which utility is used to run a COBOL-DB2 Program?
3.4.
19. Explain Msglevel parameter and its importance.
3.5.
20. What is the time parameter in JCL? Explain what does TIME=1440 mean?
3.6.
21. Explain DFSORT utility?
3.7.
22. What is a Generation Data Group (GDG)?
3.8.
23. What are the hierarchy levels in JCL?
3.9.
24. How do you create a temporary dataset? Where will you use them?
3.10.
25. How do you submit a job for execution?
3.11.
26. How can a Sort program be used to convert a Fixed Block (FB) file into a Variable Block (VB) file?
3.12.
27. How can a FB file convert to a VB file using the SORT program?
3.13.
28. What are “Cond=even” and “Cond=only”?
3.14.
29. Can you code instream data in PROC.
3.15.
30. Explain NOTCAT 2- GS.
4.
Conclusion
Last Updated: Jun 12, 2024
Easy

JCL Interview Questions

Author Komal Shaw
0 upvote
Master Power BI using Netflix Data
Speaker
Ashwin Goyal
Product @
18 Jun, 2024 @ 01:30 PM
JCL Interview Questions

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.

JCL image

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.

Get the tech career you deserve, faster!
Connect with our expert counsellors to understand how to hack your way to success
User rating 4.7/5
1:1 doubt support
95% placement record
Akash Pal
Senior Software Engineer
326% Hike After Job Bootcamp
Himanshu Gusain
Programmer Analyst
32 LPA After Job Bootcamp
After Job
Bootcamp

JCL Interview Questions for Experienced

16. What does JCL's temporary dataset mean? How can a temporary dataset be made?

Temporary datasets are files that contain one or more records that are only required for the duration of work before being erased. They only need storage for the time necessary to finish the job, after which they are removed. These datasets are frequently expressed as DSN=&&name or just without a DSN. They enable us to pass the results of one phase to another in the same job.

17. What’s the use of symbol // in JCL?

It's a vital sign that's employed in JCL statements. This symbol must come first in every JCL statement. The JCL statements must be executed in accordance with a predetermined rule; otherwise, an error is thrown.
The (//) sign at the start of JCL statements is the first thing the JCL execution mechanism looks for. Runtime exceptions are avoided because of this.

18. Which utility is used to run a COBOL-DB2 Program?

The COBOL-DB2 program is executed using the IKJEFT01 function.

19. Explain Msglevel parameter and its importance.

The MSGLEVEL parameter in JCL (Job Control Language) specifies the level of messages to be displayed in the job's output. It is important for controlling the verbosity of job logs. Higher values provide more detailed messages that helps in debugging, but they can also result in larger output files. Lower values reduce the amount of details available in the output.

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

The JCL TIME keyword parameter, which is optional, defines how long a job may use the CPU. Simply put, TIME indicates the maximum amount of time that the CPU can be used to run the job. The TIME parameter can also be coded at the Job and Step levels. The system will automatically halt the JOB execution once the set execution time has passed. As a result, the Duration parameter will alert OS of the maximum CPU utilization period, and OS will automatically cancel the job once the specified time has passed.

21. Explain DFSORT utility?

A strong IBM tool is DFSORT. Datasets are copied, sorted, and combined using it. The input datasets are specified using the SORTIN and SORTINnn DD commands. The output data is chosen using the SORTOUT and OUTFIL commands. 
Using JCL, the utility application DFSORT processes or manipulates sequential files only for mainframes.

22. What is a Generation Data Group (GDG)?

A group of sequential or functionally linked datasets is referred to as a generation data group. Periodically, they are addressed by adding a new generation, getting rid of the eldest generation, and occasionally keeping older generations.

23. What are the hierarchy levels in JCL?

The hierarchies in JCL allow you to easily organize and execute complex job flows. Let's discuss these hierarchies.

  • Job Level: This is the highest level in JCL, which represents an entire job with multiple job steps.
     
  • Job Step Level: Each job can consist of one or more job steps, each defining a specific task or program to execute.
     
  • DD Statement Level: Within each job step, DD (Data Definition) statements define input and output data sets and their attributes.

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

Temporary datasets can be produced by either not specifying a DSNAME or by specifying the temporary file indicator as in DSN=&&TEMP. They are used by us to transmit the results of one phase to the next step in the same job. Once the project is finished, the dataset won't be held in reserve.

25. How do you submit a job for execution?

For each task to be completed on a mainframe, a job must be written and sent to the mainframe computer for processing. This is referred to as posting a job.
You can submit a JOB from your CICS application software in a variety of ways. We may accomplish this by writing your JCL straight to the JES Spool using the CICS Spool Interface instructions.

26. How can a Sort program be used to convert a Fixed Block (FB) file into a Variable Block (VB) file?

The SORT utility in JCL allows you to convert a Fixed Block (FB) file into a Variable Block (VB) file using the FTOV option. With the FTOV, fixed-length input records are transformed into variable length output records. In a VB file, each record includes an additional 4 bytes for the Record Descriptor Word (RDW), making the record length in the VB file equal to the RDW length (4 bytes) plus the actual record length. Let's take a look at an example.

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

 

In this example, OUTPUTFILE represents the VB output file. If you input an 80-byte FB file, the output will be an 84-byte VB file (including 4 bytes for the RDW).

27. How can a FB file convert to a VB file using the SORT program?

By using the FTOV option in the SORT application, an FB file can be converted to a VB file.

28. What are “Cond=even” and “Cond=only”?

CODE-EVEN: The current task step is carried out regardless of whether the preceding steps terminated abnormally when COND=EVEN is coded. If additional return code conditions (RCs) are coded alongside COND=EVEN, the job step will run even if none of the RCs are true.
CODE-ONLY: The current work step will only run if a previous step terminated abnormally thanks to the code COND=ONLY. If additional RC conditions are coded alongside COND=ONLY, the job step will run if neither of the additional RC conditions is true and any earlier job steps have abnormally failed.

29. Can you code instream data in PROC.

No, you cannot use instream data inside of a PROC. This is the rule. Most of the time, it is preferable to program a few dummy statements inside the PROC and replace the DD statements from the JCL before running it.

30. Explain NOTCAT 2- GS.

NOTCAT 2-GS is essentially an MVS (Multiple Virtual Storage) message informing the user that duplicate catalog data exists. This might occur, for example, if we wanted to create a new dataset with disp new, catlg but we already had one with DSN = "xxxx.yyyy". We can remedy the situation in this case by erasing the original data set and classifying the new one on the volume where it exists.

Conclusion

In this article, we have extensively discussed JCL Interview Questions.

We also have courses and articles on popular interview questions just like these JCL Interview Questions, which will help you clear the interview round.

Also, do refer to JCL Interview Questions related articles:

 

 

Best wishes for your interview!🍀


Refer to our guided paths on Coding Ninjas Studio to learn more about DSA, Competitive Programming, JavaScript, System Design, etc.

Enrol in our courses and refer to the mock test and problems available.

Take a look at the interview experiences and interview bundle for placement preparations.

Do upvote our blog to help other ninjas grow.

Happy Coding!

Live masterclass