Updated May 12, 2023
Introduction to JCL Interview Questions and Answers
The following article provides an outline for JCL Interview Questions. JCL stands for Job Control Language. It plays a crucial role in handling various mainframe-related jobs by defining and controlling them, ensuring the logical execution of programs, and obtaining the desired output according to the schedule defined for each specific job. JCL is usually designed to contain multiple steps, and every step holds the business logic to be executed or some specifically defined task that needs to be completed. JCL typically links all the defined programs and input or output files in the backend job batch environment.
Now, if you are looking for a job related to JCL, you must prepare for the 2023 JCL Interview Questions. Every interview is indeed different as per the various job profiles. Here, we have prepared the critical JCL Interview Questions and Answers to help you succeed in your interview.
This 2023 JCL Interview Questions article will present the ten most important and frequently asked JCL interview questions. These interview questions are divided into two parts as follows.
Part 1 – JCL Interview Questions (Basic)
This first part covers basic Interview Questions and Answers.
Q1. Suppose we had 3 DD names in a concatenated approach with multiple datasets; how can we override one another dataset on those specific three datasets?
Answer:
By using DD DUMMY. If you need to override 1 dataset to another, then DD DUMMY will easily override any JCL job steps. Please note those are overridden, not overwritten.
//STEP1.IN1 DD DUMMY
// DD DSN=OWNDATA.OURMI.IN2,DISP=SHR
// DD DUMMY
Q2. We can able to maintain multiple versions in GDG; suppose the current version is used to consider as input in the first step (step 1) of any job; output also creates a new version And the same way, if step1 output can be considered as input of next step suppose step2, the output of step2 again going to create one new version, then explain how are we indicating every GDG require a version for each step?
Answer:
Without specific logic, we can easily do the same using the +1 or +2 operator.
Please find below a code snippet that defines references of multiple versions of GDG:
Stp1 input: (0)
Stp1 output: (+1)
Stp2 input: (+1)
Stp2 output: (+2)
Q3. Is it possible to check an empty file or not in JCL? If yes, then explain how we can do this.
Answer:
Yes, it is possible to identify one empty file in JCL, but on one condition, that file should be one input of IDCAMS. If one has been used as INPUT in IDCAMS, then when the job is completed, and the input file is empty, in that case, code 4 will be returned as output for that specific JCL job. Choosing an empty file as the input for any JCL job will result in a return code of 4.
Usually, the developer manages the same differently; if the return code is 4, the job will be terminated automatically, and there is no further need to process the subsequent executable logic. Any mainframe or JCL job developer must possess expertise in handling this type of error, considering the high cost of the mainframe system and the minimal space occupied by an empty file.
Q4. Suppose one JCL job has four steps; surprisingly, the job has been abended. Now give some commands or explain how to start step 2 of that specific JCL job.
Answer:
These are the common JCL Interview Questions asked in an interview. Several responsibilities typically need to follow by a JCL tester in the current IT industry.
It needs to be mentioned RESTART = STP2 in the statement of the job. You should construct the JCL job to allow for restart at step 2 and ensure the sequential execution of steps 3 and 4. The same IF-ELSE statement also needs to be included.
//URMIIF JOB 1, CLASS=4, MSGCLASS=0, NOTIFY = &SYSUID,RESTART=STP2
//*
//STP1 EXEC
//STP2 EXEC
//IF1 IF (STP2.RC = 0 & STP2.RC <> 0) THEN
//STP3 EXEC
//STP4 EXEC
//ENDIF
Q5. Explain in detail the available ways to require data passing into a COBOL program from any JCL job.
Answer:
Several ways to pass required data in a COBOL program from a specific JCL job.
Below are three approaches that can communicate it:
- Files: JCL job can send files directly to the COBOL program; the program can read and process the files based on the logic.
- PARM Parameter: If JOB accepts some PARM parameter as input, it can easily pass on to any defined COBOL program for further process per the logic defined by the COBOL developer.
- SYSIN DD statement: SYSIN DD statement can pick up some system-defined parameter by any JCL job and send the same to a defined COBOL program for further execution.
After sending the required data to the Cobol program, every JCL job is waiting to return a response from that program and decide the JOB further process.
Part 2 – JCL Interview Questions (Advanced)
Let us now have a look at the advanced Interview Questions and Answers.
Q6. Is it possible to call the same PROC by using many JOBS? If yes, then give detail explaining how it can be reused.
Answer:
Yes possible. PROC mainly defines some static parts of the job, which can be reused in any JCL job. For instance, the PROC can encapsulate the functionality to change a file name, allowing for its reuse across multiple JCL jobs.
//IN1 DD DSN = &ID.OURMI.IN1, DISP = SHR //*PROC version
ID=OWNDATA1 is coded in JOB1, ID = OWNDATA2 is coded in JOB2, and so on.
Q7. Is it possible to create one new dataset for JCL to maintain the same file-like organization, whereas it is available in another existing dataset? If yes, please explain.
Answer:
Possible by using IEBGENER. Existing file pass to SYSUT10; now, pass the new file to SYSUT11 and mention DCB=*.SYSUT10.
Q8. Explain in detail of accessing policy to an uncategorized JCL dataset in the mainframe.
Answer:
By using UNIT and VOL serial parameters.
Q9. Again assuming one JCL job has two steps, we are willing to configure that if some reason, step 1 abends, step 2 will automatically run, or will the JCL job be terminated? Explain how we can do this.
Answer:
These are the most popular JCL Interview Questions asked in an interview. Some famous test cases in the current IT industry.
Provide some ONLY condition in step 2 it can be possible.
The code will be like below:
COND = ONLY in STP2
Q10. Is it possible to perform one automated restart in case of JCL job abends? If yes, then explain how we can do this easily.
Answer:
It is very much possible by using the RD parameter in the JCL job or exec statement. If a restart requires the ABEND code, you must mention it in the IBM parmlib library as a SCHEDxx member.
Recommended Articles
This has been a guide to JCL Interview Questions and Answers so that the candidate can easily crack down on these questions. Here in this post, we have studied the top JCL Interview Questions often asked in interviews. You may also look at the following articles to learn more –