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.
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.
Scope terminator is used to mark the end of a verb e.g. EVALUATE, END-EVALUATE; IF, END-IF.
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.
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 line.
Webmaster 20th of May 2012
Tell us what you feel about Cobol Interview Questions and Answers
All comments will be published after review. No login or registration is required to post a comment on Cobol Interview Questions and Answers We offer and invite you to submit your valuable comment now; Please be respectful of others when commenting. Insulting others, self-promotional comments, website promotional comments, marketing stuff, SEO Techniques, SMS-style content and off-topic comments will not be approved at this information portal.
So start sharing your thoughts regarding Cobol Interview Questions and Answers
Thank you.