JCL Interview

The JCL interview questions and answers are intended for those with a working knowledge of JCL as a programmer. This will help you prepare for technical JCL interview and online selection tests during campus placement for freshers and job interviews for professionals.

JCL Interview Questions with Answers

1. What is the purpose and meaning of the REGION keyword and what JCL statement is it associated with?
Answer:
REGION specifies the maximum CPU memory allocated for a Job or Step. If REGION is in the JOB card, it relates to the entire job; if in the EXEC statement, it relates to the job step. To override the REGION defined at the JOB card level REGION specifies the max region size REGION=0K or 0M or omitting REGION means no limit will be applied.

2. What does the parameter CLASS in the JOB statement mean?
Answer:
Parameter CLASS species the job class. There are 36 possible job classes (A-Z, 0-9). Installations usually attempt to establish job classes that achieve a balance between I/O bound and CPU-bound jobs. Job classes also determine the overall priority of a job, along with the PRTY parameter PRTY may be coded to give special priority to a job. The operator may also set it.

3. Explain what does the TIME parameter signify in JCL? Can you also tell what TIME=1440 mean?
Answer:
TIME parameter can be used to overcome S322 abends for programs that genuinely need more CPU time TIME=1440 means no CPU time limit is to be applied to this step.

4. What is parameter MSGCLASS in the JOB statement used for?
Answer:
The MSGCLASS parameter is used to specify the job scheduler message output class. The output classis (A-Z,0-9). Job scheduler message include all messages not printed by the actual job steps being executed. Some of these are: JCL statements and error messages, device allocations, dataset disposition and accounting information.

5. What does parameter MSGLEVEL on the JOB statement mean and what is the advantage of using it.
Answer:
MSGLEVEL indicates whether or not one wishes to print the JCL statements and allocation messages. The MSGLEVEL parameter can save paper. After a job is debugged, there may be no need to print all the JCL and allocation messages each time it runs. To reduce printing to a minimum one may wish to code MSGLEVEL = (0,0)

6. What does parameter TYPRUN = HOLD mean?
Answer:
The parameter TYPRUN = HOLD holds a job in the input queue for later execution. The job is held until the operator releases it. TYPRUN=HOLD is useful for when one job must not run until another job completes. Operator intervention is required to release the job.

7. What does the statements: TYPRUN=SCAN and TYPRUN=HOLD do in a JCL statement?
Answer:
A TYPRUN= SCAN checks the JCL for errors, TYPRUN= HOLD holds the job until further notice.

8. Explain what is “COND=EVEN” and “COND=ONLY”?
Answer:
COND=EVEN indicates to execute this step EVEN if any previous step is terminated abnormally.
COND=ONLY indicates to execute this ONLY if any previous step is terminated abnormally

9. Explain what are JCLLIB and STEPLIB in JCL?
Answer:
Both libraries specifies the private libraries that should be searched before the default system libraries does in order to locate a program to be executed.
JCLLIB identifies the libraries that the system will search for include groups or procedures named in EXEC statements
JOBLIB applies to all steps in the job.
STEPLIB applies only to the particular step.

10. Can you tell me what is the order of searching of the libraries in a JCL?
Answer:
First any private libraries as specified in the STEPLIB or JOBLIB, then the system libraries such as SYS1.LINKLIB. The system libraries are specified in the linklist.

11. What will happen if both JOBLIB and STEPLIB is specified?
Answer: JOBLIB is ignored.

12. What do you mean by S322 abend?
Answer:
S322 abend indicates a time out abend. Your program has taken more CPU time than the default limit for the job class could indicate an infinite loop.

13. Mention what happens when COND is coded in JOB statement and when COND is coded inside EXEC statement?
Answer:
When COND is coded in JOB statement, the condition is tested for every job step. When the condition is true for any particular job step, it is bypassed along with the job steps.
When COND is coded inside EXEC statement of a job step, and the condition is true, then only that particular job step is bypassed, and execution will be carried out from the next job step.

14. What are the commonly used parameters on the EXEC statement and what do you they mean?
Answer:
The most commonly used parameters on the EXEC statement are: COND,
PARM, REGION, and TIME. They stand for:
COND – Species conditions to execute subsequent job steps if the previous step(s) fail.
PARM – Passes parameter to the job steps.
REGION – Species the region size to allocate for the job / job step.
TIME – Imposes a time limit on the job or job step.

15. Parameters COND, REGION, AND TIME can be coded on both the JOB and the EXEC statements. What are the differences between using them on the JOB versus the EXEC statements, and in which statements are they commonly used?
Answer:
Parameters COND, REGION, AND TIME coded on the JOB statement will be in effect for the entire job. When used on the EXEC statement, they will be in effect for that job step only. The COND parameter is normally used on the EXEC statement. The REGION parameter is not normally used unless a particular program requires a lot of storage and it is necessary to override the installation’s REGION Default. If the REGION parameter is used on the both JOB and EXEC statements, then the REGION parameter from the JOB statement will be in effect. The TIME parameter is most often used on the JOB statement.

