Monday 2 February 2015

Mainframe IBM DB2 Interview Questions and Answers (Part5)

41. What is the maximum value that can be stored in S9(8) COMP?
99999999

42. What is COMP SYNC?
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.

43. What is the maximum size of a 01 level item in COBOL I? in COBOL II?
In COBOL II: 16777215

44. 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).

45. What are different file OPEN modes available in COBOL?
Open for INPUT, OUTPUT, I-O, EXTEND.

46. What is the mode in which you will OPEN a file for writing?
OUTPUT, EXTEND

47. 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.

48. Can you REWRITE a record in an ESDS file? Can you DELETE a record from it?
Can rewrite(record length must be same), but not delete.

49. What is file status 92?
Logic error. e.g., a file is opened for input and an attempt is made to write to it.

50. What is file status 39 ?
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.
More Questions & Answers :-
Part1  Part2  Part3  Part4  Part5

No comments:

Post a Comment