ITJOBSHUB JCL Interview Questions
ITJOBSHUB JCL Interview Questions
Secondary allocation is done when more space is required than what has
already been allocated
3. 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
- That this is a new Data Set and needs to be allocated, to CATLG the Data
Set if the step is successful and to delete the Data Set if the step abends.
- That this is a new Data Set and needs to be allocated, to CATLG the Data
Set if the step is successful and to KEEP but not CATLG the Data Set if the
step abends Thus if the step abends, the Data Set would not be catalogued
and we would need to supply the Vol ser the next time we refer to it
The MOD will cause the Data Set to be created (if it does not exist), and then
the two DELETE will cause the Data Set to be deleted whether the step
abends or not This disposition is used to clear out a Data Set at the beginning
of a job
9. What do you do if you do not want to keep all the space allocated
to a Data Set?
Specify the parameter RLSE ( release ) in the SPACE. Eg:
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 Data Set will not exist
beyond the JCL
11. How do you create a temporary Data Set? Where will you use
them?
Temporary Data Sets 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 Data Set
will not be retained once the job completes
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
Can use either condition codes or use the jcl control statement IF (only in ESA
JCL)
14. A PROC has five steps Step 3 has a condition code How can you
override/nullify this condition code?
Provide the override on the EXEC stmt in the JCL as follows: //STEP001 EXEC
procname,CONDstepname=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 Eg, if
you already have a Data Set with dsn = 'xxxxyyyy' 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 Data Set exists(this
info is in the msglog of the job) and cataloging it
Storage violation error - can be due to various reasons eg: READING a File
that is not open, invalid address referenced due to subscript error
All indicate Data Set 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
21. Why do you want to specify the REGION parameter in a JCL 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
22. What does the TIME parameter signify ? What does TIME=1440
mean ?
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
25. How do you check the syntax of a JCL without running it?
TYPERUN=SCAN on the JOB card or use JSCAN
Used to copy one SAM File to another Source Data Set should be described
using SYSUT1 ddname Destination Data Set 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
28. I have multiple jobs ( JCLs with several JOB cards ) in a member
What happens if I submit it?
Multiple jobs are submitted (as many jobs as the number of JOB cards)
29. I have a COBOL program that ACCEPT some input data How do
you code the JCL statement for this? ( How do you code instream
data in a JCL?
No
One way is to code SYSIN DD DUMMY in the PROC, and then override this
from the JCL with instream data
32. How do you run a COBOL batch program from a JCL? How do you
run a COBOL/DB2 program?
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
34. What is order of searching of the libraries in a JCL?
First any private libraries as specified in the STEPLIB or JOBLIB, then the
system libraries such as SYS1LINKLIB The system libraries are specified in the
linklist
JOBLIB is ignored
The library with the largest block size should be the first one 37.
How to change default proclib ?
38. The DISP in the JCL is MOD and the program opens the File in
OUTPUT mode What happens ?
The DISP in the JCL is SHR and the pgm opens the File in EXTEND mode What
happens ?
Records will be written to end of File (append) when a WRITE is done in both
cases
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 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 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 .
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
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
49B. Explain concatenating Data Sets ?
DISP=MOD is used when the Data Set can be extended, ie, you can add
records at the end of an existing Data Set
51. What are the keywords associated with DCB? How can you
specify DCB information? What is the OS precedence for obtaining
that DCB information, ie where does the system look for it first?
The keywords associated with the DCB parameter are LRECL, RECFM,
BLKSIZE and DSORG The DCB information can be supplied in the DD
statement The system looks for DCB information in the program code first
COND specifies the conditions for executing the subsequent job step The
value after the COND= is compared to the return codes of the preceding
steps and if the comparison is true, the step is bypassed (If this answer
confuses you, welcome to the club - memorize it and don't ask questions!).
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.
The value after the PARM= specifies control information to be passed to the
executing program of the job step
56. What is the purpose and meaning of the REGION keyword and
what JCL statement is it associated with?
REGION specifies the maximum CPU memory allocated for a particular job or
job 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 .
57. What is the purpose and meaning of the TIME keyword and what
JCL statement is it associated with?
TIME specifies the maximum CPU time allocated for a particular job or job
step If TIME is in the JOB card, it relates to the entire job; if in the EXEC
statement, it relates to the job step.
58. 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
For an output File DUMMY specifies that the output is to be discarded For
input it specifies that the File is empty.
60. What does the keyword DCB mean and what are some of the
keywords ?
associated IT DCB stands for data control block; it is a keyword for the DD
statement used to describe Data Sets Keywords associated with it are
BLKSIZE, DEN, LRECL and RECFM.
62. What are all the JCL statements used in JCL? & What are the JCL
statements you have coded so far?
//JOB marks the beginning of a job, contains job information //EXEC marks the
beginning of a job step, identifies program, cataloged procedure to be
executed //DD (data definition), identifies a data set and its attributes
//OUTPUT (specifies processing options for system output(sysout) data sets)
//(null) (end of job) /* (end of data placed in input stream) //PROC (procedure)
//PEND (procedure end) //* (comment)
63. What is the difference between the positional parameters &
keyword parameters, give examples where they are used?
All the Positional and Key word parameters in the JOB statement. Accounting
Information, MSGCLASS, CLASS, MSGLEVEL, NOTIFY, USERID, PASSWD, COND,
REGION, RESTART.
65. How many characters can be coded for a job name? What were
you coding as a job name?
66. What is the difference between the Comment statement and the
Comments?How they were coded in a JCL?
//* is the comment statement and it starts from column number 1 Anything
that is written after 71st column is taken as a comment.
67. How will you check the syntax of the JOB without executing it?
Can use JSCAN.Code TYPRUN=SCAN and submit the JCL for syntactical errors.
DISP (Disposition): The DISP parameter describes the status of a data set to
the system, what is to be done with the data set at the end of the job step,
and what to do with the data set if the step terminates abnormally DCB (Data
control black) : DCB=(LRECL=NN, BLKZIZE=YY,RECFM=Z,DSORG=MM) Z can
be F, FB, V, VB MM Can be PS (physical sequence) PO (partitioned) DSN (Data
set name) : UNIT : Identifies device of data set Space :
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. //DD1 DD
DSNAME=&SYSUID..PROFILE,DISP=(NEW,KEEP),
72. Can you explain the DISP Parameter in detail? What are the
default DISP Parameters?
Through PARM Clause coded on the EXEC statement. The parameters have to
be defined in the Linkage Section of COBOL program.
75. What is a GDG?< How will you create a GDG? Can a GDG be used
for Partitioned Data sets ?
A GDG is Generation Data Group. GDG’S allow users to create multiple data
sets with the same base name distinguished by a logical number. History files
can be referenced by using a negative generation number. GDG base can be
created using a utility (IEBPROGM or IDCAMS) With (+1) we will be creating.
EX: //OUTDD DD DSN=QZ6P03T.ARUN.MASTER(+1) (Create new data set)
//INDD DD DSN=QZ6P03T.ARUN.MASTER(+0) (Reference most current data
set). Yes - GDG can be sequential, direct, or partitioned Organization and can
be reside on tape or direct-access volumes GDG must always be cataloged
Creating a Model Data Set Label (or control block, DSCB) This label is a data
set which contains DCB attributes and is usually referred to in the DCB
parameter when creating new GDG data sets. Most shops create the model
DSCB with no DCB attributes.
77. What for the Model data set used for a GDG? How much space
will you give to the Model Data set ?
The system needs an existing data set to serve as a model supplying the DCB
parameters for the GDG to you want to create. The system uses the data set
label to obtain the DCB sub-parameters, and the model is called the DSCB for
reasons lost to history. Need not specify any space while creating a model
data set.
The maximum number of GDG versions that can be created is 255. A GDG
data set is created with “(+1)” appended to the name of the GDG base.
79. What is the E37 error?How will you resolve it with out losing a
single byte of data?
(Hint: This Error comes when you save the data set after editing it)
Insufficient Space.
Bad Subscript/index
Protection Exception
Bad Subscript/index
A: In your JCL define as: //JOBA JOB 1111,JOB1 //STEP01 EXEC PGM=PROG1
//ddname DD SYSOUT=(*,INTRDR)....and your COBOL (PROG1) should look
like this: SELECT JCL-FILE ASSIGN TO ddname. Open this file and write the JCL
statements into this file. Example: MOVE '//TESTJOB JOB 1111,VISVEISH' TO
JCL-REC.MOVE '//STEP01 EXEC PGM=IEFBR14' TO JCL-REC.and close this file.
Then TESTJOB will be submitted.
A: Pass all the JCL codes to a COBOL variable (should be declared using
OCCURS clause) and then write the line one by one to the spool using CICS
commands like SPOOLClose, SPOOLOpen and SPOOLWrite. For more help
refer CECI of CICS or CICS manual.
A: TIME=1440
A: S0C7 - Data exception error - you will get it whenever you are trying to
move the low values or spaces into the numeric field, or compare the
numeric fields with low values, or try to do some arithmetic operations on the
low values. To avoid this you have to always initialize the numeric fields
otherwise they will contain the low values.
Q: How to pass the temp dataset form one JOB step to another?
A: 15.
A: JCL, which changes during run time,that is the values for the JCL such as
program name, dd name will change. The same JCL can be used for various
jobs, equivalent to dynamic SQL;
Q: What is JCL
A TYPRUN= SCAN checks the JCL for errors, TYPRUN= HOLD holds the job
until further notice.
A: This error is faced when we execute the Cobol program. The main reason
for this error is that a variable is defined with fewer characters and we are
trying to move data, which is larger than the actual storage space.
A: RCT
Q: What is a GDG?
A: This is managed by JES. This is used for Queuing the Outputs that are
intended for Printing and are first stored in SPOOLDASD.
A: 15
A: 248 DAYS
A: SIX
A: 3273
A: 56 KB
A: SIX
A: 255
Q: What is DSNDB06?
A: IEFBR14 is a Dummy utility and it is used for the sakeof EXEC PGM= ....
statement in JCL [when used it wouldn’t perform any task]. e.g. While
Allocating a dataset you don't have to run any utility [this could be done by
giving disp=new in DD statment]. But for a PGM name must be given in EXEC
statment, it is used.
A: SPACE= (n,m) for a sequential file, SPACE= (n,m,p) for a PDS where n, m,
and p are numbers. The p designates how many directory blocks to allocate.
A: 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.
More or less same as the IEBGENER
A: No
Q: What are the maximum and minimum sizes of any CONTROL AREA
(VSAM datasets)?
A: There are three (3) parameters: Parameter 1: Current data set disposition
(NEW, SHR,OLD,MOD) Parameter 2: Normal close action for data set (CATLG,
KEEP, DELETE) Parameter 3: Abend action for data set (CATLG, KEEP, DELETE)
Q: What is COMP?
Q: What is a PROCEDURE?
A: A set of precoded JCL that can be modified through the use of parameters
or override cards. Note: Procedures can be catalogued or instream.
A: Instream data follows this card and is terminated when followed by a card
containing // or /* in columns 1 and 2.