IMS: Interview Questions for IMS-DB
By Abhishek
Q: What is a segment.
A: A segment is a unit of data that DL/I transfers to and from program
in an I/O operation. Each segment consists of one or more fields.
Q: What is a segment type and a segment occurrence.
A: A segment type is simply a category of data and a segment occurrence
is one specific segment of a particular segment type. eg name can be
a segment type while abhishek is a segment occurrence.
Q: What are twin segments.
A: Two or more segments occurrences of the same type and with the same
segment occurrence as their parent are called as twin segments.
Q: What is a DBD.
A: Data Base Description or DBD, describes the complete structure of
a database. There is one DBD for each DL/I database.
Q: What is PSB MASK.
A: The linkage section definition of a PCB is called as PCB MASK.
Q: How do you run a COBOL program that uses DL/I.
A: The program is run using DL/I batch initialization module, which
in turn loads the application program and the DL/I modules required
to service it. The batch initialization module is called DFSRRC00.
Q: Why should you use GOBACK in a IMS/COBOL program instead of STOP RUN.
A: An IMS/COBOL program runs under the control of DFSRRC00 and so if it
issues a STOP RUN, the control is passed back to the operating system.
DFSRRC00 doesn't get a chance to perform its termination functions.
So always use GOBACK rather than STOP RUN in a IMS/COBOL program.
Q: What is CBLTDLI.
A: CBLTDLI stands for COBOL To DL/I. It ia an interface module that is
link edited with he program's object module. It is used to invoke
DL/I services.
Q: What is SSA.
A: Segment Search Argument, or SSA, identifies the segment occurrence
that you want to access.
Q: What are qualified SSA and Unqualified SSA.
A: An unqualified SSA simply supplies the name of the segment type
that you want to operate upon. It is 9 bytes long, eight bytes for
the segment name and the 9th byte must be a space.
A qualified SSA specifies not only the segment type, but also a
specific occurrence of it.
Q: What are qualified and unqualified DL/I calls.
A: An unqualified call is one that does not contain any SSAs.
A qualified call is one that contains one or more SSAs. Note that
a call that specifies only a single unqualified SSA ia still
considered to be a qualified call.
Q: How does DL/I know that a SSA is qualified or not.
A: DL/I looks at the 9th byte in a SSA. If its spaces, then SSA is
unqualified. If it is (, then SSA is qualified. If it is *, then
SSA uses comand codes.
Q: What is GA status code.
A: It means that a hierarchical boundary has been crossed while trying
to retrieve next segment. The next segment is retrieved and can be
used even though the status code is GA.
More precisely, GA status is raised when an unqualified GN or
GNP call moves up a level in the datbase hierarchy to retrieve a
segment.
Q: How do you establish parentage on a segment occurrence.
A: By issuing a successfull GU or GN call that retrieves the segment
on which the parentage is to be established.
Q: What is path call.
A: The D command code is referred to a path call. It operates on a
path of two or more segments rather than just one segment. For a
program to be able to issue path calls, its PCB must specifically
enable them using P in the PROCOPT parameter otherwise a status
code of AM is returned.
Q: Suppose you want to modify a segment. You use GHU command to hold
the segment for modification. However now due to some reason you
don't want to modify the segment. How will you cancel HOLD status.
A: If you retrieve a segment with one of the get hold calls, then
decide you don't want to delete or replace it, you can proceed with
other processing, and the hold will no longer be in effect.
Q: How do you update the sequence key.
A: You cannot update the sequence key of the segment using REPL. The
only thing that can be done is DLET followed by ISRT !!
Q: Can you use path call with ISRT/REPL/DLET.
A: Yes.
Q: Do you ever use a qualified SSA with REPL/DLET calls.
A: You don't need to include an SSA with REPL/DLET calls because the
target segment has already been fixed by one of the get hold calls.
However if you used a path call with get Hold and if you do not
want to modify all segments in the path, you can use unqualified
SSA to tell IMS which segments need to be modified. However you
never use qualified SSA with REPL/DLET calls.
Q: Is it possible to have a secondary key/alternate sequence key.
A: Yes, It is possible to use secondary indexing in IMS. DL/I
maintains the alternate sequence by storing pointers to segments
of the indexed database in a separate secondary index database.
The secondary index database has just one segment type, called
the index pointer segment. The index pointer segment contains two
main elements: prefex element and a data element. The prefix
element contains pointer to the index target segment. The data
element contains the secondary key value.
Q: If you want to retrive data using secondary index, do you need
to make any changes in PSB.
A: Yes. The PSBGEN for the program must specify the proper processing
sequence for the data base on the PROCSEQ parameter of the PCB
macro. If it does not, processing is done using the normal
hierarchical sequence for the database. To use secondary index,
PROCSEQ must be set to the DBD name of the secondary index.
Q: If a program needs to access a data base using its key sequence as
well as its alternate key sequence, how will you do it.
A: In such cases we will need to define two PCBs in the PSB, one of
which will have PROCSEQ=DBDname of the secondary index database.
This will mean that we will also have two PCB masks in the program
one for the normal processing and another one for the secondary
index processing.
Send me an email