Real Time Interview Questions
Introduction -
What is JCL?
Job Control Language (JCL) is used on IBM mainframe systems to instruct the system on how to execute batch jobs or start subsystems.
What is a JES and what role does it play in job processing?
JES (Job Entry Subsystem) manages job queues, handles job prioritization, and facilitates input/output operations for job execution.
Explain what is the difference between JES3 and JES2?
JES2 and JES3 perform similar functions. The major difference is, JES3 allocates datasets for all the steps before the job is scheduled. In JES2, allocation of datasets required by a step are done only just before the step execution.
Codng Sheet -
What are the types of job control statements?
Each line in JOB falls under two categories based on how they coded, and those are -
- JCL Statement.
- JCL comment.
What are the hierarchy levels in JCL?
JCL has three levels -
- JOB statement
- EXEC statement
- DD statement
How do you code a Null statement?
Null statement is coded by simply placing two slashes (//) without any additional text following them on the line. This statement acts as a end statement of the JOB.
Structure -
What statements job contains?
JOB, EXEC and DD statements
What are the maximum EXEC statements or steps can be coded in a JCL?
255
What are maximum DD statements can code under a step or EXEC statement?
255
What are maximum DD statements can code in a JOB?
no. of steps * 255
Processing -
How does the JCL specify the JOB to OS?
In JCL, the job statement specifies the key parameters to OS, such as job name, accounting information, and priority, which the OS uses to manage and execute the job.
In Job processing, what happens in conversion stage?
This stage includes syntax checking, parameter validation, and the creation of job control blocks, preparing the job for execution by the Job Entry Subsystem (JES).
In Job processing, what happens in Execution stage?
In the job execution stage, the Job Entry Subsystem (JES) runs the job's specified tasks. The system allocates necessary resources, executes the program steps coded in the JCL, handles input and output operations, and manages error handling. Upon completion, it collects and routes the output to the appropriate destinations.
I have multiple jobs ( JCLs with several JOB cards ) in a member. What happens if I submit it?
All the jobs gets submitted in the order how they coded.
JOB Statement -
Explain the JOB statement in JCL?
A JOB statement with all its parameters is also called as JOB Card. A JOB card makes the OS aware of the specific job after it submits and provides the parameters required to run the job.
What are the three parts of a job card in JCL?
JOB statement is divided into three parts -
- JOB Name (job-name).
- JOB Operation (JOB).
- JOB Card parameters (job-card-parameters).
What is the difference between the Positional and Keyword parameters?
A positional parameter must be placed in a specific position within the operand field. Keyword parameters have no special position or order within the operand field.
What are three parameters you can specify on Job statement as well as on exec statement?
ACCT, COND and REGION.
Positional Parameters -
How many positional parameters are there in job statement?
2
What are the positional parameters are there in job statement?
Accounting information and Programmer name.
What is the accounting information? Its significance?
Accounting information is the billing name to which the CPU processing time for the entire job is billed. It should enclose with ().
Can we use more than one accounting information in JCL?
Yes
Can we use more than one programmer name in JCL?
Yes
Keyword Parameters -
What is the significance of Keyword parameters?
All other parameters except positional parameters in the JOB statement are called keyword parameters. Information passed in keyword parameters used by the JES (Job Entry System).
If the CLASS parameter is not coded, what will happen?
System installation default CLASSS parameter applies to the JOB.
How do you rerun a JCL job from a specific step?
Use the RESTART parameter in the JOB statement to specify the step from which to begin execution.
What are the implications of not specifying sufficient space for a dataset?
Insufficient space specifications can lead to job failures, dataset truncation, or system performance issues.
What does the TYPRUN parameter do?
TYPRUN is used to check the syntax of JCL without actually executing the job (TYPRUN=SCAN) or to hold the job without executing (TYPRUN=HOLD).
How can we get the MSGCLASS parameter details?
It is always advisable to check with your team lead, system operations, and production support teams to get the MSGCLASS parameter.
What is the default MSGLEVEL parameter value?
MSGLEVEL=(1,1)
What is the range of values for the PRTY parameter in a job card?
The priority number value ranges from 0-15 in JES2 and 0-14 in JES3. Higher number will have the higher priority during the execution.
For how long a job can be executed continuously in a mainframe?
248 Days.
What happen if TIME=NOLIMIT?
It specifies that the job can use the processor for an unlimited time.
How do you restart a step in JCL?
RESTART=stepname
How do you restart a proc from a particular step?
RESTART=proc-name.stepname
What will happen if you attempt to restart a job in the middle of a JCL // IF .... // ENDIF?
Job resume execution from the first step AFTER the // ENDIF.
EXEC Statement -
How does the EXEC statement function in JCL?
The EXEC statement specifies which program or procedure should be executed in a particular job step.
What are three parameters you can specify on Job statement as well as on exec statement?
COND, REGION, TIME
What is the significance of ACCT parameter in EXEC statement?
ACCT parameter is used to specify account information to which the CPU processing time of the specific step is billed.
I have a COBOL program that accepts some input data. How do you code the JCL statement for this?
Using PARM keyword.
DD Statement -
What are DD statements used for in JCL?
DD (Data Definition) statements define the data files that a program uses during execution.
How do you specify multiple input files for a single job step?
Use concatenation in the DD statement to specify multiple datasets under a single DD name.
What is the difference between NEW, MOD, and OLD in DISP parameters?
NEW creates a new dataset, MOD modifies or extends an existing dataset, and OLD assumes the dataset already exists and will be used as is.
How do you delete a dataset after job execution?
Set DISP=(NEW,DELETE) for temporary datasets or DISP=(OLD,DELETE) for existing datasets to ensure they are removed after use.
How do you handle multiple output datasets in JCL?
Define separate DD statements for each output dataset, ensuring that each has appropriate DISP and SPACE parameters.
What does a disposition of (MOD,DELETE,DELETE) mean?
It specifies that append the data to the dataset, file deleted if step execution is not successful or unsuccessful.
How much space OS allocates when you create a PS or PDS?
OS allocates the space according to the values coded in the SPACE parameters by the user. This parameter defines the primary and secondary space allocations and the unit of allocation (e.g., cylinders, tracks, or blocks).
What is the purpose of the RECFM parameter in DD statement?
It is used to define the record format for the new dataset. It specifies the structure of the records in the dataset, such as their length (fixed or variable) and storage structure (blocked or unblocked).
How is a fixed block file created using the DD statement?
A fixed block (FB) file is created using the DD statement in JCL by specifying the RECFM=FB parameter and providing the LRECL (logical record length) and BLKSIZE (block size).
What is the max block size for a Tape file?
The maximum block size for a tape file in JCL is 32,760 bytes. This limit ensures compatibility and efficient processing across various tape devices and systems.
Libraries -
Describe the difference between STEPLIB and JOBLIB?
JOBLIB applies to all EXEC statements within a job; STEPLIB is specific to a single EXEC statement within a job step.
Input & Output Statements -
What are the ways of passing data to a COBOL program from JCL?
Data can be passed to a COBOL program from JCL in the following ways:
- Using PARM Parameter
- Using Input Files
- Using SYSIN DD Statement
What is an instream dataset, and how do you define it?
Instream data is defined directly within the JCL using DD * and can be used for input data that doesn't require a physical dataset.
Why do you use a control card?
A control card in JCL is used to provide runtime parameters, control statements, or directives to programs or utilities being executed.
How you will the direct the data to spool using SYSOUT option?
Using SYSOUT=*
Can you define the term "Control Cards" in JCL?
Control cards are typically specified using the SYSIN DD statement.
Conditional Statements -
What is the significance of the COND parameter?
COND (condition) controls the execution of job steps based on the success or failure of previous steps.
How do you ensure a job step runs only if the previous step fails?
COND=ONLY
What will happen if you attempt to restart a job in the middle of a JCL // IF .... // ENDIF?
If you attempt to restart a job in the middle of a JCL // IF ... // ENDIF construct, the restart might fail or behave unpredictably because conditional processing might not be properly evaluated or reset. It's generally recommended to restart the job at a logical step outside the conditional block to ensure consistent and correct processing.
A JCL has 2 steps. How to code the JCL such that if step1 abends, then step2 runs. Else, job terminates with step1?
//IFSTEP IF STEP1.RC = 0 THEN
//STEP2 EXEC ....
//IFSTEPE ENDIF.
A JCL has 10 steps. How to run step4 and step7 (only) without using COND parameter or IF-THEN-ELSE?
IEBEDIT is used to select specific steps of JCL that needs to be run. In the above JCL, the input JCL with 10 steps is present in MTH.PROD.JCLLIB(INPUTJOB). STEP4 and STEP7 is specified in SYSIN of IEBEDIT, so that those two steps are run.
//STEP001 EXEC PGM=IEBEDIT
//SYSUT1 DD DSN=MTH.PROD.JCLLIB(INPUTJOB),DISP=SHR
//SYSUT2 DD SYSOUT=(*,INTRDR)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
EDIT TYPE=INCLUDE,STEPNAME=(STEP4,STEP7)
/*
In order to execute step2 a job after a return code of 8 in step1, what condition you will code in step2?
//STEP1 EXEC PGM=P1
//STEP2 EXEC PGM=P2,COND=(8,NE)
Temporary Datasets -
What is a temporary dataset in JCL?
Temporary datasets are created and used during the execution of a job. These datasets are temporary and deleted at the end of the job (not at the end of the step).
How do you create a temporary dataset in JCL?
Define a DD statement with DISP=(NEW,DELETE) and a temporary name (e.g., DSN=&&temp).
How do you optimize the use of temporary datasets?
Manage temporary datasets using DISP parameters to ensure they are deleted after job completion, reducing storage waste.
What DISP parameter we mention for creation of temporary dataset so that we can use it in later steps?
DISP=(NEW,PASS,)
Concatenating Datasets -
How are datasets concatenated?
//DDname DD DSN=dataset1,...
// DD DSN=dateset2,...
// DD .....
// DD DSN=datasetn,...
What are the rules to concatenate the datasets?
The concatenating datasets should be of -
- Same type
- Same length
- Same characterstics
Can we concatenate datasets of different record length?
No
Can we concatenate datasets of different characterstics like block length, etc?
Yes (if record length and dsn type is same)
Procedures (PROCs) -
Name different JCL statements that are not permitted in the procedures?
It wont allow any statements other than CNTL, command, DD, ENDCNTL, EXEC, IF/THEN/ELSE/ENDIF, INCLUDE, OUTPUT JCL, and SET statements only.
How do you update or modify an existing PROC?
Update the PROC in its catalog or library, and ensure any changes are reflected in all JCLs that invoke it.
How can you override a DD statement in a PROC?
Provide a DD statement with the same name in the JCL that calls the PROC to override the original DD statement.
Can you execute a PROC from another PROC?
Yes, Only Cataloged PROC.
How do you restart a PROC from a particular step?
RESTART=stepname[.proc-stepname]
Can you code instream data in a PROC?
No, you cannot code instream data (data between DD * and /*) directly within a PROC. Instead, you should pass the data using a symbolic parameter and specify the instream data in the calling JCL.
State difference between an instream and a catalogued Procs?
PROC definition is part of the JOB where it invoked. | PROC defintion is outside of the JOB where it invoked. |
PROC is available to the JOB where it defined. | PROC is available to all JOB by using the defintion library (PROCLIB). |
Its defintion should start with a PROC statement and end with a PEND statement. | Its defintion should start with a PROC statement and PEND is optional. |
Can code upto 15 instream procs in one JCL. | Can code upto 255 procs in one JCL. |
Symbolic Parameters -
What are symbolic parameters, and how are they used in JCL?
Symbolic parameters act as placeholders that can be replaced with actual values when a PROC is executed, allowing for flexibility.
Is there any limitation to reference the symbolic parameter?
No.
A SET statement is used to define commonly used symbolic across job steps or procedures. It initializes the previous values in the symbolic names. It has to be defined before the first use of the symbolic names in the JCL. State whether true or false?
True. The SET statement is used to define or initialize symbolic variables that can be commonly used across job steps or procedures. It must be defined before the first use of the symbolic names in the JCL to ensure that all references to the symbolic variables are resolved correctly during job processing.
How are symbolic parameters used to define catalogue procedures, and what is an example of updating an input file name?
Symbolic parameters in JCL are used in cataloged procedures to allow for the dynamic substitution of values at runtime, making procedures more flexible and reusable. These parameters act as placeholders that are replaced by actual values when the method is invoked.
Example of defining a cataloged procedure with a symbolic parameter for an input file name:
//MYPROC PROC,DSN=MTH.DATA.INPUT1
//STEP1 EXEC PGM=MYPROG
//INPUT DD DSN=&DSN,DISP=SHR
//PEND
Example of invoking the procedure and updating the input file name:
//JOB1 JOB ...
//S1 EXEC MYPROC,DSN=MTH.DATA.INPUT,DISP=SHR
Overriding Parameters -
What is the significance of overriding parameters?
Overriding parameters is a technique that allows us to replace the coded parameter values temporarily. This technique is mainly used to replace the parameter values coded in the PROC from the calling JCL. This way, we can modify all parameter values without changing the actual PROC.
How many ways we can override the parameters?
Overriding parameter can be done in 3 ways - Replacing existing parameter, Adding new parameter and Nullify existing parameters.
There is a concatenated input DD name with 3 datasets. How to override only one dataset in those 3 datasets?
Specify DD DUMMY in the overriding JCL for the ones, which are not overridden.
//STEP1.INPUT DD DUMMY
// DD DUMMY
// DD DSN=MTH.DATA.INP3,DISP=SHR
How do you override a specific DDNAME/SYSIN in PROC from a JCL?
//STEP1.INPUT DD DSN=MTH.DATA.INP3,DISP=SHR
Referback -
What is the significance of referback in JCL?
The referback (backward reference) is used to get the information from the previous steps to the current step. This process reduces redundant coding and syntax errors. "*" is used as a referback operator.
How to refer the ddname from specific step?
*.stepname.ddname
How to refer the ddname from proc name if it has one step?
*.proc-stepname.ddname
Error Dump Statements -
What is the significance of error dump statements?
The error dump can be used for debugging and troubleshooting. System administrators can use error dumps to identify and correct these issues, helping to ensure the stability and reliability of the system as a whole.
What is SYSABEND statement significance?
It used to specify the system dump dataset in the JCL. When a program or job step terminates abnormally, the system writes a dump of the program storage to a dataset code with SYSABEND.
Abends -
What is a S0C4 error?
What is a Protection exception error?
An S0C4 error in JCL indicates a Protection Exception, which occurs due to an invalid memory address access. This error can be caused by -
- Addressing memory outside the program's allocated range.
- COBOL – An invalid address referenced due to a subscript error or a bad parameter being passed.
- COBOL – In group move, receiving record variable length is defined incorrectly.
- COBOL – Tried moving variable length record, which was larger than the target field size.
- COBOL – Tried to read or write a file that was not open.
- COBOL – Used DD DUMMY with logic that moves high values to FD.
- COBOL – Tried to call within COBOL during the SORT I/O procedure.
- COBOL – Tried to “GOBACK” in the SORT output procedure.
- COBOL – The linkage area is not in sync with the calling and called program.
- COBOL – Missing Select statement (during compile).
- The block size and record size were coded as equal for variable-length records.
- Tried moving variable length records larger than the target field size.
- An uncontrolled loop moved data on top of instructions.
- Referencing a field in a record of a closed file, e.g., attempting to read a file after the end of the file is reached.
- Referencing an item in Linkage-Section when there was no PARM= in the JCL.
- Calling/called programs have different lengths for items passed in the Linkage Section with COBOL Sort.
- STOP RUN or GOBACK executed while an input or output procedure is still running.
What is S0C7 abend?
What is a data exception?
An S0C7 error in JCL indicates a Data Exception, which occurs when a program encounters invalid numeric data during arithmetic operations. This error can be caused by -
- Un-initialized index or subscript. Coding past the maximum allowed subscript.
- Fields in decimal arithmetic overlap incorrectly
- Index or subscript value incorrect and invalid data referenced.
- The decimal multiplicand has too many high-order significant digits.
- Not initialized data fields.
- Program attempting to do math on illegal data.
- Data is not numeric, but it should be. Numeric operation on non-numeric data
- Moving ZEROS to group items whose subordinate items are packed-decimal
- Uninitialized packed-decimal fields.
- The record description is wrong.
- The field starts or ends in the wrong place in the record.
What are SB37 abend?
An SB37 abend indicates that an end-of-volume condition was reached and there was no more space available for the dataset. This occurs when a dataset runs out of space on the disk and no secondary space allocation is defined or available. It signifies a space allocation failure that requires increasing the space allocation or adjusting the dataset's storage parameters.
What are SD37 abend?
An SD37 abend indicates that the primary space allocation for a dataset has been exceeded, and no secondary space allocation is defined. This occurs when a dataset needs more space than initially allocated and cannot extend further because no additional space has been specified. It signifies a space allocation issue that requires modifying the space parameters to include secondary allocations.
What are SE37 abend?
A SE37 abend indicates that a dataset has reached its maximum allowable extent limit. This occurs when a dataset requires more space. Still, it has already used the maximum number of extents allowed by the system. It signifies a space allocation problem that initially requires restructuring the dataset or allocating more space.
Other -
What is the role of SMF records in JCL?
SMF (System Management Facility) records provide detailed job run data, useful for auditing and performance monitoring.
What is the purpose of the INCLUDE statement?
The INCLUDE statement is used to insert commonly used code snippets or parameter lists from an external member into the JCL stream.
Is it possible to submit JCL from COBOL?
Yes
What diagnostic messages are provided by SYSPRINT and SYSOUT systems?
SYSPRINT typically contains messages generated by the execution of utility programs or system tasks, detailing steps, processes, or errors encountered during execution. SYSOUT is used to collect output from executed programs, often including logs, results, and other diagnostic information. Both are crucial for debugging and monitoring the status of jobs run on a mainframe.
How DUMMY is used in JCL?
The DUMMY parameter is used to specify a dataset that does not physically exist. It's typically used in the DD (Data Definition) statement. When DUMMY is specified, it means that any input or output usually directed to a dataset will instead go nowhere or come from nowhere, effectively ignoring that step's data requirements.
What two modes can you create data sets, and how can you use utility mode?
Datasets can be created in two modes: cataloged and uncataloged.
- Cataloged: These datasets are registered in a system catalog, which tracks the dataset's location and attributes, allowing them to be accessed by name without specifying a volume.
- Uncataloged: These datasets are not registered in the system catalog. They must be accessed by specifying both the name and the volume on which they reside.