COBOL Interview questions
COBOL Interview questions 1-10
-
Q1: COBOL full form?
- Answer : COmmon Business Oriented Language
Q2: Name the divisions in a COBOL program ?
- Answer : IDENTIFICATION DIVISION, ENVIRONMENT DIVISION, DATA DIVISION, PROCEDURE DIVISION.
Q3: What is the use of EVALUATE statement?
- Answer : Evaluate is like a case statement and can be used to replace nested Ifs. The difference between EVALUATE and case is that no 'break' is required for EVALUATE i.e. control comes out of the EVALUATE as soon as one match is made
Q4: What is the difference between performing a SECTION and PARAGRAPH?
- Answer : 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.
Q5: How do you come out of an EVALUATE statement?
- Answer : 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.
Q6: What is the difference between CONTINUE & NEXT SENTENCE ?
- Answer : They appear to be similar, that is, the control goes to the next sentence in the paragraph. But, Next Sentence would take the control to the sentence after it finds a full stop (.). Check out by writing the following code example, one if sentence followed by 3 display statements (sorry they appear one line here because of formatting restrictions) If 1 > 0 then next sentence end if display 'line 1' display 'line 2'. display 'line 3'. *** Note- there is a dot (.) only at the end of the last 2 statements, see the effect by replacing Next Sentence with Continue ***
Q7: What does EXIT do ?
- Answer : Does nothing ! If used, must be the only sentence within a paragraph
Q8: Can I redefine an X(200) field with a field of X(100) ?
Q9: What is the difference between COMP & COMP-3 ?
- Answer : COMP is a binary storage format while COMP-3 is packed decimal format.
Q10: What is the maximum value that can be stored in S9(8) COMP?