Mainframe Interview Questions
Mainframe Interview Questions
ENVIRONMENT DIVISION
CONFIGURATION SECTION –
INPUT-OUTPUT SECTION –
DATA DIVISION
PROCEDURE DIVISION
Contains logic and STOP RUN for calling pgms and EXIT PROGRAM for called pgms
Area: Columns
12-72 = Area B
2. What are the different data types available in COBOL?
Alpha-numeric (X) –> Max 160, alphabetic (A) –> A-Z and numeric (9) -> Max 18.
3. What does the INITIALIZE verb do? Alphabetic, Alphanumeric fields & alphanumeric
edited items are set to SPACES. Numeric, Numeric edited items set to ZERO. Group
items advantage.
General Purpose: 01 to 49 can be used. Group Items – Won’t have a PIC clause and can
be used from 01 to 48. Elementary data items – will be under a group item with PIC clause
02 to 49.
Special Purpose:
66 Level - RENAMES – Regrouping of Elementary data items {Logical group from group of
elements} – 66 Level number – No PIC clause & Cannot rename 01,77,88 or other 66 level
items & also elementary items with OCCURS clause
01 A.
05 ITEM1 PIC X (5).
05 ITEM2 PIC X (5).
05 ITEM3 PIC X (5).
05 ITEM4 PIC X (5).
66 B RENAMES ITEM2 THRU ITEM4.
77 Level – Independent items (Can’t be subdivided further) – must be declared in AREA A.
88 Level – sub-ordinate to other data items (01 - 49)– Requires NO memory. I want to you
process records having Jan Month, how can we do this in COBOL? Using Condition names
01 EMP-SALARY-LEVELS PIC 9 (09).
88 FRESHER VALUE 50 TO 100.
88 SENIOR VALUE 150 TO 300.
88 MANAGER VALUE 400 TO 500.
88 PRESIDENT VALUE 600 TO 900.
01 ARRAYS.
Subscript Index
No of occurrences of an array. No of displacement positions of an array.
It will be declared in WORKING-STORAGE Index need not be declared in WORKING-
SECTION. STORAGE SECTION.
Slow in access. Index is faster.
Initialized by using MOVE statement. Index is initialized by using SET operator.
Incremented by using ADD operator. Incremented by SET UP BY operator.
No need to declare INDEXED BY clause. INDEXED BY clause is used to declare along with
occurs.
Subscript refers to the array occurrence while index is the displacement (in no of bytes) from
the beginning of the array. An index can only be modified using PERFORM, SEARCH &
SET. Need to have index for a table in order to use SEARCH, SEARCH ALL.
IDENTIFICATION DIVISION.
PROGRAM-ID. PERFTIMI.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 SECTION.
02 STUDENT.
03 SUBJECT PIC 9(3) OCCURS 6 TIMES INDEXED BY SEQ.
PROCEDURE DIVISION.
PERFORM SEQ FROM 1 BY 1 UNTIL SEQ > 6
ACCEPT MARKS[SEQ]
END-PERFORM.
SET SEQ TO 1.
SEARCH – is a serial search. SEARCH ALL – is a binary search & the table must be sorted
(ASCENDING/DESCENDING KEY clause to be used & data loaded in this order) before
using SEARCH ALL.
[Link] should be the sorting order for SEARCH ALL? It can be either ASCENDING or
DESCENDING. ASCENDING is default. If you want the search to be done on an array
sorted in descending order, then while defining the array, you should give DESCENDING
KEY clause. (You must load the table in the specified order).
[Link] is binary search? Search on a sorted array. Compare the item to be searched with
the item at the centre. If it matches, fine else repeat the process with the left half or the right
half depending on where the item lies.
[Link] program has an array defined to have 10 items. Due to a bug, I find that even if the
program accesses the 11th item in this array, the program does not abend. What is wrong
with it? Must use compiler option SSRANGE if you want array bounds checking. Default is
NOSSRANGE. – It is COBOL COMPILER option & specified in parm of IGYCRCTL
[Link] do you sort in a COBOL program? Give sort file definition, sort statement syntax
and meaning.
Syntax:
1. Opens file1 (workfile) in I-O mode, file2 in INPUT mode and file3 in OUTPUT mode.
3. Copies the sorted records to file3 and deletes workfile. Closes file2 and file3.
USING can be substituted by INPUT PROCEDURE IS para-1 THRU para-2 GIVING can be
substituted by OUTPUT PROCEDURE IS para-1 THRU para-2.
file-1 is the sort workfile and must be described using SD entry in FILE SECTION.
file-2 is the input file for the SORT and must be described using an FD entry in FILE
SECTION and SELECT clause in FILE CONTROL.
file-3 is the outfile from the SORT and must be described using an FD entry in FILE
SECTION and SELECT clause in FILE CONTROL. file-1, file-2 & file-3 should not be
opened explicitly.
INPUT PROCEDURE is executed before the sort and records must be RELEASED to the
sort work file from the input procedure. OUTPUT PROCEDURE is executed after all records
have been sorted. Records from the sort work file must be RETURNed one at a time to the
output procedure.
MERGE
USING file2, file3 giving file4 – Same steps as above SORT verb
Work file is file1, input files – file2, file3, output file – file4
[Link] do you define a sort file in JCL that runs the COBOL program? Use the
SORTWK01, SORTWK02….. dd names in the step. Number of sort datasets depends on
the volume of data being sorted, but a minimum of 3 is required.
17. What are the restrictions with in COBOL SORT? Restrictions – Cannot massage
records, cannot select records to be sorted.
[Link] is the difference between performing a SECTION and a PARAGRAPH? Performing
a SECTION will cause all the paragraphs that are part of the section, to be performed.
Performing a PARAGRAPH will cause only that paragraph to be performed.
[Link] is the use of EVALUATE statement? Evaluate is like a case statement and can be
used to replace nested Ifs. The difference between EVALUATE and case is that no ‘break’ is
required for EVALUATE i.e. control comes out of the EVALUATE as soon as one match is
made.
Simple EVALUATE –
EVALUATE ws-var
WHEN 01 – do this
WHEN 02 – do this
WHEN OTHER
END-EVAUATE
EVALUATE TRUE
WHEN ws-var = 10
WHEN ws-var = 15
WHEN OTHER
END-EVALUATE.
EVALUATE THRU
EVALUATE ws-var
END-EVALUATE.
WHEN I = 0 ALSO A = 0
WHEN B = 9 ALSO A = 4
END-EVALUATE.
[Link] do you come out of an EVALUATE statement? After the execution of one of the
when clauses, the control is automatically passed on to the next sentence after the
EVALUATE statement. There is no need of any extra code.
[Link] an EVALUATE statement, can I give a complex condition on a when clause? Yes.
[Link] is a scope terminator? Give examples. Scope terminator is used to mark the end of
a verb e.g. EVALUATE, ENDEVALUATE; IF, END-IF.
[Link] would you use in-line perform? When the body of the perform will not be used in
other paragraphs. If the body of the perform is a generic type of code (used from various
other places in the program), it would be better to put the code in a separate para and use
PERFORM Para name rather than in-line perform.
[Link] is the difference between CONTINUE & NEXT SENTENCE? CONTINUE is like a
null statement (do nothing) and transfers control to next COBOL verb, while NEXT
SENTENCE transfers control to the next sentence (!!) (A sentence is terminated by a period)
[Link] does EXIT do? Does nothing! If used, must be the only sentence within a
paragraph in OSVS COBOL. In COBOL II you can have other statements along with EXIT.
[Link] I redefine an X (100) field with a field of X (200)? Yes. Redefines just causes both
fields to start at the same location. For example:
If you MOVE ‘12’ to WS-TOP-RED, DISPLAY WS-TOP will show 1 while DISPLAY WS-
TOP-RED will show 12. This works only if the level number is 01. If the respective level
numbers were saying 05, then you will get a severe error in compilation.
31. Redefines? REDEFINES clause allows to use same memory location with different
name. Already REDEFINED can’t be REDEFINED again. Can be used with level numbers
01 to 49 & 77. 66 & 88 can’t be REDEFINED. Only applicable on same group level. Size
may or may not be same as the variable which u want to REDEFINE. REDEFINED can be
done by changing the USAGE clause as well. If any one of the data is modified then
automatically the other one will get modified as they use same memory location.
31. Data Justifications? Justifications come if data size of input variable is larger or smaller
than output variable.
Ex: 9374896296 is X (8) & moving it is X (4) THEN output will have 6296
6296 is in X (4) and moving to X (8) THEN output will have 00006296
Ex: ABHISHEK is X (8) & moving it is X (4) THEN output will have ABHI
ABHI is in X (4) and moving to X (8) THEN output will have ‘ABHI ‘
[Link] do you do to resolve SOC-7 error? Basically, you need to correct the offending
data. Many times, the reason for SOC7 is an un-initialized numeric item. Examine that
possibility first. Many installations provide you a dump for run time abends (it can be
generated also by calling some subroutines or OS services thru assembly language). These
dumps provide the offset of the last instruction at which the abend occurred. Examine the
compilation output XREF listing to get the verb and the line number of the source code at
this offset. Then you can look at the source code to find the bug. To get capture the runtime
dumps, you will have to define some datasets (SYSABOUT etc) in the JCL. If none of these
are helpful, use judgement and DISPLAY to localize the source of error. Some installation
might have batch program debugging tools. Use them.
Ex: 9.999 value needs to be stored in COMP-1 then it will be stored like 9999 * 10^-3
10^-3 is stored in left most 8 bits and 9999 is stored in remaining 24 bits.
COMP-2: Applicable to Double precision floating point (stored in Hexa decimal form)
Ex: 9.999 value needs to be stored in COMP-2 then it will be stored like 9999 * 10^-3
10^-3 is stored in left most 12 bits and 9999 is stored in remaining 52 bits.
COMP-3: Data will be stored in Packed Decimal format – 2 digits in each byte. Amount, QTY
fields.
33. How is sign stored in Packed Decimal fields and Zoned Decimal fields?
Packed Decimal fields: Sign is stored as a hex value in the last nibble (4 bits) of the storage.
Zoned Decimal fields: As a default, sign is over punched with the numeric value stored in the
last byte.
It is stored in the last nibble. For example, if your number is +100, it stores hex 0C in the last
byte, hex 1C if your number is 101, hex 2C if your number is 102, hex 1D if the number is -
101, hex 2D if the number is -102 etc…
COMP-1 – Single precision floating point. Uses 4 bytes. COMP-2 – Double precision
floating point. Uses 8 bytes.
Will take 4 bytes. Sign is stored as hex value in the last nibble. General formula is INT((n/2)
+ 1)), where n=7 in this example.
[Link] many bytes does a S9(7) SIGN TRAILING SEPARATE field occupy ?
4 bytes.
[Link] is the maximum value that can be stored in S9(8) COMP?
99999999
ATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-STRING PIC A(30).
01 WS-STR1 PIC A(15) VALUE 'Tutorialspoint'.
01 WS-STR2 PIC A(7) VALUE 'Welcome'.
01 WS-STR3 PIC A(7) VALUE 'To AND'.
01 WS-COUNT PIC 99 VALUE 1.
PROCEDURE DIVISION.
STRING WS-STR2 DELIMITED BY SIZE
WS-STR3 DELIMITED BY SPACE
WS-STR1 DELIMITED BY SIZE
INTO WS-STRING
WITH POINTER WS-COUNT
ON OVERFLOW DISPLAY 'OVERFLOW!'
END-STRING.
WS-STRING : WelcomeToTutorialspoint
WS-COUNT : 25
UNSTRING – ‘Delimited by’ clause is compulsory
PROCEDURE DIVISION.
UNSTRING WS-STRING DELIMITED BY SPACE
INTO WS-STR1, WS-STR2, WS-STR3
END-UNSTRING.
WS-STR1 : WELCOME
WS-STR2 : TO
WS-STR3 : TUTORIALSPOINT
ORGANIZATION IS SEQUENTIAL
Indexed Sequential file organization – Records stored in sort order based on key
and can be accessed fast using key. Duplicate records not allowed. Specific record
reading and deleting is possible in indexed files. Indexed files are stored on DISK not
on tape – VSAM (KSDS)
ORGANIZATION IS INDEXED
ORGANIZATION IS RELATIVE
ORGANIZATION IS SEQUENTIAL
ORGANIZATION IS INDEXED
ORGANIZATION IS RELATIVE
ORGANIZATION IS INDEXED
ACCESS MODE IS RANDOM
ORGANIZATION IS RELATIVE
ORGANIZATION IS SEQUENTIAL
ORGANIZATION IS INDEXED
ORGANIZATION IS RELATIVE
[Link] do you reference the following file formats from COBOL programs:
pgm + 4.
KSDS VSAM file – Use ORGANISATION IS INDEXED, RECORD KEY IS, ALTERNATE
RECORD KEY IS RRDS File – Use ORGANISATION IS RELATIVE, RELATIVE KEY IS
Printer File – Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F,
BLOCK CONTAINS 0. (Use RECFM=FBA in JCL DCB).
[Link] is the mode in which you will OPEN a file for writing? – GS
OUTPUT, EXTEND
[Link] the JCL, how do you define the files referred to in a subroutine?
Supply the DD cards just as you would for files referred to in the main program.
[Link] you REWRITE a record in an ESDS file? Can you DELETE a record from it?
Logic error. e.g., a file is opened for input and an attempt is made to write to it.
Mismatch in LRECL or BLOCKSIZE or RECFM between your COBOL pgm & the JCL (or the
dataset label). You will get file status 39 on an OPEN.
In static linking, the called subroutine is link-edited into the calling program , while in dynamic
linking, the subroutine & the main program will exist as separate load modules. You choose
static/dynamic linking by choosing either the DYNAM or NODYNAM link edit option. (Even if
you choose NODYNAM, a CALL identifier (as opposed to a CALL literal), will translate to a
DYNAMIC call).
A statically called subroutine will not be in its initial state the next time it is called unless you
explicitly use INITIAL or you do a CANCEL. A dynamically called routine will always be in its
initial state.
DYNAM.
54. What if you forgot to close file in Cobol pgm? If any of the Opened file not closed, then the
execution completion of the program will close all the files which are used in the program.
STATIC Call:
DYNAMIC CALL
1) Identified by Call variable and the variable should be populated at run time.
01 WS-PGM PIC X(08).
Move ‘PGM1’ to WS-PGM
CALL WS-PGM
Ex: If Sometimes we need to divide something by 0 , then ON SIZE ERROR is used to avoid
SOCB abend
Common Abends (Mainframe Top Interview Questions/Mainframe Refresher/Mainframe FAQ)
4. s878 : region size is not enough. Increase the value you have specified in REGION parameter
of JOB statement or in EXEC step.
6. s0c4: storage related problem. Check your linkage section, table definition, and FD section.
7. JCL error: file attributes doesn’t match; I have given RECFM=VB, RECLEN is same as that
specified in FD section. Why do I get this error? For variable record format files you should add 4
bytes to record length in DCB.
8. s0c7 : Invalid character in COMP/COMP-3 numeric field – check all COMP/COM-3 numeric
fields and arithmetic operations.
10. S722 – The Sysout or spool is full. You program is writing too many things to Sysout.
Increase job’s sysout limit by specifying ‘LINES=(150,WARNING)’ option in job statement and
then retry. This will increase your sysout limit to ‘150’ thousand lines.
3)In how many ways you can provide physical order of data?
4)What is deadlock?How the job will determine a deadlock and how do you
come out of it?
5)what is isolation level in DB2 and its types?
Dept table has dept name and [Link] table hasemployee id,name
and dept id?
9)What is time parm in JCL? If job has time parm as 10 and three steps in it
has 5 each what will happen in this scenario?
Then in FILE SECTION of DATA DIVISION, FD file descriptor is specified for the file where
record length , type of record (FB,VB) is specified along with record layout.
records can be read using READ and can be written using WRITE/REWRITE statement.
CAPGEMINI, PUNE
ACCENTURE,PUNE
INFOSYS,PUNE
COGNIZAT,PUNE.
READ MASTER-FILE
READ MASTER-FILE
MOVE 'WIPRO,PUNE' TO MASTER-REC
REWRITE MASTER-FILE FROM MASTER-REC.
REWRITE MASTER-FILE FROM MASTER-REC.
CAPGEMINI, PUNE
WIPRO,PUNE
INFOSYS,PUNE
COGNIZAT,PUNE.
File has been opened in input output mode. And first two records are read.
After that pointer now points to the second record in the file.
Now if REWRITE operation is performed, pointer will point to the second
record and second record will be overwritten. After rewrite, pointer will
still point to the second record in the file and same record will be
overwritten.
In both Programs Prog A and Prog B, file should be defined as external in FD. Also in both
the programs, file should be defined in FILE CONTROL using SELECT clause.
PROG A opens a file and calls prog B. Since file is already opened in PROG A, no open
statement required in PROG B.
And Then Prog B can write into the file.
DELETE
ERASE
None of the above verbs can be used to delete the record from the PS file.
Records from INPUT file needs to be read one by one and at a same time, those should
be written in OUTPUT file.
9. If ORGANIZATION is defined as
SEQUENTIAL and ACCESS MODE is defined
as INDEXED in SELECT clause, then the file
must be one of these -> KSDS, RRDS, LDS,
ESDS, PS?
If ORGANIZATION IS SEQUENTIAL then the ACCESS MODE must be SEQUENTIAL ONLY.
And these properties are for PS file only.
For KSDS, ORGANIZATION should be INDEXED and access mode can be defined as
SEQUENTIAL, RANDOM, DYNAMIC.
For ESDS, ORGANIZATION should be sequential and access mode can be defined as
sequential.
for RRDS, ORGANIZATION should be relative and access mode can be defined as
SEQUENTIAL, RANDOM, DYNAMIC.
FD filename
DATA RECORDS ARE rd01, rd02, rd03.
01 rd01 PIC X(n).
01 rd02 PIC X(n).
01 rd03 PIC X(n).
1. Runs scored by 15 players into 25 matches needs to be stored into array.
What kind of array is required to store the same - single or multidimensional?
Define an array.
To store runs of 25 matches for 15 players, two dimensional array will be required.
PLAYER-NAME stores name of player which occurs 15 times and it has been defined as
X(25). Also for each player, MATCH-RUNS has been defind which occurs 25 times.
Using Search
Serial search can be used. First Player Name = "SACHIN" is found using PL-INDEX. Once it
is found then using PL-INDEX, all the run scored by SACHIN can be found out.
SET PL-INDEX TO 1
SET RUN-INDEX TO 1
SEARCH PLAYER-DATA
WHEN PLAYER-NAME(PL-INDEX) = "SACHIN "
DISPLAY 'PLAYER FOUND'
AT END
PERFORM P100-EXIT
END-SEARCH
P1000-EXIT.
EXIT.
SET PL-INDEX TO 1
SET RN-INDEX TO 1
PERFORM UNTIL END-OF-TABLE
IF PL-INDEX = 15
SET END-OF-TABLE TO TRUE
END-IF
END-PERFORM
In binary search data is search using SEARCH-ALL verb. Table will be devided into two
parts and key will be tested. If the key to be searched lies in first part, then second part
will be elliminated and search will continue in first [Link] will repeat until key is
found or no specified key found in table.
If no specified key found, then action specified at AT END clause is performed.
Also for binary search, table needs to have key and data must be in sorted order on a
key. If the data is not like this , then serial search is performed.
5. Can SEARCH and SEARCH ALL be used to find records in a sequential file?
SEARCH and SEARCH all cannot be used to find data in sequental file directly. They can
be used with tables which are declared in the program in DATA division.
However, file records can be loaed into table and they can be searched.
A subscript is a working storage data definition item, typically an interger PIC (999)
where a value must be moved to the subscript and then incremented or decremented by
ADD TO and SUBTRACT FROM statements. Subscript represents an occurence number of
a table within a table.
An index is a register item that exists outside the program's working storage. You SET an
index to a value and SET it UP BY value and DOWN BY value. An index is displacement
from the start of table based upon length of table element.
With above definition, WS-STUDENTS will be variable length table. Depending upon value
in WS-ADM-COUNT, occurences of WS-STUDENT-NAME will be set.
if WS-ADM-COUNT has value 50, then above table will have data for 50 occurences or
allocate data into storage for 50 occurences.
10. A two dimensional array has been defined in following way. What it does?
Above definition is wrong, since OCCURS clause cannot be specified at 01 [Link] two dimensional
array is required, above defintion can be modified as
01. WS-TABLE-GROUP.
05 WS-TABLE OCCURS 10 TIMES PIC X(3).
10 WS-TABLE2 OCCURS 5 TIMES PIC X(5).
VSAM Questions
KSDS record can be accessed by primary key. ESDS record can be accessed
randomly with displacement address (RBA)
[Link] is SHAREOPTIONS?
It states how the file will be shared between jobs, batch and CICS
//AS-TRANS DD DSN=xyz
ESDS extensively used in online CICS. Since CICS can get access to record
through “RBA”
[Link] is default?
CA/CI level spilts causes performance degradation. If splits are more it causes
more I/O, and reduce the performance.
[Link] is verify?
//SYSIN DD *
PRINT INDATASET([Link].V339000) DUMP
ALTER [Link] UNINHIBIT
ALTER [Link] UNINHIBIT
VERIFY DATASET([Link])
LISTC ENT([Link]) ALL
/*
JCL
JCL-FAQs (Mainframe Top Interview Questions/Mainframe Refresher/Mainframe
FAQ)
IF THE JOB CARD HAS TIME=NOLIMIT/1440, all time parameters coded in the EXEC
statements are nullified. All those steps will have unlimited time to execute.
1. STEP1 should run for 2 mins as 2 is smaller than 6 (job card time value)
2. STEP2 should run for only 4 minutes as (job card has 6 and 2 already completed
so it has only 4)
2. What is the difference between primary and secondary allocations for a dataset?
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 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.
MSGLEVEL
TYPRUN – HOLD -> puts the job on HOLD in the job queue
TIME=(mm, ss) or TIME=ss – specifies the span toa be used by the processor
to execute the job.
If a temporary dataset created by a job step is to be used in the next job step, then it
is referenced as DSN=*.[Link]. This is called Backward Referencing.
KEEP is the only valid disposition for VSAM files. This is to be used only for
permanent datasets.
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 .
9. What do you do if you do not want to keep all the space allocated to a dataset? – GS
[Link] 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.
11. How do you create a temporary dataset? Where will you use them?
In job card, specify RESTART= [Link] 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? – GS
Provide the override on the EXEC stmt in the JCL as follows: //STEP001 EXEC
procname,[Link]=value All parameters on an EXEC stmt in the proc such as
COND, PARM have to be overridden like this.
//<[Link]> DSN=…
[Link] is NOTCAT 2 – GS
This is an MVS message indicating that a duplicate catalog entry exists. E.g., if you
already have a dataset with dsn = ‘[Link]’ 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.
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.
[Link] 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.
[Link] is COND=EVEN ?
Means execute this step even if any of the previous steps, terminated abnormally.
[Link] is COND=ONLY ?
Means execute this step only if any of the previous steps, terminated abnormally.
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.
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 ACCEPTs some input data. How do you code the JCL
statment for this? (
No.
One way is to code SYSIN DD DUMMY in the PROC, and then override this from the JCL
with instream data.
[Link] 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.
First any private libraries as specified in the STEPLIB or JOBLIB, then the system libraries
such as [Link]. The system libraries are specified in the linklist.
JOBLIB is ignored.
[Link] you specify mutiple datasets in a JOBLIB or STEPLIB, what factor determines the
order? – GS
The library with the largest block size should be the first one.
[Link] to change default proclib ?
[Link] 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 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.
Statements –
Messages –
TYPRUN = SCAN OR HOLD (Hold the job until operator release the job)
STEPLIB – private library where COBOL programs will be searched for – MAX 255 steplibs
in job – Picks libs in the order they are coded
JOBLIB – private library where COBOL program LOADs will be searched for - Picks libs in
the order they are coded – But steplibs overrides joblib
JCLLIB – Identify private librabries – PROCs stored and group of JCL stats on INCLUDE.
SYSABEND – Dumps info if job abended abnormally. If job ran fine, even though
SYSABEND is coded it will not produce dump – SYSABEND DD -> summary of dumping
program
SYSMDUMP DD – same as above but DUMP is unformatted & only Abend dumps nothing
else
IEFBR14 – Create
What happens If we OPEN INPUT for a file having DISP=NEW? Logical error with file
status code
If file is OPEN INPUT-OUTPUT mode – if you close and open then records are still there.
If file is OPEN INPUT-OUTPUT mode then DISP shouldn’t be OLD – Check this
DISP parameter –
NEW
MOD
COMP 32767 – If I send 30000 it will take if I send 40000 it wont take
Can I have 2 job cards in the JOB – 255, each job is separately spooled in spool
area.
A job can have a maximum of 255 job steps
Max DD statements – 3273 in a job.
JCL Statements – JOB, EXEC, DD – Only 3 statements
Can I submit the without EXEC & DD and only with JOB CARD??
POSITIONAL Parameters – If we give parm instead of proc or pgm – syntax
error will come – ‘Positional parameters missing’. So PGM & PROC are
positional parameters in EXEC statement.
Account information is a positional parameter in JOB statement.
Condition parameter – will control the flow of job execution. If don’t mention
the condition parameter then job will execute step by step – COND
One more parameter is RESTART parameter – Condition parameter.
3steps in my job.
S1 p1 – a b c
S2 p2 - def
S3 p3 – xyz
Execute from y
RESTART – [Link] in the proc – S3.Y
Nested procedures in RESTART
3steps – 4,3,2,1 – IEBEDIT utility – Create one more job – Control card lo
give step4,3,2,1 ddname – where job resides. So submit iebedit job don’t
need to submit main job.
COND= (RC, Relational operator, STEPNAME) –
COND=ONLY – Only previous step abend then only it should execute
COND=EVEN