Thursday 22 September 2011

IMS DB/DC interview questions


What is PSB and PCB?
PSB is Program Specification Block which is a collection of one or more PCBs.
PCB is Program Control Block which represents the application program's view of the database.

What is PROCOPT?
PROCOPT is processing option defined in PCB, which specifies the operations that can be performed on the database. Different PROCOPTs that can be used are
G - Get segment from DB
I - Insert segment into DB
R - Replace segment
D - Delete segment
A - All the above operations
LS - Load Sequential in GSAM (HIDAM)
GS - Get Sequential in GSAM

What is SSA?
SSA is segment search argument. It is used to retrieve a particular segment or segment type from the DB.

What are qualified and unqualified calls?
IMS call with SSA is called qualified call. IMS call without SSA is unqualified call.

What are qualified and unqualified SSAs?
SSA which contains only the segment name is Unqualified SSA. SSA which contains segment name, field name, relational operator and search value for the field name is qualified SSA.

What are command codes?
Command codes are used along with SSAs to perform additional operations. Common command codes used are 
'P' - used to set parentage on a particular segment
'D' - used for path calls, to retrieve the entire hierarchical path

This post will be updated regularly. Your contributions to this blog are welcome. Please send the interview questions to knowmainframe@gmail.com

PL1 Interview questions

What is the use of DEFINED attribute in DCL statement?
DEFINED attribute indicates that the variable is mapped on storage of another variable. This process is called Overlay defining.

What is the difference between DEFINED attribute and LIKE atrribute.
DEFINED attribute maps the variable to storage of another variable. LIKE attribute allocates storage similar to another variable.

What is the difference between bulitin fuction VERIFY and INDEX? 
INDEX(x,y) returns the starting position of the string y within string
x. Returns 0 if y not present in x.
Verify(x,y) returns the first position in x where any character in
y is not in string 1. If all characters in x are contained in y, result is zero.

What are the CONDITIONS in PL/1?
CONDITION is an interrupt to the program. A CONDITION has to be handled using ON statement.

How we can disable the enabled CONDITIONS.
REVERT statement cancels the existing ON unit for the specified condition.

This post will be updated regularly. Your contributions to this blog are welcome. Please send the interview questions to knowmainframe@gmail.com

Wednesday 21 September 2011

DB2 Interview questions

1. Why do we use 'CURSOR WITH HOLD' option?
A cursor normally gets closed after a 'COMMIT' statement. 'Cursor with hold' is used in order to have the cursor open after 'COMMIT'

2. What is SQLCODE -811? How can this be resolved?
SQLCODE -811 is issued when a SELECT query in the program fetches more than one row. The solution for this error is to use a cursor. By using a cursor, the result of the query can be fetched one by one.

3. What is SQLCODE -803?
-803 is for unique index violation. When we try to insert a duplicate record, sqlcode -803 is issued.

4. What is SQLCODE -818?
When a COBOL-SQL program is built, the precompile timestamp can be found in LOAD and DBRM. When the precompile timestamps in the LOAD and DBRM differs, SQLCODE -818 is issued.

5. Explain Commit-Restart logic?
When Database operations are performed for large number of rows, the changes will be committed on certain frequency. During commit, the key(s) used for the cursor will be stored. When there is a restart of the program, the program will be restarted from the checkpoint rather than the beginning.

This post will be updated regularly. Your contributions to this blog are welcome. Please send the interview questions to knowmainframe@gmail.com