Client Interview Question Bank (Mainframe)
Client Interview Question Bank (Mainframe)
Client codes :
GS - Goldman Sachs
COBOL
Alphabetic, Alphanumeric fields & alphanumeric edited items are set to SPACES.
Numeric, Numeric edited items set to ZERO.
FILLER , OCCURS DEPENDING ON items left untouched.
Elementary level item. Cannot be subdivisions of other items (cannot be qualified), nor can they be subdivided
themselves.
IS NUMERIC can be used on alphanumeric items, signed numeric & packed decimal items and usigned numeric &
packed decimal items. IS NUMERIC returns TRUE if the item only consists of 0-9. However, if the item being
tested is a signed item, then it may contain 0-9, + and - .
01 ARRAYS.
05 ARRAY1 PIC X(9) OCCURS 10 TIMES.
05 ARRAY2 PIC X(6) OCCURS 20 TIMES INDEXED BY WS-INDEX.
No.
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.
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).
Search on a sorted array. Compare the item to be searched with the item at the center. If it matches, fine else repeat the
process with the left half or the right half depending on where the item lies.
.My program has an array defined to have 10 items. Due to a bug, I find that even if the program access 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.
.How do you sort in a COBOL program? Give sort file definition, sort statement syntax and meaning. - GS
Syntax:
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.
.How 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.
.What are the two ways of doing sorting in a COBOL program? Give the formats. - GS
.Give the format of USING and GIVING in SORT statement. What are the restrictions with it? - GS
See question 16. Restrictions - Cannot massage records, canot select records to be sorted.
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.
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.
Yes.
Scope terminator is used to mark the end of a verb e.g. EVALUATE, END-EVALUATE; IF, END-IF.
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 paraname rather than in-line perform.
CONTINUE is like a null statement (do nothing) , while NEXT SENTENCE transfers control to the next sentence (!!) (A
sentence is terminated by a period)
Yes. Redefines just causes both fields to start at the same location. For example:
01 WS-TOP PIC X(1)
01 WS-TOP-RED REDEFINES WS-TOP PIC X(2).
If you MOVE '12' to WS-TOP-RED,
DISPLAY WS-TOP will show 1 while
DISPLAY WS-TOP-RED will show 12.
Yes.
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 installtion might have batch program debugging tools. Use them.
.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 bite.
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...
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.
.How many bytes does a S9(7) SIGN TRAILING SEPARATE field occupy ?
4 bytes.
99999999
Causes the item to be aligned on natural boundaries. Can be SYNCHRONIZED LEFT or RIGHT.
For binary data items, the address resolution is faster if they are located at word boundaries in the memory. For example,
on main frame the memory word size is 4 bytes. This means that each word will start from an address divisible by
4. If my first variable is x(3) and next one is s9(4) comp, then if you do not specify the SYNC clause, S9(4) COMP
will start from byte 3 ( assuming that it starts from 0 ). If you specify SYNC, then the binary data item will start
from address 4. You might see some wastage of memory, but the access to this computational field is faster.
.How do you reference the following file formats from COBOL programs:
Fixed Block File - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, BLOCK CONTAINS 0 .
Fixed Unblocked - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, do not use BLOCK
CONTAINS
Variable Block File - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS V, BLOCK CONTAINS 0.
Do not code the 4 bytes for record length in FD ie JCL rec length will be max rec length in pgm + 4
Variable Unblocked - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS V, do not use BLOCK
CONTAINS. Do not code 4 bytes for record length in FD ie JCL rec length will be max rec length in pgm + 4.
ESDS VSAM file - Use ORGANISATION IS SEQUENTIAL.
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).
.What is the mode in which you will OPEN a file for writing? - GS
OUTPUT, EXTEND
.In 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.
.Can 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.
.What is Static,Dynamic linking ?
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.
.What is AMODE(24), AMODE(31), RMODE(24) and RMODE(ANY)? ( applicable to only MVS/ESA Enterprise
Server).
DYNAM.
.What is SSRANGE, NOSSRANGE ?
These are compiler options w.r.t subscript out of range checking. NOSSRANGE is the default and if chosen, no run time
error will be flagged if your index or subscript goes out of the permissible range.
.How do you set a return code to the JCL from a COBOL program?
Move a value to RETURN-CODE register. RETURN-CODE should not be declared in your program.
OS/VS Cobol pgms can only run in 24 bit addressing mode, VS Cobol II pgms can run either in 24 bit or 31 bit
addressing modes.
OS/VS Cobol follows ANSI 74 stds while VS COBOL II follows ANSI 85 stds.
.What are the steps you go through while creating a COBOL program executable?
DB2 precompiler(if embedded sql used), CICS translator (if CICS pgm), Cobol compiler, Link editor.
If DB2 program, create plan by binding the DBRMs.
VSAM
.What is IDCAMS ?
IDCAMS is the Access Method Services program. You run the IDCAMS program and supply AMS commands thru
SYSIN. (examples of AMS commands are DELETE, DEFINE, REPRO etc..).
Yes
Note: these can be used only under IDCAMS and not from the TSO prompt.
SET is also a valid AMS command. SET LASTCC (or MAXCC) = value
The maximum condition code is 16. A cond code of 4 indicates a warning. A cond code of 8 is usually encountered on a
DELETE of a dataset that is not present.
.Under IDCAMS , multiple functions can be executed, each of which returns a cond code. What will be the condition
code returned to the operating system ?
The maximum condition code generated is returned as the condition code of the IDCAMS step.
Control Interval is analogous to a physical block for QSAM files. It is the unit of i/o. Must be between 512 bytes to 32 k.
Usually either 2K or 4K. A larger control interval increases performance for sequential processing while the reverse
is true for random access. Under CICS when a record is locked, the entire CI gets locked.
Control area is a group of control intervals. CA is used during allocation. CA size is calculated based on the allocation
type (cyl, tracks or records) and can be max of 1 cylinder
.What is FREESPACE ?
Coded in the DEFINE as FREESPACE(ci ca) where ci is the percentage of each control interval to be left free for
insertions, ca is the percentage of control intervals in each control area to be left empty.
CI size should be based on record length, type of processing. Usually CI is 4K. If record length is larger(>1K), chose 6K
or 8K.
FREESPACE should be large if more number of insertions are envisaged. Usual values are (20 20) when heavy updates
are expected. CI size can be calculated.
No. Because you cannot insert records in an ESDS, also when you rewrite a record, it must be of the same length. Thus
putting any value for freespace does not make any sense.
.What is SHAREOPTS ?
SHAREOPTS is a parameter in the DEFINE and specifies how an object can be shared among users. It is coded as
SHAREOPTS(a b), where a is the cross region share option ie how two or more jobs on a single system can share
the file, while b is the cross system share option ie how two or more jobs on different MVSes can share the file.
Usual value is (2 3).
Value of 2 for cross region means that the file can be processed simultaneously by multiple users provided only one of
them is an updater. Value of 3 for cross system means that any number of jobs can process the file for input or output
(VSAM does nothing to ensure integrity).
DEFINE CLUSTER(cluster name) with the INDEXED parameter. Also specify the ds name for the DATA component &
the ds INDEX component. Other important parms are RECORDSIZE, KEYS, SHAREOPTIONS.
.How do you define an ALTINDX ? How do you use ALTINDXs in batch, CICS pgms ?
DEFINE ALTERNATEINDEX. Important paramters are RELATE where you specify the base cluster name, KEYS,
RECORDSIZE,SHAREOPTIONS,UNIQUEKEY(or NONUNIQUEKEY), DATA(ds name for the data component),
INDEX(ds name for the index component).
Then DEFINE PATH. Important paramters are NAME (ds name for the path), PATHENTRY (ds name of the alternate
index name), UPDATE(or NOUPDATE) which specifies whether an alt index is updated when a update to the base
cluster takes place.
Then BLDINDEX. Parameters are INDATASET(ds name of base cluster), OUTDATASET(ds name of AIX).
In the JCL, you must have DD stmts for the cluster and for the path(s). In the cobol pgm, SELECT .. ASSIGN TO
ddname for base cluster RECORD KEY IS... ALTERNATE RECORD KEY IS..
FCT entries must be created for both base cluster & the path. To read using the alternate index, use the dd name of the
path in CICS file control commands.
.What happens when you open an empty VSAM file in a COBOL program for input?
A VSAM file that has never contained a record is treated as unavailable. Attempting to open for input will fail. An empty
file can be opened for output only. When you open for output, COBOL will write a dummy record to the file & then
delete it out.
.How do you initialize a VSAM file before any operation? a VSAM with alternate index?
Can write a dummy program that just opens the file for output & then closes it.
.What does a file status of 02 on a VSAM indicate?
.How do you calculate record size of an alternate cluster? Give your values for both unique and non-unique.
Use the DEFINE GENERATIONDATAGROUP command. In the same IDCAMS step, another dataset must be defined
whose DCB parameters are used when new generations of the GDG are created. This dataset is known as the model
dataset. The ds name of this model dataset must be the same as that of the GDG, so use a disp of keep rather than
catlg and also specify space=(trk,0)
.Do all versions of the GDG have to be of the same record length ?
No, the DCB of the model dataset can be overridden when you allocate new versions.
.Suppose 3 generations of a GDG exist. How would you reference the 1 st generation in the JCL? - GS
.Suppose a generation of GDG gets created in a particular step of a proc. How would you refer the current generation in
a subsequent step? What would be the disposition of this generation now? - GS
Relative generation numbers are updated only at the end of the job, not at the end of a step. To allocate a new generation,
we would be using (+1) with a DISP of (NEW,CATLG,DELETE). To refer to this in a subsequent step in the same
job, we would again use (+1) but with a DISP of SHR or OLD.
.What more info you should give in the DD statement while defining the next generation of a GDG? - GS
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.
.Assuming that the DEFINE jcl is not available, how do you get info about a VSAM file's organisation ?
.During processing of a VSAM file, some system error occurs and it is subsequently unusable . What do you do ?
Run VERIFY.
JCL
.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.
.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.
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 .
.What do you do if you do not want to keep all the space allocated to a dataset? - GS
.What 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.
.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.
Can use either condition codes or use the jcl control statement IF (only in ESA JCL)
.A PROC has five steps. Step 3 has a condition code. How can you override/nullify this condition code? - GS
//<stepname.dd> DSN=...
.What 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 =
'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.
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.
.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.
.What is COND=EVEN ?
Means execute this step even if any of the previous steps, terminated abnormally.
.What 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.
.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).
.I have a COBOL program that ACCEPTs some input data. How do you code the JCL statment for this? ( How do you
code instream data in a JCL? )
//SYSIN DD*
input data
input data
/*
No.
One way is to code SYSIN DD DUMMY in the PROC, and then override this from the JCL with instream data.
.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.
First any private libraries as specified in the STEPLIB or JOBLIB, then the system libraries such as SYS1.LINKLIB. The
system libraries are specified in the linklist.
JOBLIB is ignored.
.When 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.
.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 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.
????? Can anyone add more
DB2
.How would you find out the total number of rows in a table? - GS
YES.
.My SQL statement SELECT AVG(SALARY) FROM EMP yields inaccurate results. Why?
Because SALARY is not declared to have NULLs and the employees for whom the salary is not known are also counted.
.How do you retrieve the first 5 characters of FIRSTNAME column of EMP table?
.How do you concatenate the FIRSTNAME and LASTNAME from EMP table to give a complete name?
Both these are used to combine the results of different SELECT statements.
.Suppose I have five SQL SELECT statements connected by UNION/UNION ALL, how many times should I specify
UNION to eliminate the duplicate rows? - GS
Once.
It has to be in a CURSOR.
Yes.
.What is 'LIKE' used for in WHERE clause? What are the wildcard characters? - GS
LIKE is used for partial string matches. '%' ( for a string of any character ) and '_' (for any single character ) are the two
wild card characters.
To do partial search e.g. to search employee by name, you need not specify the complete name; using LIKE, you can
search for partial string matches.
GROUP BY partitions the selected rows on the distinct values of the column on which you group by.
HAVING selects GROUPs which match the criteria specified
.Consider the employee table with column PROJECT nullable. How can you get a list of employees who are not assigned
to any project?
SELECT EMPNO
FROM EMP
WHERE PROJECT IS NULL;
NULL
.Why SELECT * is not preferred in embedded SQL programs?
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.
.How would you retrieve rows from a DB2 table in embedded SQL? - GS
Either by using the single row SELECT statements,or by using the CURSOR.
.Apart from cursor, what other ways are available to you to retrieve a row from a table in embedded SQL? - GS
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.
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.
No.
.Can you have more than one cursor open at any one time in a program ? - GS
Yes.
Yes.
.How do you leave the cursor open after issuing a COMMIT? ( for DB2 2.3 or above only )
Use WITH HOLD option in DECLARE CURSOR statement. But, it has not effect in psuedo-conversational CICS
programs.
.What is the physical storage length of each of the following DB2 data types:
DATE, TIME, TIMESTAMP?
DATE: 4bytes
TIME: 3bytes
TIMESTAMP: 10bytes
.What is the COBOL picture clause of the following DB2 data types:
DATE, TIME, TIMESTAMP?
.What is the COBOL picture clause for a DB2 column defined as DECIMAL(11,2)? - GS
.What is DCLGEN ? - GS
DeCLarations GENerator: used to create the host language copy books for the table definitions. Also creates the
DECLARE table.
1. EXEC SQL DECLARE TABLE statement which gives the layout of the table/view in terms of DB2 datatypes.
2. A host language copy book that gives the host variable definitions for the column names.
.Is it mandatory to use DCLGEN? If not, why would you use it at all? - GS
It not necessary to have DECLARE TABLE statement in DCLGEN. This is used by the pre-compiler to validate the
table-name, view-name, column name etc., during pre-compile.
No. Because the precompiler does not refer to the DB2 catalogue tables.
1. Use DSN utility to run a DB2 batch program from native TSO. An example is shown:
DSN SYSTEM(DSP3)
RUN PROGRAM(EDD470BD) PLAN(EDD470BD) LIB('EDGS01T.OBJ.LOADLIB')
END
2. Use IKJEFT01 utility program to run the above DSN command in a JCL.
.Assuming that a site's standard is that pgm name = plan name, what is the easiest way to find out which pgms are
affected by change in a table's structure ?
.How can you quickly find out the # of rows updated after an update statement?
.What is EXPLAIN? - GS
EXPLAIN is used to display the access path as determined by the optimizer for a SQL statement. It can be used in SPUFI
(for single SQL statement ) or in BIND step (for embedded SQL ).
In userid.PLAN_TABLE
.How do you simulate the EXPLAIN of an embedded SQL statement in SPUFI/QMF? Give an example with a host
variable in WHERE clause.)
SELECT EMP_NAME
FROM EMP
WHERE EMP_SALARY > ?
No.
Promoting a PAGE lock-size to table or tablespace lock-size when a transaction has aquired more locks than specified in
NUMLKTS. Locks should be taken on objects in single tablespace for escalation to occur.
.What is ALTER ? - GS
DBRM: DataBase Request Module, has the SQL statements extracted from the host language program by the pre-
compiler.
PLAN: A result of the BIND process. It has the executable code for the SQL statements in the DBRM.
Determine the point at which DB2 acquires or releases locks against table and tablespaces, including intent locks.
.What else is there in the PLAN apart from the access path? - GS
PLAN has the executable code for the SQL statements in the host program
Plan is marked as invalid. The next time the plan is accessed, it is rebound.
They contain executable code for SQL statements for one DBRM.
.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.
.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? - GS
100 ( for successful completion of the query ), 0 (for successful COMMIT if AUTOCOMMIT is set to Yes).
.How would you print the output of an SQL statement from SPUFI? - GS
??
.Lot of updates have been done on a table due to which indexes have gone haywire. What do you do? - GS
Looks like index page split has ocured. DO a REORG of the indexes.
.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? - GS
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.
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.
S9(4) COMP.
.What is RUNSTATS? - GS
A DB2 utility used to collect statistics about the data values in tables which can be used by the optimizer to decide the
access path. It also collects statistics used for space management. These statistics are stored in DB2 catalog tables.
REORG reorganizes data on physical storage to reclutser rows, positioning oveflowed rows in their proper sequence, to
reclaim space, to restore free space. It is used after heavy updates, inserts and delete activity and after segments of a
segmented tablespace have become fragemented.
.What is IMAGECOPY ? - GS
A state in which, an image copy on a table needs to be taken, In this status, the table is available only for queries. You
cannot update this table. To remove the COPY PENDING status, you take an image copy or use REPAIR utility.
When a table is LOADed with ENFORCE NO option, then the table is left in CHECK PENDING status. It means that
the LOAD utility did not perform constraint checking.
.What is QUIESCE?
A QUIESCE flushes all DB2 buffers on to the disk. This gives a correct snapshot of the database and should be used
before and after any IMAGECOPY to maintain consistency.
Causes the data rows to be stored in the order specified in the index. A mandatory index defined on a partitioned table
space.
Only one.
Authorization failure
This is generated when the consistency tokens in the DBRM and the load module are different.
Not all of them. Some views are updatable e.g. single table view with all the fields or mandatory fields. Examples of
non-updatable views are views which are joins, views that contain aggregate functions(such as MIN), and views that
have GROUP BY clause.
.If I have a view which is a join of two or more tables, can this view be updatable? - GS
No.
Inner Join: combine information from two or more tables by comparing all values that meet the search criteria in hte
designated column or columns of on etable with all the calues in corresponding columns of the other table or tables.
This kind of join which involve a match in both columns are called inner joins.
Outer join is one in which you want both matching and non matching rows to be returned. DB2 has no specific operator
for outer joins, it can be simulated by combining a join and a correlated sub query with a UNION.
Simple Tablespace:
Can contain one or more tables
Rows from multiple tables can be interleaved on a page under the DBAs control and maintenance
Segmented Tablespace:
Can contain one or more tables
Tablespace is divided into segments of 4 to 64 pages in increments of 4 pages. Each segment is dedicated to
single table. A table can occupy multiple segments
Partitioned Tablespace:
Can contain one table
Tablespace is divided into parts and each part is put in a separate VSAM dataset.
.What is a synonym ?
Synonym is an alternate name for a table or view used mainly to hide the leading qualifier of a table or view.. A synonym
is accessible only by the creator.
SYNONYM: is dropped when the table or tablespace is dropped. Synonym is available only to the creator.
ALIAS: is retained even if table or tablespace is dropped. ALIAS can be created even if the table does not exist. It is
used mainly in distributed environment to hide the location info from programs. Alias is a global object & is
available to all.
.What do you mean by NOT NULL WITH DEFAULT? When will you use it?
This column cannot have nulls and while insertion, if no value is supplied then it wil have zeroes, spaces or date/time
depending on whether it is numeric, character or date/time.
Use it when you do not want to have nulls but at the same time cannot give values all the time you insert this row.
.What do you mean by NOT NULL? When will you use it?
When a column which contains long text, e.g. remarks, notes, may have in most cases less than 50% of the maximum
length.
1. Can lead to high space utilization if most of the values are close to maimum.
2. Positioning of VARCHAR column has to be done carefully as it has performance implications.
3. Relocation of rows to different pages can lead to more I/Os on retrieval.
.How do I create a table MANAGER ( EMP#, MANAGER) where MANAGER is a foreign key which references to
EMP# in the same table? Give the exact DDL.
First CREATE MANAGER table with EMP# as the primary key. Then ALTER it to define the foreign key.
.When is the authorization check on DB2 objects done - at BIND time or run time?
At run time.
.What is auditing?
Recording SQL statements that access a table. Specified at table creation time or thru alter.
CICS
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)??
.What are the two outputs created as a result of generation of a map? - GS
The physical map is the load module and the symbolic map is the data structure.
.What are the 3 working storage fields used for every field on the map? - GS
Length, attribute and input/output field.
.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???
.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.
.Can you simply check if length = 0 for checking if a field was modified?
No, not if ERASE EOF was used.
.What do you do if you do not want characters entered by the user to be folded to uppercase ?
Use ASIS option on RECEIVE.
.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? - GS
DFHEIBLK, DFHCOMMAREA.
.I have written a CICS program. What tables should I setup to run this program? - GS
PPT, PCT, (FCT, DCT, RCT (if needed)).
.In which table would you make an entry for a BMS map? - GS
PPT
.If I create a TSQ from one transaction, can I read it from another transaction? - GS
Yes. As long as they run in the same region.
.I have TSQ with 15 items. I want to delete the 10th item. How do I do that?
Yes, the called routine must be defined in PPT and the calling program must use CALL identifier..
.Suppose pgm A passes 30 bytes to pgm B thru commarea and pgm B has defined its DFHCOMMAREA to be 50 bytes .
Is there a problem ?
Yes, if B tries to access bytes 31-50.
.When an XCTL is done, does the tranid change ? Is a new task created ? Does it cause an
implicit SYNCPOINT to be issued ?
No, No, Yes.
.What determines the DB2 subsystem to which a particular CICS region is attached ?
.Can you have CICS code in a copybook? If yes, what happens during compilation?
Yes. Needs to be preprocessed.
.I invoke a transaction from CICS. The program has a code: MOVE DFHCOMMAREA TO WS-AREA. What happens
to this transaction? What happens to the other transactions?
Junk may get moved in. Will cause Storage violation. ????
.How do I find the name of the CICS region inside my COBOL program?
.I have done a START BROWSE on a VSAM dataset. Can I do another START BROWSE without doing an END
BROWSE?
No.
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.
4.HHave full understanding of the role for which you are being interviewed.