JCL (JOB CONTROL LANGUAGE) Frequently Asked Questions (FAQS)
JCL (JOB CONTROL LANGUAGE) Frequently Asked Questions (FAQS)
Q9) What is the difference between the JOBLIB and the STEPLIB statements?
A9) The JOBLIB statement is placed after the JOB statement and is effective for all job steps. It
cannot be placed in a
cataloged procedure. The STEPLIB statement is placed after the EXEC statement and is
effective for that job step
only. Unlike the JOBLIB statement, the STEPLIB can be placed in a cataloged procedure.
Q10) Name some of the JCL statements that are not allowed in procs.?
A10) Some of the JCL statements which are not allowed in procedures are:
1. JOB, Delimiter(/*), or Null statements
2. JOBLIB or JOBCAT DD statements
3. DD * or DATA statements
4. Any JES2 or JES3 control statements
Q12) What is the difference between primary and secondary allocations for a dataset?
A12) Secondary allocation is done when more space is required than what has already been
allocated.
Q13) How many extents are possible for a sequential file ? For a VSAM file ?
A13) 16 extents on a volume for a sequential file and 123 for a VSAM file.
Q19) What do you do if you do not want to keep all the space allocated to a dataset? - GS
A19) Specify the parameter RLSE ( release ) in the SPACE e.g.
SPACE=(CYL,(50,50),RLSE)
Q21) How do you create a temporary dataset? Where will you use them?
A21) 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.
Q24) A PROC has five steps. Step 3 has a condition code. How can you override/nullify this
condition code? - GS
A24) 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.
Q31) Why do you want to specify the REGION parameter in a JCL step? - GS
A31) 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.
Q32) What does the TIME parameter signify ? What does TIME=1440 mean ?
A32) 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.
Q35) How do you check the syntax of a JCL without running it?
A35) TYPERUN=SCAN on the JOB card or use JSCAN.
Q36) What does IEBGENER do?
A36) Used to copy one QSAM file to another. Source dataset should be described using
SYSUT1 ddname. Destination dataset should be described using SYSUT2. IEBGENR can also do
some reformatting of data by supplying control cards via SYSIN.
Q37) How do you send the output of a COBOL program to a member of a PDS?
A37) Code the DSN as PDS (member) with a DISP = SHR. The DISP applies to the PDS and
not to a specific member.
Q38) I have multiple jobs ( JCLs with several JOB cards ) in a member. What happens if I
submit it?
A38) Multiple jobs are submitted (as many jobs as the number of JOB cards).
Q39) I have a COBOL program that Accepts some input data. How do you code the JCL
statement for this?
( How do you code instream data in a JCL? )
A39) //SYSIN DD*
input data
input data
/*
Q42) How do you run a COBOL batch program from a JCL? How do you run a COBOL/DB2
program?
A42) To run a non DB2 program,
//STEP001 EXEC PGM=MYPROG
Q46) When you specify mutiple datasets in a JOBLIB or STEPLIB, what factor determines the
order? - GS
A46) The library with the largest block size should be the first one.
Q48) 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 program opens the file in EXTEND mode. What
happens ?
A48) Records will be written to end of file (append) when a WRITE is done in both cases.
Q51) What are the causes for S0C1, S0C4, S0C5, S0C7, S0CB abends ?
A51) S0C1-May be due to 1.Missing or misspelled DD name 2.Read/Write to unopened
dataset 3.Read to dataset opened
output 4.Write to dataset opened input 5.Called subprogram not found
S0C4-may be due to 1.Missing Select statement(during compile) 2.Bad Subscript/index 3.Protection
Exception
4.Missing parameters on called subprogram 5.Read/Write to unopened file 6.Move data
from/to unopened file
S0C5-May be due to 1.Bad Subscript/index 2.Closing an unopened dataset 3.Bad exit from a
perform 4.Access to I/O
area(FD) before read
S0C7-may be due to 1.Numeric operation on non-numeric data 2.Un-initialize working-storage
3.Coding past the
maximum allowed sub script
S0CB-may be due to 1.Division by Zero
Q54) Describe the JOB statement, its meaning, syntax and significant keywords?
A54) 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.
Q55) Describe the EXEC statement, its meaning, syntax and keywords?
A55) 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.
Q57) What is a PROC? What is the difference between an instream and a catalogued PROC?
A57) 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 dataset.
Q58) What is the difference between a symbolic and an override in executing a PROC?
A58) 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.
Q62) What is the difference between specifying DISP=OLD and DISP=SHR for a dataset?
A62) DISP=OLD denotes exclusive control of the dataset; DISP=SHR means there is no
exclusivity.
Q64) 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?
A64) 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.
Q66) What is the meaning of the EXEC statement keyword, COND? What is its syntax?
A66) 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!)
Q69) What is the purpose and meaning of the REGION keyword and what JCL statement is it
associated with?
A69) 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.
Q70) What is the purpose and meaning of the TIME keyword and what JCL statement is it
associated with?
A70) 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.
Q71) What is the meaning of data definition name (ddname) and dataset name (dsname) in the
DD statement?
A71) 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. Dataset name is the operating
system (MVS) name for the file.
Q73) What does the keyword DCB mean and what are some of the keywords associated with it?
A73) DCB stands for data control block; it is a keyword for the DD statement used to describe
datasets. Keywords associated with it are BLKSIZE, DEN, LRECL and RECFM.
Q76) What will happen if you attempt to restart a job in the middle of a JCL // IF .... // ENDIF?
A76) Job will fall through to the ENDIF (not executing any steps), then resume execution with
the first step AFTER the // ENDIF.
Q78) What are three parameters you can specify on Job statement as well as on exec stmt ?
A78) Time, Region and Cond parameters
Q81) How do you pass parameters to the program as the job is being executed ?
A81) By using 'parm' parameter in exec statement. the value mentioned here should be
declared in linkage section in the program and process thru procedure division. this technique is
very useful when you do not know the parameters at the time of coding the programs.
Q85) What is the parameter to be passed in the job card for the unlimited time , irrespective of
the job class ?
A85) TIME=1440
Q88) How to pass the temp dataset form one JOB step to another?
A88) By specifying the DISP as PASS for the temp dataset
Q93) The maximum number of in-stream procedure you can code in any JCL is ?
A93) Fifteen(15).
Q99) What does the statements: typrun=scan and typrun=hold do in a JCL statement
A99) typrun=scan checks the JCL for errors, typrun=hold holds the job until further notice.
Q100) Which is the most widely used batch performance monitor for DB2?
A100) DB2PM
Q112) How much is memory space involved, when we code BLOCKSIZE,TRK & CYL ?
A112) One block constitutes 32KB of formatted memory/ 42KB of Unformatted memory,6
blocks makes one Track & 15 Tracks makes one cylinder.
Q118) On the DD statement, what is the main difference between creating a new sequential flat
file and a partitioned dataset?
A118) 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.
Q119) What is the difference between IEBGENER, IEBCOPY and REPRO in IDCAMS
utility?
A119) IEBGENER -- This is a dataset utility for copying sequential datasets which produces a
PDS or a member from a
sequential dataset.
IEBCOPY -- This is a dataset utility for copying one PDS to another or to merge PDSs.
REPRO -- This is for copying sequential datasets. More or less same as the IEBGENER.
Q122) What is the difference between static call & Dynamic call ?
A122) In the case of Static call, the called program is a stand along program, it is an executable
program . During run time we can call it in our called program. As about Dynamic call, the called
program is not an executable program it can executed thru the called program
Q123) What is the difference between catalogue procedure and In-Stream procedure?
A123) In Stream 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 procedure is cataloged on the procedure library and is called by specifying
the procedure name on the EXEC statement.
Q126) What are the maximum and minimum sizes of any CONTROL AREA (VSAM datasets)
?
A126) Minimum Size : 1 track Maximum size : 1 cylinder
Q128) How many parameters are there to a DISP statement and what are their uses ?
A128) 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).
Q131) What is the difference between specifying DISP=OLD and DISP=SHR for a dataset?
A131) OLD specifies exclusive use of a dataset, SHR allows multiple jobs to concurrently
access the dataset Note: When updating a dataset, you would normally use OLD.
A133) Instream data follows this card and is terminated when followed by a card containing //
or /* in columns 1 and 2.
Q134) What are three major types of JCL statements? What are their functions?
A134) JOB - indicates start of jobstream 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).
9. List down the different types of comparison operators & their meaning .
17. Name the system library from which modules are retrieved at execution time .
19. If JOBLIB & STEPLIB statements are both included in a job , then which statement would
overide .
25. What are the two ways of specifying Temporary Data Sets ?
26. What are the advantages of coding the DISP parameter with MOD rather than NEW ?
32. What are the functions of the following ddnames : SYSUDUMP , SYSABEND ,
SYSMDUMP