COBOL Interview questions
COBOL Interview questions 10-20
-
Q11: What are different file OPEN modes available in COBOL?
- Answer : Open for INPUT, OUTPUT, I-O, EXTEND.
Q12: What is the mode in which you will OPEN a file for writing?
Q13: Can you REWRITE a record in an ESDS file? Can you DELETE a record from it?
- Answer : Can rewrite (record length must be same), but not delete.
Q14: What compiler option would you use for dynamic linking?
Q15: What are the steps you go through while creating a COBOL program executable?
- Answer : DB2 precompiler (if embedded SQL used), CICS translator (if CICS pgm), Cobol compiler, Link editor. If DB2 program, create plan by binding the DBRMs.
Q16: What is an explicit scope terminator?
- Answer : A scope terminator brackets its preceding verb, e.g. IF .. END-IF, so that all statements between the verb and its scope terminator are grouped together. Other common COBOL II verbs are READ, PERFORM, EVALUATE, SEARCH and STRING
Q17: What is the linkage section?
- Answer : The linkage section is part of a called program that 'links' or maps to data items in the calling program's working storage. It is the part of the called program where these share items are defined.
Q18: What is the difference between a subscript and an index in a table definition?
- Answer : A subscript is a working storage data definition item, typically a PIC (999) where a value must be moved to the subscript and then incremented or decrements by ADD TO and SUBTRACT FROM statements. An index is a register item that exists outside the program's working storage. You SET an index to a value and SET it UP BY value and DOWN BY value.
Q19: How many sections are there in data division?
- Answer : SIX SECTIONS 1.FILE SECTION 2.WORKING-STORAGE SECTION 3. LOCAL-STORAGE SECTION 4.SCREEN SECTION 5.REPORT SECTION 6. LINKAGE SECTION
Q20: Can JUSTIFIED be used for all the data types?
- Answer : No, it can be used only with alphabetic and alphanumeric data types.