Introduction to JCL Interview Questions and Answers
JCL is actually standing for Job Control Language. JCL is mainly handling all the mainframe-related job, defining one job, controlling the same for ensuring proper logical execution of defining programs, and getting desired output as scheduled by that specific job. JCL is normally designed in such a way so that it may contain multiple steps, and every step holding the business logic to be executed or some specific define task that needs to be complete. JCL normally 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 need to prepare for the 2020 JCL Interview Questions. Every interview is indeed different as per the different job profiles. Here, we have prepared the important JCL Interview Questions and Answers, which will help you succeed in your interview.
This 2020 JCL Interview Questions article will present the 10 most important and frequently asked JCL interview questions. These interview questions are divided into two parts are 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 3 datasets?
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 version in GDG, suppose if the current version is using to consider as input in the first step (step 1) of any job, output also been created 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 please explain how are we indicating every GDG require a version for each step?
We can easily do the same by using the +1 or +2 operator without any specific logic. Please find below code snippet which defines references of multiple version 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 please explain how we can do this?
Yes, it is possible to identify one empty file in JCL, but in 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 actually empty, in that case, code 4 will be return back as output for that specific JCL job. Return code 4 of any kind of JCL job can be considered an empty file choosing as input for the job. Normally, the developer manages the same in a different way; if the return code came as 4, then the job is automatically terminated, not required to process further for the next executable logic. As an empty file is normally not required to process further as it will take minimum space in the mainframe system, it is well aware that mainframe system cost is too high, so handling this kind of error will require expertness for any mainframe or JCL job developer.
Q4. Suppose considering one JCL job has 4 steps, and surprisingly suddenly job has been abended. Now give some commands or explain how we can start step 2 of that specific JCL job?
These are the common JCL Interview Questions asked in an interview. Several responsibilities normally need to follow by a JCL tester in the current IT industry.
It needs to be mention RESTART = STP2 in the statement of the job. JCL job should need to be constructed in such a way so that RESTART can be done in step 2, and accordingly, step 3 and 4 will be executed sequentially. The same IF-ELSE statement also needs to be included.
//URMIIF JOB 1, CLASS=4, MSGCLASS=0, NOTIFY = &SYSUID,RESTART=STP2
//IF1 IF (STP2.RC = 0 & STP2.RC <> 0) THEN
Q5. Explain in details of available ways to requiring data passing into a COBOL program from any JCL job?
There have several ways to pass require data in a COBOL program from a specific JCL job. Below three approaches can communicate it:
- Files: JCL job can able to send files directly to the COBOL program; the program will be able to read the files and process them based on the logic.
- PARM Parameter: If JOB accepts some PARM parameter as input, it can easily pass on to any define COBOL program for further process as per the logic defined by the COBOL developer.
- SYSIN DD statement: SYSIN DD statement can pick up some system define parameter by any JCL job and send the same to a define COBOL program for further execution.
After sending require 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?
Yes possible. PROC mainly defined some static parts of the job, which can be reused in any JCL job. For example, file name change functionality can be defined inside a PROC and reused by the JCL job.
//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 just to maintain the same file-like organization, whereas it is available in another existing dataset? If yes, please explain?
Possible by using IEBGENER. Existing file pass to SYSUT10; now pass the new file in SYSUT11 and mention DCB=*.SYSUT10.
Q8. Explain in detail of accessing policy to an uncategorized JCL dataset in the mainframe?
By using UNIT and VOL serial parameters.
Q9. Again assuming one JCL job have two steps, now we are willing to configure that if some reason step1 abends, then step 2 will automatically run, else JCL job will be terminated? Explain how we can do this?
This is the most popular JCL Interview Questions asked in an interview. Some popular 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?
It is very much possible by using the RD parameter in the JCL job or exec statement. If some restart requires the ABEND code, it needs to be mentioned in the IBM parmlib library as a SCHEDxx member.
This has been a guide to the list of JCL Interview Questions and Answers so that the candidate can crackdown these Interview Questions easily. Here in this post, we have studied top JCL Interview Questions, which are often asked in interviews. You may also look at the following articles to learn more –