16. What is an Operation Exception error?
Answer:
An Operation exception error indicates that an operation code is not assigned or the assigned operations not available on a particular computer model. The machine does not recognize the instruction or operation used. A possible reason a subscript error. This error could also be caused by an attempt to read a le that was not opened, a misspelled DD statement. The system completion code is 0C1.

17. What is a Protection exception error?
Answer:
A protection exception error occurs when the program is attempting to access a memory address that is not within the memory area that the program is authorized to use. Some of the causes may be a subscript or index that is not initialized or has taken on a value outside the bounds of the table with which it is associated, an attempt to read an open end le, or an incorrect or missing DD statement. The System completion code is 0C4.

18. What is an addressing exception error?
Answer:
An addressing exception error occurs when a program is attempting to access a memory location, which is outside the bounds of a available real storage on the machine. This can be caused by a dataset not being open end at the time an I/O was directed to it, an attempt to close a dataset a second time, incorrectly called module parameters or coding, improper exit from a performed paragraph, or uninitialized subscript or index. The system completion code is 0C5.

19. What is a data exception?
Answer:
A data exception error indicates an attempt to perform an arithmetic operation on non-numeric data. It can also occur from incorrect input data to a program that is not performing sufficient numeric testing on it before attempting arithmetic. The system completion code is 0C7.

20. What are some of the abend generated when not enough disk space is available and what do they mean?
Answer:
Some of the abend generated due to a lack of available disk space are:
B37 — Disk volume out of space, cannot write output. The system gave all the primary space and as much secondary space as it could.
D37 — Primary disk space was exceeded and either no secondary space allocation was specified, or it was insufficient. One should increase the primary space as well as provide adequate secondary allocation was specified or it was insufficient. One should increase the primary space as well as provide adequate secondary space allocation to eliminate this error.
E37 — There was insufficient space on the volume. One way to solve this problem is to specify more volumes on the JCL.

21. What is the difference between CATALOGED procedure and IN-STREAM procedure?
Answer:
INSTREAM procedures are set of JCL statements written between JOB and EXEC statements start with PROC and end with PEND statement. Mainly used to test cataloged procedures. CATALOGED PROCEDURES are cataloged on the procedure library (PROCLIB) and is called by specifying the procedure name on the EXEC statement.

22. What is the Symbolic parameter? What for it is needed? Where it is most commonly used?
Answer:
Any parameter that can vary with each execution is a good candidate for definition of a symbolic parameter. Use of symbolic parameter make the procedure more flexible. This prevents the procedure to be modified each and every time a small and recurring change is needed at a place.
A symbolic parameter is preceded by an ampersand (&) and followed by a name (&FIRST). The first character must be alphabetic. Symbolic parameters can be coded only in the operand field of the JCL statements; they cannot appear in the name or operation field of the JCL statements. If more than one value is assigned to the symbolic parameters on a PROC or EXEC statement, only the first one is used. Symbolic parameters may be coded in any order on the PROC or EXEC statement.
//DD1 DD DSNAME=&SYSUID..PROFILE,DISP=(NEW,KEEP),

23. What is an IEBGENER used for?
Answer:
IEBGENER is a dataset utility used to copy sequential datasets, produce a partitioned dataset or member from a sequential dataset, produce an edited sequential or partitioned dataset, and re-block / change the logical record length of a dataset.

24. What is an IEBCOPY used for?
Answer:
IEBCOPY is a dataset utility used to copy one or more partitioned datasets or to merge partitioned datasets. A partitioned dataset that is copied to a sequential dataset is said to be unloaded. When one or more dataset created by an unload operation are used to recreate a partitioned dataset, it is called a load operation. Specific members of a partitioned or unloaded dataset can be selected for, or excluded from, a copy, unload or load process.

25. What is an IEFBR14 used for?
Answer:
IEFBR14 is used to delete datasets, find dataset, catalog, and uncatalogued datasets.

26. What is an IEHLIST used for?
Answer:
IEHLIST is a system utility used to list entries in an OS CVOL, entries in the directory of one or more partitioned datasets, or entries in an indexed or nonindexed volume table of contents (VTOC).

27. What is an IEHINIT used for?
Answer:
IEHINIT is a system utility used to write an IBM volume label onto any number of magnetic tapes mounted on one or more tape units. Each volume label set created by this program contains a standard volume label, and 80-byte dummy header and a tapemark.

