Mainframe Question Bank
Mainframe Question Bank
A9)No.
10.What is the difference between index and subscript? GS
A10) 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.
11.What is the difference between SEARCH and SEARCH
ALL? - GS
A11) 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.
12.What should be the sorting order for SEARCH ALL? - GS
A12) 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).
Page 1 of 110
A15)
16.How do you define a sort file in JCL that runs the COBOL
program?
A16) 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 is the difference between performing a SECTION
and a PARAGRAPH? - GS
A17) 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.
18.What is the use of EVALUATE statement? - GS
A18) 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.
19.What are the different forms of EVALUATE statement?
A19)
EVALUATE
WHEN A=B AND C=D
imperative stmt
Page 2 of 110
Page 3 of 110
Page 4 of 110
Page 5 of 110
Page 6 of 110
Page 7 of 110
Page 8 of 110
Page 9 of 110
Page 10 of 110
Basic PERFORM
PERFORM TIMES
PERFORM UNTIL
PERFORM VARYING
IN-LINE PERFORM
Page 11 of 110
Page 12 of 110
Page 13 of 110
Page 14 of 110
Page 15 of 110
Page 16 of 110
Page 17 of 110
Page 18 of 110
Page 19 of 110
Page 20 of 110
Page 21 of 110
Page 22 of 110
Page 23 of 110
Page 24 of 110
Page 25 of 110
Page 26 of 110
29.
30.
31.
32.
What are the functions of the following ddnames : SYSUDUMP , SYSABEND , SYSMDUMP
33.
Page 27 of 110
Page 28 of 110
Functionality
CICS provides the following support:
Data Communications
An interface between the terminal and printers with CICS via a telecommunication access
method (TCAM or VTAM).
Multi Region Operation(MRO), through which more than one CICS region of a system can
communicate
Intersystem Communication (ISC), through which one CICS region of a system can
communicate with other CICS regions in other systems
Application Programming
A Command Interpreter
Data Handling
An interface with database access methods such as DB2, DL/1, and VSAM
Terminology:
Page 29 of 110
What are the six different types of argument values in COBOL that can be placed
various options of a CICS command?
Data Value
Data Area
Q2)
Kindly specify the PIC clause for the following
Any BLL Cell, Data type of Length Option field, HHMMSS type of data fields
A2)
Any BLL Cell
S9(8) COMP
Data type of Length Option field
S9(4) COMP
HHMMSS type of data fields
S9(7) COMP3
Q3)
Specify CICS transaction initiation process. (From the perspective of CICS control
programs and control tables.)
A3)
TCP places data in TIOA and corresponding entry into TCT.
KCP acquires the transaction identifier from TIOA and verifies if it is present in PCT.
SCP acquires Storage in Task Control Area (TCA), in which KCP prepares control data for the task.
KCP then loads the application programs mentioned in PCT by looking for it in PPT.
If resident real storage memory location is not present in the PPT the control is passed to PCP
that loads the application programs from the physical storage location address given in PPT. The
control is then passed to the application program (LOAD module).
Page 30 of 110
Page 31 of 110
Page 32 of 110
Page 33 of 110
TWA-DATA-LAYOUT.
2
DATA-AREA
PIC X(300).
PROCEDURE DIVISION.
.
EXEC CICS ADDRESS
TWA(TWA-PTR)
END-EXEC
SERVISE RELOAD TWA-DATA-LAYOUT.
COBOL- II PROGRAM
LINKAGE SECTION.
01 TWA-DATA-LAYOUT.
05 DATA-AREA
PIC X(300).
PROCEDURE DIVISION.
.
EXEC CICS ADDRESS
TWA(ADDRESS OF TWA-DATA-LAYOUT)
END-EXEC
Page 34 of 110
: @@@@@@@@@@@@@@@@@@@@
EXIT : X
X Input Field
@ - Output field (Alphanumeric)
$ - Output field (Numeric)
Mapname EMPFORM
Mapsetname - EMPFORM
Label given to various named fields on the DFHMDF macro while defining the map shown above.
EMPID, EMPNAME, EMPDESIG, DEPART, SEX, SALARY, STATUS and EXITINP.
Structure of the VSAM/KSDS file.
Working-Storage Section.
01 EMP-IOAREA.
05 EMP-REC.
10 EMP-KEY PIC XXX.
10 EMP-NAME PIC X(32).
10 EMP-SEX PIC X.
10 EMP-DEPT PIC X(10)
10 EMP-DESIG PIC X(5).
10 EMP-SAL PIC 9(7).
A32) COBOL-II PROGRAM.
WORKING-STORAGE SECTION.
77
LENGTH-OF-AREA
PIC S9(4) COMP.
77
WS-RCODE
PIC S9(8) COMP.
1
STATUS.
02 NORMAL.
05
FILLER PIC X(8) VALUE EMP ID: .
05
EMP-ID
PIC X(3).
05
FILLER
PIC X(6) VALUE FOUND.
02 ABNORMAL REDEFINES NORMAL.
05
ABMSG
PIC X(17).
01 EMP-IOAREA.
05
EMP-REC.
10
10
10
10
10
10
EMP-KEY
EMP-NAME
EMP-SEX
EMP-DEPT
EMP-DESIG
EMP-SAL
LINKAGE SECTION.
1
DFHCOMMAREA.
05
INPVAL
PIC X(3).
PIC
PIC
PIC
PIC
PIC
PIC
XXX.
X(32).
X.
X(10)
X(5).
9(7).
PROCEDURE DIVISION.
Page 35 of 110
INPVAL = SEC
EXEC CICS RECEIVE
MAP(EMPFORM)
MAPSET(EMPFORM)
END-EXEC.
EXEC CICS READ
DATASET(EMPINFOR)
INTO(EMP-IOAREA)
RIDFLD(EMPIDI)
LENGTH(LENGTH-OF-AREA)
RESP(WS-RCODE)
END-EXEC.
IF WS-RCODE NOT = DFHRESP(NORMAL)
MOVE KEY NOT FOUND TO ABMSG
MOVE DFHBMBRY TO EMPIDA
ELSE
MOVE EMP-NAME TO EMPNAMEO
MOVE EMP-SEX TO SEXO
MOVE EMP-DESIG TO EMPDESIGO
MOVE EMP-SAL TO SALARY
MOVE EMP-DEPT TO DEPARTO
MOVE EMP-KEY TO EMP-ID
MOVE STATUS TO STATUSO.
EXEC CICS SEND
MAP(EMPFORM)
MAPSET(EMPFORM)
ERASE
END-EXEC.
MOVE 3 TO LENGTH-OF-AREA
EXEC CICS RETURN
TRANSID(EMPS)
COMMAREA(SEC)
LENGTH(LENGTH-OF-AREA)
END-EXEC.
Page 36 of 110
(EXITINPI NOT = Y)
EXEC CICS RETURN
END-EXEC.
Page 37 of 110
Page 38 of 110
Page 39 of 110
Page 40 of 110
Page 41 of 110
Page 42 of 110
It is a group of sequential
records which interfaces
between
the transactions of
the CICS region and the systems
outside of CICS region.
Page 43 of 110
Page 44 of 110
Page 45 of 110
Page 46 of 110
Page 47 of 110
Page 48 of 110
Page 49 of 110
Page 50 of 110
Page 51 of 110
Q157) How will you place cursor on a field called EMPNO. This field belongs to mapset
MAPEMPG
and map MAPEMPM and Symbolic map Empid-Rec ?
A157) BY INSERTING IC IN THE ATTRIB COMMAND
Q158) How do you place the cursor on a particular position on the screen? - GS
A158) Move -1 to the length attribute of the field and use the CURSOR option.
Define the field with IC in the BMS map.
Use CURSOR(n m)??
Q159) What are the two outputs created as a result of generation of a map? - GS
A159) The map copybook and the load module.
Q160) What is the difference between physical map and symbolic map? - GS
A160) The physical map is the load module and the symbolic map is the data structure.
Q161) What is the attribute byte? - GS
A161) Defines the display/transmission of field. most cases is an output field from the program.
Q162) How do you use extended attributes ?
A162) Define EXTATT=YES and the correct terminal type.
Page 52 of 110
MAP
FIELD
Q171) Can you use OCCURS in a BMS map? If you do, what are the issues related with
its use?
A171) Yes. cannot use group by clause???
Q172) Can you define multiple maps in a BMS mapset?
A172) Yes.
Q173) How is the storage determined in the symbolic map, if you have multiple maps?
A173) Storage for maps redefine the first. This means largest map has to be the first.
Q174) What is the meaning of BMS length of field = 0?
A174) Data was not entered in the field
Q175) Can you simply check if length = 0 for checking if a field was modified?
A175) No, not if ERASE EOF was used.
Q176) What do you do if you do not want characters entered by the user to be folded to
uppercase ?
A176) Use ASIS option on RECEIVE.
Q177) What does the BUFFER option in RECEIVE mean ?
A177) Brings the entire datastream from the terminal buffer.
Q178) What are the steps you go through to a create a BMS executable?
A178) Assemble to create CSECT and Link
Page 53 of 110
Page 54 of 110
Page 55 of 110
Page 56 of 110
Page 57 of 110
Page 58 of 110
Page 59 of 110
Page 60 of 110
Page 61 of 110
Page 62 of 110
Page 63 of 110
Page 64 of 110
Page 65 of 110
Page 66 of 110
Page 67 of 110
Page 68 of 110
Page 69 of 110
Page 70 of 110
What RDMS objects are created with the SQL CREATE statements?
The SQL CREATE statements are used to create the following objects:
STOGROUP
A storage group
DATABASE
A logical collection of tables
TABLESPACE An area that stores tables
TABLE
A data structure organized by a specified columns
INDEX
An alternate path to a table data
VIEW
An alternate representation of one or more tables
SYNONYM
An alternate name for local table or view
ALIAS
An alternate name for a table definition which may be local
or remote, existence or nonexistent
Q2)
A2)
What RDMS objects are required before you can create a table?
Before you can create a table, you need an existing database and tablespace.
Q3)
A3)
Q4)
A4)
Page 71 of 110
Q7)
After a table is defined, can columns be removed?
A7)
The only way to remove columns from an existing table involves a migration program that
extracts only the desired
columns of data, redefining the table without the unwanted columns, then populating the new
table. One have to handle
all the old tables dependents programmatically.
Q8)
A8)
Which RDMS objects can you change with the SQL ALTER statements?
The SQL ALTER statement can change a table index, a table, a tablespace, or a STOGROUP.
Q9)
A9)
Page 72 of 110
Page 73 of 110
Page 74 of 110
Page 75 of 110
Page 76 of 110
Page 77 of 110
Page 78 of 110
Page 79 of 110
Page 80 of 110
Page 81 of 110
Page 82 of 110
This is a seven part value that consists of a date (yymmdd) and time(hhmmss and
microseconds).
Page 83 of 110
COBOL picture clause of the following DB2 data types: DATE, TIME,
PIC X(10)
PIC X(08)
PIC X(26)
Q56) What is the COBOL picture clause for a DB2 column defined as DECIMAL(11,2)? GS
A56) PIC S9(9)V99 COMP-3.
Note: In DECIMAL(11,2), 11 indicates the size of the data type and 2 indicates the precision.
Q57) What is DCLGEN ? - GS
A57) DeCLarations GENerator: used to create the host language copy books for the table
definitions. Also creates the DECLARE table.
Q58) What are the contents of a DCLGEN? - GS
A58) EXEC SQL DECLARE TABLE statement which gives the layout of the table/view in terms of
DB2 datatypes.
A host language copy book that gives the host variable definitions for the column names.
Q59) Is it mandatory to use DCLGEN? If not, why would you use it at all? - GS
A59) It is not mandatory to use DCLGEN. Using DCLGEN, helps detect wrongly spelt column
names etc. during the pre-compile stage itself (because of the DECLARE TABLE ). DCLGEN
being a tool, would generate accurate host variable definitions for the table reducing
chances of error.
Q60) Is DECLARE TABLE in DCLGEN necessary? Why it used?
A60) It not necessary to have DECLARE TABLE statement in DCLGEN. This is used by the precompiler to validate the table-name, view-name, column name etc., during pre-compile.
Q61) Will precompile of an DB2-COBOL program bomb, if DB2 is down?
A61) No. Because the precompiler does not refer to the DB2 catalogue tables.
Page 84 of 110
Page 85 of 110
Page 86 of 110
Page 87 of 110
Page 88 of 110
Page 89 of 110
Page 90 of 110
Page 91 of 110
Page 92 of 110
Page 93 of 110
Page 94 of 110
Page 95 of 110
Page 96 of 110
Page 97 of 110
Page 98 of 110
Page 99 of 110
a DISTINCT keyword
a UNION
operator
a GROUP BY clause
a ORDER BY clause
a HAVING clause
What
What
What
What
(b)
(d)
3) In
a)
b)
c)
d)
(c)
which cluster type are records added at the end of the data set?
LDS
RRDS
ESDS
KSDS
(e)
(d)
(d)
(a)
(a)
(c)
(b)
(d)
12) If the key of a KSDS record begins in the second field (first field is 25 bytes long), the offset in
the
KEYS parameter is
(a)
a) 24
b) 25
c) 26
d) None
13) Data organization in KSDS is
a) INDEXED
b) NUMBERED
c) LINEAR
d) NONINDEXED
(a)
(d)
(c)
(c)
(b)
18) Which of the following REPRO selection parameters can be specified for an LDS?
a) FROMKEY
b) FROMADDRESS
(e)
(e)
(e)
22) Which of the following entry names are valid for ALTER FREESPACE?
a) Cluster name
b) Data component name
c) Index component name
d) b and c
e) a, b and c
(b)
23) Which of the following is a correct generic name specification for TEST.USER.DATA.A? (a)
a) TEST.USER.*
b) TEST.*.*.A
c) *.USER.DATA.A
d) TEST.USER.*.A
24) To
a)
b)
c)
d)
e)
(e)
25) For which access mode below must the application program interpret RDFs?
a) KEY
b) ADR
c) ADR(for a KSDS)
d) CNV
e) None
(b)
(d)
(c)
28) If a program uses direct processing exclusively, DIR is specified in which macros? (c)
a) OPEN
b) ACB
c) RPL
d) CLOSE
e) b and c
f) None
29) VSAM processing options could be specified in
a) Catalog
b) Program control blocks
c) JCL
d) None
e) All the above
30) Which of the following is not a COBOL verb?
a) START
b) READ
c) DELETE
d) UPDATE
e) REWRITE
(e)
(d)
(d)
(b)
33) For a data set defined with SPEED, which of the following is true?
(a)
a) SPEED is effective for the initial load only.
b) SPEED is effective for all additions to the data set after initial load.
c) If the load program ABENDS, VERIFY can determine the HIGH-USED-RBA of the data set.
d) If the load program ABENDS, only those records remaining in buffers need to be added to
the data set.
None
(c)
35) For a data set defined with NOERASE, which of the following is not true?
a) Desirable for sensitive data
b) Removes catalog entries
c) All the above
d) None
36) Buffer space cannot be specified in which of the following?
a) DD statement
b) Assembler program
c) AMS DEFINE
d) COBOL program
(a)
(d)
37) How many data buffers are required for sequential processing to overlap I/O processing? (c)
a) 2
b) 3
c) 4
d) 5
38) When
a) At
b) At
c) At
d) At
(b)
(b)
40) For 3380 DASD, TRK(50 5) results in which CA size for a KSDS defined with NOIMBED? (b)
a) 1 TRK
b) 5 TRKS
c) 15 TRKS
d) 50 TRKS
e) None
41) Suppose you are defining a multi-volume data set with VOL(A B) and five key ranges specified.
Which of the following correctly indicates where each key range will be located?
(c)
a) First key range on VOL A; second on B; third on A; etc.
b) First key range on VOL B; second on A; third on B; etc.
c) First key range on VOL A; remaining key ranges on B.
d) All key ranges on VOL A; B is used for overflow only.
e) All key ranges on VOL B; A is used for overflow only.
(d)
(b)
46) Which of the following writes catalog information into the backup data set?
(b)
a) REPRO only
b) EXPORT only
c) Both REPRO and EXPORT
d) Neither REPRO nor EXPORT
47) Which of the following requires a DELETE/DEFINE before the command can be used to restore an
existing data set?
(a)
a) REPRO only
b) IMPORT only
c) Both REPRO and IMPORT
d) Neither REPRO nor IMPORT
48) With HBACKDS the use of apostrophes to enclose the dsname is
(b)
a) Required
b) Used to exclude the TSO id as the high level qualifier
c) Required only if one or more segments are specified generically
d) Not allowed if the data set is password protected
SECTION 4