Dear Readers, Welcome to IBM JCL Interview Questions and Answers have been designed specially to get you acquainted with the nature of questions you may encounter during your Job interview for the subject of IBM JCL. These IBM JCL Questions are very important for campus placement test and job interviews. As per my experience good interviewers hardly plan to ask any particular questions during your Job interview and these model questions are asked in the online technical test and interview of many IT companies.
The space allocated when the dataset is first created.
Secondary allocation is done when more space is required than what has already been allocated.
16 extents on a volume for a sequential file and 123 for a VSAM file.
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.
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.
Need to supply volume serial no. VOL=SER=xxxx.
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.
Unless allocated earlier, will have the foll parameters: DISP=(NEW,CATLG,DELETE), UNIT , SPACE & DCB .
Specify the parameter RLSE ( release ) in the SPACE e.g. SPACE=(CYL,(50,50),RLSE)
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.
Temporary datasets can be created either by not specifying any DSNAME or by specifying the temporary file indicator as in DSN=&&TEMP.
We use them to carry the output of one step to another step in the same job. The dataset will not be retained once the job completes.
In job card, specify RESTART=procstep.stepname
where procstep = name of the jcl step that invoked the proc
and stepname = name of the proc step where you want execution to start
Can use either condition codes or use the jcl control statement IF (only in ESA JCL)
Provide the override on the EXEC stmt in the JCL as follows:
//STEP001 EXEC procname,COND.stepname=value
All parameters on an EXEC stmt in the proc such as COND, PARM have to be overridden like this.
// DSN=...
This is an MVS message indicating that a duplicate catalog entry exists. E.g., if you already have a dataset with dsn = 'xxxx.yyyy' and u try to create one with disp new,catlg, you would get this error. the program open and write would go through and at the end of the step the system would try to put it in the system catalog. at this point since an entry already exists the catlg would fail and give this message. you can fix the problem by deleting/uncataloging the first data set and going to the volume where the new dataset exists(this info is in the msglog of the job) and cataloging it.
Caused by invalid data in a numeric field.
Storage violation error - can be due to various reasons. e.g.: READING a file that is not open, invalid address referenced due to subscript error.
All indicate dataset out of space. SD37 - no secondary allocation was specified. SB37 - end of vol. and no further volumes specified. SE37 - Max. of 16 extents already allocated.
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.
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.
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.
Means execute this step even if any of the previous steps, terminated abnormally.
Means execute this step only if any of the previous steps, terminated abnormally.
TYPERUN=SCAN on the JOB card or use JSCAN.
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.
Code the DSN as pds(member) with a DISP of SHR. The disp applies to the pds and not to a specific member.
Multiple jobs are submitted (as many jobs as the number of JOB cards).
//SYSIN DD*
input data
input data
/*
No.
One way is to code SYSIN DD DUMMY in the PROC, and then override this from the JCL with instream data.
To run a non DB2 program,
//STEP001 EXEC PGM=MYPROG
To run a DB2 program,
//STEP001 EXEC PGM=IKJEFT01
//SYSTSIN DD *
DSN SYSTEM(....)
RUN PROGRAM(MYPROG)
PLAN(.....) LIB(....) PARMS(...)
/*
Specifies that the private library (or libraries) specified should be searched before the default system libraries in order to locate a program to be executed.
STEPLIB applies only to the particular step, JOBLIB to all steps in the job.
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.
JOBLIB is ignored.
The library with the largest block size should be the first one.
//ABCD JCLLIB ORDER=(ME.MYPROCLIB,SYS1.PROCLIB)
Records will be written to end of file (append) when a WRITE is done in both cases.
PS - QSAM, PO - Partitioned, IS - ISAM
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 executes.
JES3 allocates Data Sets for all the steps before the job is scheduled. In JES2, allocation of Data Sets Required by a step are done only just before the step executes. JOB /EXEC/DD ALL PARAMETERS JOBLIB/STEPLIB PROCEDURES, PARAMETERS PASSING CONDITION VARIABLES ABEND CODES.
The JOB, EXEC and DD statement
A keyword in a JCL statement may appear in different places and is recognized by its name, eg MSGCLASS in the JOB statement The opposite is positional words, where their meaning is based on their position in the statement, eg in the DISP keyword the =(NEW,CATLG,DELETE) meaning are based on first, second and third position.
The JOB statement is the first in a JCL stream Its format is // jobname, keyword JOB, accounting information in brackets and keywords, MSGCLASS, MSGLEVEL, NOTIFIY, CLASS, etc .
The EXEC statement identifies the program to be executed via a PGM=program name keyword Its format is //jobname EXEC PGM=program name The PARM= keyword can be used to pass external values to the executing program.
The DD statement links the external Data Set name (DSN) to the DDNAME coded within the executing program It links the File names within the program code to the File names know to the MVS operating system The syntax is // ddname DD DSN=Data Set name Other keywords after DSN are DISP, DCB, SPACE, etc .
PROC stands for procedure It is 'canned' JCL invoked by a PROC statement An instream PROC is presented within the JCL; a catalogued PROC is referenced from a proclib partitioned Data Set.
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
A RESTART is a JOB statement keyword It is used to restart the job at a specified s step rather than at the beginning
GDG stands for generation data group It is a Data Set with versions that can be referenced absolutely or relatively It is defined by an IDCAMS define generation datagroup execution