Search

Saturday, March 16, 2013

Interview Questions for COBOL


How do you do in-line PERFORM? 
        
PERFORM ... <UNTIL> ...
<sentences>
END-PERFORM

When would you use in-line perform?

     When the body of the perform will not be used in other paragraphs. If the body of the perform is a generic type of code (used from various other places in the program), it would be better to put the code in a separate Para and use
      PERFORM Para name rather than in-line perform.

 What is the difference between CONTINUE & NEXT SENTENCE ?
 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 
 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.     



What does EXIT do ?
      Does nothing ! If used, must be the only sentence within a paragraph.

Explain the difference between an internal and an external sort, the pros and cons, internal sort syntax etc.

An external sort is not COBOL; it is performed through JCL and PGM=SORT. 

An internal sort can use two different syntax’s: 

      1) USING, GIVING sorts are comparable to external sorts with no extra file processing;  
   2) INPUT PROCEDURE, OUTPUT PROCEDURE sorts allow for data manipulation before and/or after the sort. 


No comments:

Post a Comment