28. What is an IEBPTPCH used for?
Answer:
IEBPTPCH is a dataset utility used to print or punch all or selected, portions of a sequential or partitioned dataset. Records can be printed or punched to meet either standard specifications or user specification.

29. What is an IEBUPDTE used for?
Answer:
IEBUPDTE is a dataset utility used to create and update dataset libraries, modify existing partitioned members or sequential dataset and change the organization of dataset from sequential to partitioned or Vice Versa.

30. Explain what is the difference between JES3 and JES2?
Answer:
The difference between JES3 and JES2 is that,
JES3 assigns datasets for all the steps before the job is scheduled.
JES2 assigns datasets required by a step just before the step executes.

31. Mention what is the difference between specifying DISP=OLD, DISP=MOD and DISP=SHR for a dataset?
Answer:
The difference between specifying DISP=OLD and DISP=SHR for a dataset is that,
DISP=OLD: It reads data from beginning of dataset. But incase if you try to modify or write, then it will overwrite existing data. i.e old data is lost DISP=MOD: It reads data from beginning of dataset. But incase if you try to modify or write, then it will append to existing data. i.e old data will be kept as is.
DISP=SHR: Its read-only file. In this, multiple user can share the data

32. What does a disposition of (NEW,CATLG,KEEP) for a DSN mean?
Answer: –
DISP NEW will allocate new memory space for disposition.
DISP CATLG will catalog the available data set once the step is successful.
DISP KEEP will retain the dataset. Catalog will not be kept when the step abends.
The above 3 operations always ensure that the data set is properly handled.
The operations are reliable to handle the data sets.

33. What is the difference between the Positional and Keyword parameters? Give examples.
Answer:
Positional Parameters are placed in a specific position.
It needs to be positioned within the operand field.
Example: Employee name in the Job card is a positional parameter at the Job level.
Keyword Parameters are not placed in a specific position or order. Example: MSGLEVEL=(X,Y)

34. How to pass data to a program that is coded in an EXEC statement?
Answer:
Following are the methods to pass data to the program:
Using PARAM in Job Control Language. Linkage Section should contain the code of the receiving variable in COBOL.
The PROCEDURE DIVISION USING statement is used by using PARAM.
By passing as instream in Job Control Language.
ACCEPT statement in COBOL is used.
By passing in a flat file.
File descriptor need to be coded in COBOL.

35. What are S0C1, S0C4, S0C5, S0C7 and SOCB?
Answer:

SOC1: An operation Exception Error that may occur because of missing DD name.
SOC4: An Exception Error that may occur because of missing Select statement, missing parameters on called sub program.
SOC5: This exception may occur when an unopened dataset is closed, bad subscript.
SOC7: This exception may occur when a numeric operation is performed on non-numeric data, working storage is not initialized.
SOCB: This operation error may occur when a ‘division by zero’ occurs.

36. Is condition checking possible in JCL? If yes, how?
Answer:
Yes, it is possible to check conditions in JCL. Conditions can be checked at both job level or step level.
Job level condition applies to all steps in the job and overrides condition if stated in the step level.
Condition checking is similar as (if else conditions) in many programming languages (as c, c++, java etc).
Condition checking is done with help of a keyword parameter COND with return code and operand (predefined in jcl).
Syntax:
COND= (return code, operand)
Return codes specify according to the type of completion of job and operand specify according to the condition want to apply.
There are four return codes and six operands used as follows: Return codes 0 for successful execution of job step.
4 for warning message for job step.
8 for serious error in job step.
16 for steps halted.
Operands used GT bypass current step if comparision code is greator than return code.
GE greator than or equal to
LT less than
LE less than or equal to
EQ equal to
NE not equal to
Example:
//CAREERRIDE JOB (P007),’PRASHANT RAJORIA’ COND=(4,LT),
//STEP001 EXEC PGM=HELLO1
//STEP002 EXEC PGM=HELLO2
//STEP003 EXEC PGM=HELLO3
All steps executed if return code is less than 4 for every step.

37. Explain what do you mean by Generation Data Group (GDG)?
Answer:
A Generation Data Group in JCL is a group of chronologically/functionally related datasets, with each having a father-son relationship. GDGs are processed periodically, often by adding a new generation, retaining previous generations, and sometimes discarding the oldest generation. Every dataset within a group is assigned a unique Generation Number.

38. What are S0C1, S0C4, S0C5, S0C7 ABENDs?
Answer:

S0C1 (Operation Exception Error) – May be due to Missing or misspelled DD name, Read/Write to unopened dataset, reading a dataset opened output mode Writing into a dataset opened input mode, called subprogram not found
S0C4 may be due to Missing Select statement (during compile), Bad Subscript/index, Protection Exception Missing parameters on called subprogram, Read/Write to unopened le, Move data from/to unopened le;
S0C5 May be due to Bad Subscript/index, Close an unopened dataset, Bad exit from a perform, Access to I/O area (FD) before read;
S0C7 may be due to Numeric operation on non-numeric data, Un-initialized working storage, Coding past the maximum allowed subscript
S0CB might be due to Division by Zero

