What is JCL?
JCL is Job Control Language and is used for Batch processing. The startup procedures of OS and standard products like CICS etc are written in JCL. It is interface between operating system(MVS) & application program. when 2 related programs are combined together on control statements is called job control language
What are three major types of JCL statements? What are their functions?
JOB – indicates start of job stream to the operating system and through parms coded on it, certain details about the job (time, region, message level, job accounting data).
EXEC – indicates the start of execution of a particular job step, be that step a program or a proc.
DD – is a data definition, which is used to describe the attributes of a data set (name, unit, type, space, disposition).
What is the use of JCL?
It is used for the deleting creating, the Data Sets, GDG’S and VSAM clusters.
It is used for comparing the files and PDS members
It is used for compiling and executing the programs which includes batch programs as well
It is used for merging and sorting of file data
What is a Generation Data Group (gdg)?
A generation Data Group is a group of chronologically or functionally related datasets. GDGs are processed periodically, often by adding a new generation, retaining previous generations, and sometimes discarding the oldest generation.
Name some of the JCL statements that are not allowed in procs?
Some of the JCL statements which are not allowed in procedures are:
JOB, Delimiter (/*), or Null statements
JOBLIB or JOBCAT DD statements
DD * or DATA statements
Any JES2 or JES3 control statements
What are the basic JCL Statements for a Job?
- JOB: Identifies a job and supplies accounting info
- EXEC: Identifies a job step by indicating the name of the program to be executed
- DD: Identifies a data set to be allocated for the job step
- Delimiter (/*): Marks the end of an in-stream dataset
- Null (//): Marks the end of a job
- Comments (//*): Provides Comments
- PROC: Marks the beginning of a procedure
- PEND: Marks the end of a procedure
- OUTPUT: Supplies options for SYSOUT processing.
How JCL works?
JCL recognizes the program to be executed, the inputs that are required and location of the input/output and informs the Operating System through Job control Statements.
What is primary allocation for a dataset?
The space allocated when the dataset is first created.
How many extents are possible for a sequential file? for a VSAM file?
16 extents on a volume for a Sequential File and 123 for a VSAM File
What is COND=EVEN?
Means execute this step even if any of the previous steps, terminated abnormally.
What is COND=ONLY?
Means execute this step only if any of the previous steps, terminated abnormally.
What is the syntax of JCL statement?
The syntax of JCL statement is,
//Job-name JOB Positional-param, Keyword-param
What is RESTART? How is it invoked?
RESTART is a JOB statement keyword. It is used to restart the job at a specified step rather than at the beginning.
How do you restart a step in JCL?
What is the purpose of the job statement?
The purpose of the JOB statement is to inform the operating system of the start of a job, give necessary accounting information and supply run parameters. Each job must begin with a single JOB statement.
How are in-stream procedures (procs) built?
In-stream procedures are built by coding a set of statements and placing them after the JOB statement and before the EXEC statement. In-stream procedures begin with a PROC statement and end with a PEND statement. Up to 15 in-stream procedures can be included in a single job.
Each in-stream procedures may be invoked several times within the job. In-stream procedures can use symbolic parameters in the same way as catalogued procedures.
What is an operation exception error?
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 file that was not opened a misspelled DD statement. The system completion code is 0C1.
What is the meaning of data definition name (dd name) and data set name (dsn name) in the dd statement?
Data definition name is the eight-character designation after the // of the DD statement It matches the internal name specified in the steps executing program In COBOL that’s the name specified after the ASSIGN in the SELECT ASSIGN statement Data Set name is the operating system (MVS) name for the File.
What is the purpose of the parm keyword in the exec statement?
The value after the PARM= specifies control information to be passed to the executing program of the job step
What is the improvement to cond= in the latest version of mvs?
MVS now allows for an IF bracketed by an END IF around any job step to replace the COND= syntax Again, if the IF statement is true, the step is bypassed.
What is the difference between a symbolic and an override in executing a proc?
A symbolic is a PROC placeholder; the value for the symbolic is supplied when the PROC is invoked, eg &symbol=value an override replaces the PROC’s statement with another one; it substitutes for the entire statement.
What are SD37, SB37, SE37 abends?
All these abends are related to dataset out of space.
SD37 – This will occur if no secondary allocation was specified.
SB37 – This abend signifies the end of vol. and no further volumes specified.
SE37 – This abend comes if Max. of 16 extents already allocated.
What are S0C1, S0C4, S0C5, S0C7 and SOCB?
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.
What are the difference between JCL and JES?
JCL:
JCL is a language.
JOBs written in JCL for Mainframe.
JOB is executed, space and other desired resource is allocated by the keywords of JCL.
JES:
JES is a subsystem of MVS.
JES handle the JOBs submitted by the users.
JES takes the control of JCL and generates JOB id.
JES validates JCL for errors.
What is DSN parameter and DISP parameter is used for?
DISP parameter: It is used to specify the disposition of dataset which is coded on DSN parameter
DSN parameter: It is used to specify the data set name
What does IEBGENER do?
Used to copy one QSAM file to another. Source dataset should be described using SYSUT1 ddname. Destination dataset should be decribed using SYSUT2. IEBGENR can also do some reformatting of data by supplying control cards via SYSIN.
What is the use of IEBGENER utility?
The use of IEBGENER utility is used for copying the data from
one PS to another PS
OR Member of a PDS to another PS
OR PS to member of PDS.
What is the difference between JES3 and JES2?
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.
What is the purpose of the RESTART parameter in JCL?
The RESTART parameter is used to restart a job from a specific step after an abend (abnormal end) has occurred. It allows the job to continue processing from the point of failure instead of starting from the beginning.
What is a symbolic parameter in JCL?
A symbolic parameter in JCL is a placeholder that is used to represent a value or a set of values. It allows for dynamic substitution of values at runtime, providing flexibility and reusability in JCL. Symbolic parameters are defined using the “&” symbol, and their values can be passed from the JCL invocation or from previous steps in the same job.
What is the difference between a JCL library and a JCL procedure?
A JCL library is a collection of JCL members or datasets that contain JCL code. It is used to store and organize JCL statements for reuse across multiple jobs.
A JCL procedure, on the other hand, is a predefined set of JCL statements that perform a specific task or a series of tasks. It is used to encapsulate a commonly executed sequence of JCL statements, making it easier to maintain and reuse code.
How do you conditionally execute a step based on the completion code of a previous step?
To conditionally execute a step based on the completion code of a previous step, you can use the COND parameter in the EXEC statement of the subsequent step. The COND parameter specifies a condition code that must be satisfied for the step to be executed.
For example, to execute step2 only if step1 completed with a return code of 0, you can use the following syntax:
//STEP2 EXEC PGM=PROGRAM,COND=(0,NE)
How can you override a parameter in a JCL step?
To override a parameter in a JCL step, you can use the OVERRIDE keyword in the EXEC statement of that step. The OVERRIDE keyword allows you to provide a new value for a specific parameter without modifying the original JCL code.
For example, to override the value of a symbolic parameter called &PARM in a step, you can use the following syntax:
//STEP1 EXEC PGM=PROGRAM,PARM=’&PARM’,OVERRIDE.PARM=’NEW_VALUE’
What is a PROC statement in JCL?
A PROC statement is used to define a JCL procedure. It specifies the name of the procedure and any parameters that can be passed to it. PROC statements are typically placed in a JCL library and can be invoked by using the EXEC statement with the procedure name.
How can you pass parameters to a JCL procedure?
Parameters can be passed to a JCL procedure using the PARM parameter in the EXEC statement that invokes the procedure. The PARM parameter allows you to provide values for the parameters defined in the PROC statement.
For example, to pass a value of ‘123’ to a parameter called &PARM in a procedure named MYPROC, you can use the following syntax:
//STEP1 EXEC MYPROC,PARM=’123′
What is the difference between specifying DISP=OLD and DISP=SHR for a dataset?
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=SHR: Its read-only file. In this, multiple user can share the data
How can you specify the position and length of a dataset to be used in a JCL step?
To specify the position and length of a dataset to be used in a JCL step, you can use the DD (Data Definition) statement in JCL. Within the DD statement, you can provide the dataset name and various parameters to define its position and length.Â
In JCL, you can specify the position and length of a dataset using the following parameters within the DD statement:
- DISP: This parameter defines the disposition of the dataset, including its primary and secondary allocations, and whether it should be deleted or retained after job completion.
- Â SPACE: This parameter allows you to specify the primary and secondary allocations, as well as the block size and the amount of space to allocate for the dataset.
- DCB: The DCB (Data Control Block) parameter specifies the attributes of the dataset, such as the record format (RECFM), record length (LRECL), and block size (BLKSIZE).
What does a disposition of (NEW, CATLG, DELETE) mean?
That this is a new dataset and needs to be allocated, to CATLG the dataset if the step is successful and to delete the dataset if the step abends.
What does a disposition of (NEW, CATLG, KEEP) mean?
That this is a new dataset and needs to be allocated, to CATLG the dataset if the step is successful and to KEEP but not CATLG the dataset if the step abends. Thus if the step abends, the dataset would not be catalogued and we would need to supply the vol. ser the next time we refer to it.
What does a disposition of (MOD, DELETE, DELETE) mean?
The MOD will cause the dataset to be created (if it does not exist), and then the two DELETEs will cause the dataset to be deleted whether the step abends or not. This disposition is used to clear out a dataset at the beginning of a job.
What is DISP=(NEW, PASS, DELETE)?
This is a new file and create it, if the step terminates normally, pass it to the subsequent steps and if step abends, delete it. This dataset will not exist beyond the JCL.
Here are some scenario-based JCL (Job Control Language) interview questions along with their answers:
How would you submit a job in JCL that has a dependency on the successful completion of another job?
 In JCL, you can use the COND parameter to define job dependencies. By specifying COND=(0,NE) on the JOB statement of the dependent job, it will only be submitted if the previous job completes with a return code of non-zero. This ensures that the dependent job is executed only when the prerequisite job succeeds.
Suppose you need to override a dataset name dynamically based on the current date. How would you accomplish this in JCL?
 In JCL, you can use symbolic parameters and the SET statement to dynamically override dataset names based on the current date. Define a symbolic parameter using & symbol, and then use the SET statement to assign the current date value to the symbolic parameter. Finally, reference the symbolic parameter in the dataset name.
How would you conditionally execute a step in JCL based on the presence or absence of a dataset?
 In JCL, you can use the IF statement to conditionally execute a step based on the presence or absence of a dataset. Use the COND parameter on the JOB or EXEC statement with the IF keyword, followed by the desired condition. For example, IF (EXISTS(datasetname)) or IF (NOT EXISTS(datasetname)).
How can you dynamically allocate a dataset in JCL based on certain conditions?
In JCL, you can use the IDCAMS utility to dynamically allocate datasets. By using the IDCAMS DEFINE command, you can specify the dataset attributes and provide parameters to allocate the dataset dynamically. Use symbolic parameters or variables to provide dynamic values for dataset names, space allocations, or other attributes.
How would you handle the restart of a failed job at a specific step in JCL?
 JCL provides the concept of restartable jobs using the RESTART parameter. By specifying RESTART=STEPNAME on the JOB statement, the failed job can be restarted from a specific step instead of restarting from the beginning. This allows for more efficient job processing and reduces the need to reprocess completed steps.
Suppose you need to override a positional parameter passed to a PROC from the JCL. How would you accomplish this?
In JCL, you can override a positional parameter passed to a PROC by using the PARM parameter on the EXEC statement. Specify the desired value for the positional parameter within parentheses after the PARM keyword. For example, PARM=(‘NEWVALUE’).
How would you pass data from one step to another within the same JCL?
 In JCL, you can pass data from one step to another using dataset allocation and disposition. By specifying DISP=(OLD,PASS) on the DD statement of the producing step and DISP=(OLD,KEEP) on the DD statement of the consuming step, you can share the same dataset between the two steps.
How would you override the default position of the output file in JCL?
 In JCL, you can override the default position of the output file using the OUTDISP parameter on the DD statement. Specify OUTDISP=(disp,disp) where “disp” represents the desired disposition of the output file, such as KEEP, CATLG, or DELETE. This allows you to control the disposition of the output file according to your requirements.
Â