Mainframe Questions Pravin Kumar 1 of 45
Mainframe Questions Pravin Kumar 1 of 45
Mainframe Questions Pravin Kumar 1 of 45
Pravin Kumar
Page 1 of 45
-2-
Mainframe Questions
Pravin Kumar
Page 2 of 45
-3-
Mainframe Questions
Pravin Kumar
Page 3 of 45
-4-
Pravin Kumar
Page 4 of 45
-5-
Pravin Kumar
Page 5 of 45
-6-
Pravin Kumar
Page 6 of 45
-7-
Pravin Kumar
Page 7 of 45
-8-
Pravin Kumar
Page 8 of 45
-9-
Mainframe Questions
Pravin Kumar
Page 9 of 45
- 10 -
Pravin Kumar
Page 10 of 45
- 11 -
Pravin Kumar
Page 11 of 45
- 12 -
Pravin Kumar
Page 12 of 45
- 13 -
Mainframe Questions
Pravin Kumar
Page 13 of 45
- 14 -
24. What more info you should give in the DD statement while
defining the next generation of a GDG?
Give (+1) as the generation number, give (new,catlg) for disp, give
space parameter, can give the dcb parameter if you want to
override the dcb of the model dataset.
25. Assuming that the DEFINE jcl is not available, how do you
get info about a VSAM file's organisation ?
Use the LISTCAT command.
26. During processing of a VSAM file, some system error occurs
and it is subsequently unusable What do you do ?
Run VERIFY.
#27 Creating alternate index using IDCAMS
* $$ JOB JNM=CF1PRSR1,CLASS=N,DISP=D,PRI=3,LDEST=NJ004
* $$ LST DISP=K,CLASS=N,DEST=*
// JOB CF1PRSR1
// EXEC PROC=NODEID
// EXEC PROC=MOMSLIBD
// ON $ABEND OR $CANCEL GOTO ABENDJ
// ON $RC>12 GOTO ABENDJ
// GOTO STEP01
/. STEP01
* -------------------------------------------------------------------* CF-SYSTEM
CREATING SYSTEM BACKUP
* JUNE
PRODR0 TO BKUPCFS1
MFCONFR
* --------------------------------------------------------------------// DLBL INCONFR,'PRODR0.SC0500K.MFCONFR',,VSAM,CAT=USRCAT4,
BUFSP=131072
// DLBL OTCONFR,'SRUN1.CF1.SC0500K.MFCONFR',,VSAM,CAT=USRCAT1,
X
BUFSP=131072
// EXEC IDCAMS,SIZE=AUTO
DELETE
DEFINE
Mainframe Questions
Pravin Kumar
Page 14 of 45
- 15 SHAREOPTIONS (2) UNIQUEKEY FREESPACE (15 7)) DATA (NAME (SRUN1.CF1.SC0500K.M2CONFR.@A@D@) CONTROLINTERVALSIZE(2048)) INDEX (NAME (SRUN1.CF1.SC0500K.M2CONFR.@A@I@)) CATALOG (FPSD.USRCAT1)
IF LASTCC NE 0 THEN CANCEL JOB
DEFINE PATH (NAME (SRUN1.CF1.SC0500K.M2CONFR) PATHENTRY (SRUN1.CF1.SC0500K.M2CONFR.@A@) UPDATE) CATALOG (FPSD.USRCAT1)
IF LASTCC NE 0 THEN CANCEL JOB
/*
// DLBL INDATA,'SRUN1.CF1.SC0500K.MFCONFR',,VSAM,CAT=USRCAT1,
X
BUFSP=131072
//
DLBL
OTDATA,'SRUN1.CF1.SC0500K.M2CONFR.@A@',,VSAM,
X
CAT=USRCAT1,BUFSP=131072
// DLBL SORTWK1,'%%DOS.WORKFILE.SYS1',0,VSAM,CAT=USRCAT1,
X
DISP=(NEW,DELETE,DELETE),RECORDS=(60000,0),
X
RECSIZE=25
// EXEC GVBLDIX,SIZE=500K
CLDD=INDATA
AIXDD=OTDATA
MSGLEVEL=3
************************************************************************
Mainframe Questions
Pravin Kumar
Page 15 of 45
- 16 -
Mainframe Questions
Pravin Kumar
Page 16 of 45
- 17 -
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?
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.
12. How do you restart a proc from a particular step?
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
13. How do you skip a particular step in a proc/JOB?
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,COND.stepname=value
All parameters on an EXEC stmt in the proc such as COND,
PARM have to be overridden like this.
15. How do you override a specific DDNAME/SYSIN in PROC
from a JCL?
//<stepname.dd> DSN=...
16. What is NOTCAT 2
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.
17. What is 'S0C7' abend?
Caused by invalid data in a numeric field.
18. What is a S0C4 error ?
Mainframe Questions
Pravin Kumar
Page 17 of 45
- 18 -
Pravin Kumar
Page 18 of 45
- 19 -
Pravin Kumar
Page 19 of 45
- 20 -
Mainframe Questions
Pravin Kumar
Page 20 of 45
- 21 -
9.
Mainframe Questions
Pravin Kumar
Page 21 of 45
- 22 -
Pravin Kumar
Page 22 of 45
- 23 -
23.
Why SELECT * is not preferred in embedded SQL
programs?
For three reasons:
If the table structure is changed ( a field is added ), the
program will have to be modified
Program might retrieve the columns which it might not use,
leading on I/O over head.
The chance of an index only scan is lost.
24. What are correlated subqueries?
A subquery in which the inner ( nested ) query refers back to the
table in the outer query. Correlated subqueries must be evaluated
for each qualified row of the outer query that is referred to.
25. What is a cursor? why should it be used?
Cursor is a programming device that allows the SELECT to find a
set of rows but return
them one at a time. Cursor should be used because the host
language can deal with
only one row at a time.
26. How would you retrieve rows from a DB2 table in embedded
SQL?
Either by using the single row SELECT statements,or by using
the CURSOR.
27. Apart from cursor, what other ways are available to you to
retrieve a row from a table in embedded SQL?
Single row SELECTs.
28. How do you specify and use a cursor in a COBOL program?
Use DECLARE CURSOR statement either in working storage or
in procedure division(before open cursor), to specify the SELECT
statement. Then use OPEN, FETCH rows in a loop and finally
CLOSE.
29. What happens when you say OPEN CURSOR?
If there is an ORDER BY clause, rows are fetched, sorted and
made available for the FETCH statement. Other wise simply the
cursor is placed on the first row.
30. Is DECLARE CURSOR executable?
No.
31. Can you have more than one cursor open at any one time in
a program ?
Mainframe Questions
Pravin Kumar
Page 23 of 45
- 24 -
Yes.
Pravin Kumar
Page 24 of 45
- 25 -
Pravin Kumar
Page 25 of 45
- 26 -
Pravin Kumar
Page 26 of 45
- 27 -
Pravin Kumar
Page 27 of 45
- 28 -
plan
4. Minmize fallback complexities if changes result in an error.
70. What is a collection?
a user defined name that is the anchor for packages. It has not
physical existence. Main usage is to group packages.
71. In SPUFI suppose you want to select max. of 1000 rows ,
but the select returns only 200 rows. What are the 2 sqlcodes
that are returned?
100 ( for successful completion of the query ), 0 (for successful
COMMIT if AUTOCOMMIT is set to Yes).
72. How would you print the output of an SQL statement from
SPUFI?
Print the output dataset.
73. Lot of updates have been done on a table due to which
indexes have gone haywire. What do you do?
Looks like index page split has ocured. DO a REORG of the
indexes.
74. What is dynamic SQL?
Dynamic SQL is a SQL statement created at program execution
time.
75. When is the access path determined for dynamic SQL?
At run time, when the PREPARE statement is issued.
76. Suppose I have a program which uses a dynamic SQL and
it has been performing well till now. Off late, I find that the
performance has deteriorated. What happened?
Probably RUN STATS is not done and the program is using a wrong
index due to incorrect stats.
Probably RUNSTATS is done and optimizer has chosen a wrong
access path based on the latest statistics.
77. How does DB2 store NULL physically?
as an extra-byte prefix to the column value. physically, the nul
prefix is Hex '00' if the value is present and Hex 'FF' if it is not.
78. How do you retrieve the data from a nullable column?
Use null indicators. Syntax ... INTO :HOSTVAR:NULLIND
79. What is the picture clause of the null indicator variable?
S9(4) COMP.
80. What does it mean if the null indicator has -1, 0, -2?
-1 : the field is null
Mainframe Questions
Pravin Kumar
Page 28 of 45
- 29 -
example
of
statistics
collected
during
Mainframe Questions
Pravin Kumar
Page 29 of 45
- 30 -
Pravin Kumar
Page 30 of 45
- 31 -
Pravin Kumar
Page 31 of 45
- 32 -
Mainframe Questions
Pravin Kumar
Page 32 of 45
- 33 -
10. What are SEND MAP MAPONLY & SEND MAP DATAONLY ?
11. What is the difference between a PF key & a PA key ?
Mainframe Questions
Pravin Kumar
Page 33 of 45
- 34 -
PF keys wake up the task and transmit modified data, PA keys only
wake up the task.
12. Name the macros used to define the following:
MAP
MAPSET
FIELD
DFHMSD
DFHMDI
DFHMDF
13. Can you use OCCURS in a BMS map? If you do, what are
the issues related with its use?
Yes. cannot use group by clause???
14. Can you define multiple maps in a BMS mapset?
Yes.
15. How is the storage determined in the symbolic map, if you
have multiple maps?
Storage for maps redefine the first. This means largest map has to
be the first.
16. What is the meaning of BMS length of field = 0?
Data was not entered in the field
17. Can you simply check if length = 0 for checking if a field
was modified?
No, not if ERASE EOF was used.
18. What do you do if you do not want characters entered by the
user to be folded to uppercase ?
Use ASIS option on RECEIVE.
19. What does the BUFFER option in RECEIVE mean ?
Brings the entire datastream from the terminal buffer.
20. What are the steps you go through to a create a BMS
executable?
Assemble to create CSECT and Link
21. When you compile a CICS program, the (pre)compiler puts
an extra chunk of code. Where does it get included and that
is it called? What is its length?
DFHEIBLK, DFHCOMMAREA.
22. List all the CICS tables and explain their contents.
PPT
SIT
PCT
JCT
FCT
SNT
DCT
SRT
RCT
TCT
Mainframe Questions
Pravin Kumar
Page 34 of 45
- 35 -
memory
allocated
within
CICS
28.
What are the restrictions while using GETMAIN and
FREEMAIN?
29. What is the use of a TDQ, TSQ?
Temporary data stores.
30. If I create a TSQ from one transaction, can I read it from
another transaction?
Yes. As long as they run in the same region.
31. What are extra partition & intra partition TDQs?
Extra partition TDQs are datasets used for communication b'n
CICS and other CICS/Batch regions. Intrapartition TDQs are
queues for communication within regn.
32. What is trigger level in the context of TDQs?
For intrapartition TDQs specify the # records at which ATI
happens. not applicable for extra partition TDQs.
33. How do you fire a batch job from a CICS txn ?
Define an extrapartition TDQ as an internal reader and write the
JCL to it. Terminate the JCL with /*EOF.
34. What is ATI? What kind of TDQ can be used?
Automatic Task Initiation. Intra partition TDQ.
35. Do you require a table entry for a TSQ?
If recovery is needed.
36. Is there any entry for TSQs in CICS tables?
Yes in the DFHTST.
Mainframe Questions
Pravin Kumar
Page 35 of 45
- 36 -
Mainframe Questions
Pravin Kumar
Page 36 of 45
- 37 -
If yes, what
Pravin Kumar
Page 37 of 45
File Control
backward.
Commands.
- 38 -
Random,
Sequential,
forward
and
63. How will you access a VSAM file using an alternate index?
Thru the path. Define path as an FCT and use normal File control
commands.
64. How do you rollback data written to an ESDS file?
Define the file as recoverable. in cases where records have been
inserted into the file, you may need to run a batch program to
logically delete the inserted records.
65. I have done a START BROWSE on a VSAM dataset. Can I do
another START BROWSE without doing an END BROWSE?
No.
66. Can you access QSAM (seq ) files from CICS ?
No.
67. Can you access ESDS files from CICS ?
Yes.
General
.Expect questions about your previous projects - be clear about the
functionality, application size(no of tables, no of transactions, no of
batch jobs), tech environment(e.g.: was a job scheduler used ?),
your role .
.You should know what versions of software(DB2, CICS, JES, MVS)
you've worked with.
.Be ready to give specific syntax if asked for. e.g. give the condition
code statement in the JCL.
Have full understanding of the role for which you are being
interviewed.
Mainframe Questions
Pravin Kumar
Page 38 of 45
- 39 -
on-line
transaction
6. Occurrence.
A single occurrence is a segment appearing once in one segment
type with in a database record. Multiple occurrence denotes a
segment type within a database record that appears more than
once.
7. Program control block (PCB)
A control block that defines which segments by database record
that an application program will be allowed to access alog with key
or data sensitivity and processing intent.
8. Program specification Block (PSB).
A control block that contains the program communication block
and describes the logical database structure.
9. Segment search argument (SSA).
A series of values contained in an application program that
identifies the segment name, key or search field and comparative
value that the program desires to retrieve, add, change or delete.
10. Segment.
The unit of information transferred between the database
bufferpool and an application program or transferred between a
terminal and a message queue.
Mainframe Questions
Pravin Kumar
Page 39 of 45
- 40 -
11. Teleprocessing(TP).
Processing that allows continuation
between user and program.
on-line
communication
the
components
of
the
IMS
software
Application
Program
+--------------------------------+
+-------------+ +---------------+
DB
I/O
PCB
PCB
+--------------+ +---------------+
+--------------+ +---------------+
DL/I
IMS Data
Communication
+--------------+ +---------------+
+--------------+ +---------------+
IMS
| terminal
|
Database
|
|
+--------------+ |---------------|
Application program:
You can write these in COBOL,PL/I and Assembler. The programs use
standard
calls to DL/I modules rather than read and write through File
Declares.
DB PCB :
This is a Program Communication Block (PCB) which enables the
program to
communicate with DL/I to get information from the database.
DL/I :
Mainframe Questions
Pravin Kumar
Page 40 of 45
- 41 -
Pravin Kumar
Page 41 of 45
- 42 -
2. Batch-orientated
access on-line database in batch mode
can send messages to the message queue
are scheduled by the operator using JCL
16. How many database are there?
physical and logical
The physical data base is defined in the Data Base Description
(DBD).
The logical data structure is defined in the Program Specification
Block (PSB).
The DBA initiates a process called DBDGEN (database description
generator)
to describe the physical structure of the database and to create a
DBD database
description).
In an IMS database, this logical data structure is referred to as a
PSB
(Program Specification Block).
The PSB is made up of one or more PCB's (Program Communication
Block), and
this defines the logical structure a program will use.
The PSBGEN process produces a load module stored in the PSBLIB
library.
These load modules are called PSB's.
While many application programs can share the same PSB (but
usually do not),
programs can only use one PSB in agiven application. A PSB contains
one or
more PCB's.
The Program Communication Block defines which of the segments in
the database
the program is "sensitive" to (can access).
The PCB also defines how the application program is allowed
process the
segments.
to
Mainframe Questions
Pravin Kumar
Page 42 of 45
- 43 -
Pravin Kumar
Page 43 of 45
- 44 -
Pravin Kumar
Page 44 of 45
- 45 -
Mainframe Questions
Pravin Kumar
Page 45 of 45