39. What are the possible reasons for below mentioned JCL ABEND codes?
Answer:
S0C4 Caused by the subscript being out of range
S0C5 Caused by invalid address specification. i.e. The address points to an instruction, control word or data outside the available real storage
S0C7 Caused by a bad data. i.e. Data exception. When we are moving an alphanumeric field to a numeric computational field this Abend occurs. The result is an Abend failure
S222 Caused by a job being cancelled by the operator, due to a request by the program for an unavailable resource.
S237 Caused by end of volume being encountered.
S322 Caused when CPU time assigned to the job, job step, or procedure has been exceeded. i.e. Time out error.
S413 This abend occurs if the DD statement referenced by UNIT=AFF statement is not closed before the DD statement that comes before it.
S522 Caused when a wait state exceeds an installation-defined time limit.

40. What is the use of COND parameter in JCL?
Answer:
COND is a condition parameter, consists of 2 sub-parameters, 1st – return code from the previous step, 2nd – condition. If COND is true, the step on which COND is coded
will be BYPASSED. It is compared with system return code of previous step //STEP1 EXEC
PGM=ABCD //STEP2 EXEC PGM=XYZ, cond=(4,lt) STEP 2 will be executed when system
return code of step1 is less than 4

41. What is the difference between a symbolic and an override in executing a PROC?
Answer:
A symbolic is a PROC placeholder; the value for the symbolic is supplied when the
PROC is invoked, e.g. &symbol=value An override replaces the PROC’s statement with another one; it substitutes for the entire statement

42. On a DD statement, what is the main difference between creating a new sequential and a partitioned dataset?
Answer:
SPACE= (n,m) for a sequential , SPACE= (n,m,p) for a PDS where n, m, and p are numbers. The p designates how many directory blocks to allocate.

43. What is the difference between IEBGENER, IEBCOPY and REPRO in IDCAMS utility?
Answer:
They are the utility programs used in JCLs:
IEBGENER: This utility is used for copying sequential datasets which produces a PDS or a member from a sequential dataset.
IEBCOPY: This utility is used for copying one PDS to another or to merge PDSs.
REPRO: This is for copying sequential datasets. Same as the IEBGENER

44. How do you restart a proc from a particular step?
Answer:
In job card, specify RESTART=proc step step name where procstep = name of the jcl step that invoked the proc and stepname = name of the proc step where you want execution to start

45. What can be done to resolve a JCL error that reads ‘DATASET NOT FOUND’?
Answer:
Some of the actions one can take to resolve a JCL error ‘DATASET NOT FOUND’ are:
One must examine the job log and the allocation/deallocation report and identify the step and DDname involved.
Determine whether or not the dataset name does indeed exist on the system.
Check the JCL to make sure the dataset name is spelled correctly.
If the job has more than one step and the ABEND is not on the rst step, check to see if the dataset on the previous step was deleted.
Fix the problem and resubmit the job.

46. What do you mean by the REPRO command?
Answer:
Whenever a new cluster is created using IDCAMS, the cluster will be empty. By the use of REPRO command, we are able to load records into the cluster. REPRO is used to:
Copy Datasets (VSAM or NON-VSAM), copy catalogs.
Conversion of sequential and index sequential Datasets to VSAM format.
Backup VSAM catalog
Conversion of VSAM and Index sequential Datasets to sequential format
Read a backup copy of VSAM catalogs.

47. Is it slower if you access a record through ALTERNATIVE INDEX as compared to Primary INDEX?
Answer:
Yes, it slower because the alternate Key would rst locate the primary Key, which in turn locates the actual record. It requires twice the number of I/Os.

48. Explain in brief what are the 3 types of VSAM files?
Answer:
Below are the 3 types of VSAM les.
ESDS (Entry sequenced dataset). DB2 uses a special type of ESDS.
RRDS (Relative record dataset). Records are accessed using a relative number.
KSDS (Key sequenced dataset) is the most common type encountered. The record
sequence is determined by a unique key field.

49. When would a program run “below the line”?
Answer:
A program would run “below the line” if it did not exceed the address space available.

50. When would a program run “above the line”?
Answer:
A program would run “above the line” if it required more than 16 megs or if it is competing with other programs which are using the same address space. Special Parameters must be set for compilation and linkage editing in order for a program to run above the 16-meg line.

DB2 Interview Questions with Answer : Click Here 
IBM Reference: 
Click Here

Scroll to Top