- JCL Tutorial
- JCL Home
- JCL - Overview
- JCL - Environment
- JCL - JOB Statement
- JCL - EXEC Statement
- JCL - DD Statement
- JCL - Base Library
- JCL - Procedures
- JCL - Conditional Processing
- JCL - Defining Datasets
- JCL - Input/Output Methods
- JCL - Run COBOL Programs
- JCL - Utility Programs
- JCL - Basic Sort Tricks
- JCL Useful Resources
- JCL - Questions and Answers
- JCL - Quick Guide
- JCL - Useful Resources
- JCL - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
JCL Interview Questions
Dear readers, these JCL Interview Questions have been designed specially to get you acquainted with the nature of questions you may encounter during your interview for the subject of JCL. As per my experience good interviewers hardly plan to ask any particular question during your interview, normally questions start with some basic concept of the subject and later they continue based on further discussion and what you answer −
Specify DD DUMMY in the overriding JCL for the ones, which are not overridden.
//STEP1.IN1 DD DUMMY // DD DSN=MYDATA.URMI.IN2,DISP=SHR // DD DUMMY
Following piece of code shows the reference of each GDG version −
Step1 input: (0) Step1 output: (+1) Step2 input: (+1) Step2 output: (+2)
When the file is used as input in IDCAMS, job completes with a warning (return code 4) if the file is empty.
Specify RESTART = STEP2 in JOB statement. And include IF-THEN-ELSE construct as below−
//URMIIF JOB 1, CLASS=6, MSGCLASS=0, NOTIFY = &SYSUID,RESTART=STEP2 //* //STEP1 EXEC //STEP2 EXEC //IF1 IF (STEP2.RC = 0 & STEP2.RC <> 0) THEN //STEP3 EXEC //STEP4 EXEC //ENDIF
Data can be passed to a COBOL program through files, PARM parameter and SYSIN DD statement.
The varying portion of the JCL can be specified using symbolic parameters in the JOB and the static parts can be specified in the PROC. For example, if the file name changes for every JOB that uses the PROC, then the varying portion of the file name can be coded in JCL using symbolic parameter.
//IN1 DD DSN = &ID.URMI.IN1, DISP = SHR //*Coded in PROC ID=MYDATA1 is coded in JOB1, ID = MYDATA2 is coded in JOB2 and so on
Use IEBGENER and pass existing file in SYSUT1. Pass new file in SYSUT2 and mention DCB=*.SYSUT1 to get the same DCB as that of SYSUT1 dataset.
By using the UNIT and VOL serial parameters in the dataset DD statement.
Dummy DD statements, data card specifications, PROCs, JOB, PROC statements cannot be coded within an INCLUDE member. An INLCUDE statement can be coded within an INCLUDE member and further nesting can be done up to 15 levels.
Code COND = ONLY in STEP2.
Using RD parameter in JOB/EXEC statement. The abend codes for which RESTART need to be performed can be mentioned in the SCHEDxx member of the IBM system parmlib library.
Using IEBEDIT in a JCL, selected steps of another JCL can be run. In the above JCL, the input JCL with 10 steps is present in MYDATA.URMI.JOBS(INPUTJOB). STEP3 and STEP7 is specified in SYSIN of IEBEDIT, so that those two steps are run.
//STEP001 EXEC PGM=IEBEDIT //SYSUT1 DD DSN=MYDATA.URMI.JOBS(INPUTJOB),DISP=SHR //SYSUT2 DD SYSOUT=(*,INTRDR) //SYSPRINT DD SYSOUT=* //SYSIN DD * EDIT TYPE=INCLUDE,STEPNAME=(STEP3,STEP7) /*
When it is defined with DISP = (NEW,KEEP) at the time of creation. In case of a GDG, least recent generation is uncataloged if the GDG base had been defined with NOEMPTY parameter when the LIMIT is reached. All generations are uncataloged when coded with EMPTY.
GDG base can be created using IDCAMS utility. EMPTY uncataloges all the generations when the LIMIT is reached. SCRATCH physically deletes the generation, when it is uncataloged. (LIMIT specifies the maximum number of versions that the GDG base can hold).
In the SORT/ICETOOL program, SKIPREC = n can be used, which skips the first n records and then copies the rest to the output file.
//JSTEP020 EXEC PGM=ICETOOL //TOOLMSG DD SYSOUT = * //DFSMSG DD SYSOUT = * //IN1 DD DSN = MYDATA.URMI.SKIPREC,DISP=SHR //OUT1 DD SYSOUT = * //TOOLIN DD * COPY FROM(IN1) TO(OUT1) USING(CTL1) /* //CTL1CNTL DD * SORT FIELDS = COPY SKIPREC = 1000 /*
STARTREC and ENDREC restricts the READ from the input file on the specified record number.
//URMISPLT EXEC PGM = SORT //SORTIN DD DSN=MYDATA.URMI.FILEIN,DISP=SHR //SORTOF01 DD DSN = MYDATA.URMI.FILEOUT1, // DISP = (NEW,CATLG,DELETE), // RECFM = FB, LRECL = 50 //SORTOF02 DD DSN = MYDATA.URMI.FILEOUT2, // DISP = (NEW, CATLG, DELETE), // RECFM = FB, LRECL = 50 //SORTOF03 DD DSN = MYDATA.URMI.FILEOUT3, // DISP = (NEW, CATLG, DELETE), // RECFM = FB, LRECL = 50 //SYSPRINT DD SYSOUT = * //SYSOUT DD SYSOUT = * //SYSUDUMP DD SYSOUT = * //SYSIN DD * SORT FIELDS = COPY OUTFIL FILES = 01,ENDREC=100 //*assuming input file has 300 records. OUTFIL FILES = 02, STARTREC = 101, ENDREC = 200 OUTFIL FILES = 03, STARTREC = 201 //*
A job time-out error can occur when the program takes more time than the time limit for the specified class. This is called a S322 abend. This error is encountered when there are some looping errors in the program and it does not reach completion.
If the data processed in the program is genuinely huge and needs more time than the class limit, then the TIME parameter can be coded as TIME = 1440 to get infinite time until job completion.
The SPACE parameter of the image copy dataset can be increased based on the volume of the table and the job can be restarted from step2.
NOTIFY = userid of the person (not the submitter) can be specified in the JOB statement so that the user gets a notification with the return code upon job completion. But the job log is present in the spool under the submitter's userid only.
FTOV option in SORT helps in converting FB to VB file.
//URMIFTOV EXEC PGM = SORT //SORTIN DD * 123******* 4560000000 123****123 789 //SORTOF01 DD DSN = MYDATA.URMI.FILEOUT1, // DISP = (NEW, CATLG, DELETE), // RECFM = VB, LRECL = 54 //SORTOF02 DD DSN = MYDATA.URMI.FILEOUT2, // DISP = (NEW, CATLG, DELETE), // RECFM = VB, LRECL = 54 //SORTOF03 DD DSN = MYDATA.URMI.FILEOUT3, // DISP = (NEW, CATLG, DELETE), // RECFM = VB, LRECL = 54 //SYSPRINT DD SYSOUT = * //SYSOUT DD SYSOUT = * //SYSUDUMP DD SYSOUT = * //SYSIN DD * SORT FIELDS=COPY OUTFIL FNAMES = SORTOF01, FTOV, VLTRIM = C'*' //*removes trailing '*' OUTFIL FNAMES = SORTOF02, FTOV, VLTRIM = X'40'//*removes trailing space OUTFIL FNAMES = SORTOF03, FTOV, VLTRIM = X'00'//*removes trailing zeros //*
JCL stands for Job Control Language which provides the specifications necessary to process a job. It is a set of control statements which provides the specifications necessary to process a job. It is a interface between programs & MVS operating system.
MVS stands for Multiple Virtual storage which is the operating system for the IBM mainframe systems.
Identifiers are two slashes (//) starting from column number 1. All JCL statements starts with identifiers except for two exceptions - For a delimiter statement, /* starting in col 1 and for a comment statement , //* starting at col 1.
Input −> Conversion −> Execution −> Output −> Hard copy −> Purge
The JCL along with the PROC is converted into an interpreted text to be understood by JES and stored into a dataset, which we call as SPOOL.
When the job reaches its highest priority, it is taken up for execution from the job queue. The JCL is read from the SPOOL, the program is executed and the output is redirected to the corresponding output destination as specified in the JCL.
Specifies the information required for SPOOLing of the job such as job id, priority of execution, user-id to be notified upon completion of the job.
JCL is terminated by a null statement which is optional. For a null statement code only // starting from column 1. All the lines after this will not be executed.
Based on the time duration and the number of resources required by the job, companies assign different job classes. These can be visualized as individual schedulers used by the OS to receive the jobs. Placing the jobs in the right scheduler will aid in easy execution of the jobs. Some companies have different classes for jobs in test and production environment. Valid values for CLASS parameter are A to Z characters and 0 to 9 numeric (of length 1). Following is the syntax − CLASS=0 to 9 | A to Z
The system sends the success or failure message (Maximum Condition Code) to the user specified in this parameter. Syntax − NOTIFY = "userid | &SYSUID"
TYPRUN = SCAN checks the syntax errors of the JCL without executing it.
The DSN parameter refers to the physical dataset name of a newly created or existing dataset. The DSN value can be made up of sub-names each of 1 to 8 characters length, separated by periods and of total length of 44 characters (alphanumeric).
The DISP parameter is used to describe the status of the dataset, disposition at the end of the job step on normal and abnormal completion. DISP is not required in a DD statement only when the dataset gets created and deleted in the same job step (like the temporary datasets). Syntax − DISP = (status, normal-disposition, abnormal-disposition)
The SPACE parameter specifies the space required for the dataset in the DASD (Direct Access Storage Disk). Syntax − SPACE = (spcunits, (pri, sec, dir), RLSE)
The Data Control Block (DCB) parameter details the physical characteristics of a dataset. This parameter is required for datasets that are newly created in the job step. LRECL is the length of each record held within the dataset. RECFM is the record format of the dataset.
A temporary dataset is the one that is created and deleted within a job and is declared as DSN=&&TEMP. Do not mention the DSN parameters with this.
Code SYSOUT = *, then the data will be directed to spool.
IEFBR14 is no operation utility. Used to return control to user and terminate. It is usually used to create empty dataset or delete an existing dataset.
DISP = (NEW,PASS). PASS is valid only for normal disposition. This is used when the dataset is to be passed and processed by the next job step in a JCL.
IKJEFT01 utility is used to run a COBOL-DB2 program.
DSN(Dataset Name) is used to declare the name of dataset in a DD statement.
PEND statement is used to end the in-stream procedure.
To refer the latest generation of a GDG, we use the reference as (+0).
COND=(12,LT,STEP1), it will read the condition as 12 less than 8, which is false, so this step will be executed.
In the SORT step mention the SYSIN & SYSOUT dataset name & in sort card code SORT FIELDS=COPY to copy data from input file to output file.
This statement is true.
SORT utility is used to sort a file in a particular order based on the sort card.
IEBUPDTE is used to update PDS.
The SPACE parameter specifies the space required for the dataset in the DASD (Direct Access Storage Disk). Syntax − SPACE = (spcunits, (pri, sec, dir), RLSE)
This statement is true.
What is Next ?
Further you can go through your past assignments you have done with the subject and make sure you are able to speak confidently on them. If you are fresher then interviewer does not expect you will answer very complex questions, rather you have to make your basics concepts very strong.
Second it really doesn't matter much if you could not answer few questions but it matters that whatever you answered, you must have answered with confidence. So just feel confident during your interview. We at tutorialspoint wish you best luck to have a good interviewer and all the very best for your future endeavor. Cheers :-)