Wat is the difference between NEXT and CONTINUE statement in
cobol,can any one explain with example.
Answer Posted / murali
Answer #9 would never compile in the first place. We cannot
have and END-IF. after an END-IF. without an IF statement.
The ANSI-85 specifically flags that NEXT SENTENCE within IF
ELSE END-IF Block.
In the example provided in #4
If A>B
next sentence
end-if
display 1
display 2.
display 3.
when A>B is true Display 3 will be executed and if not
display 1 display 2 display 3 will be executed. This means
that we want to display 1 and display 2 to be executed in
when A > B is false. In such cases it should be coded in the
else portion of the code. When display 1 and display 2
should be executed irrespective of the test condition, then
the next sentence needs to be replaced with continue.
Avoid coding a next sentence within if - else - end-if blocks.
Very simple.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?
Explain the configuration section of a cobol program with examples of syntax.
how do you reference the rrds file formats from cobol programs
What are different data types in cobol?
Name the sections present in data division.
How many sections are there in data division in COBOL?
how to refer the data field?
Name the divisions, which are available in a cobol program?
What is the difference between Call and a Link?
How do you reference the fixed block file formats from cobol programs
What are the different open modes available in cobol?
how to move the records from file to array table. give with code example
A table has two indexes defined. Which one will be used by the SEARCH?
how do you reference the variable block file formats from cobol programs
How to remove 2 duplicate records and copy only one using job control language?