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


Please Help Members By Posting Answers For Below Questions

Difference between cobol and cobol-ii?

704


What is the usage of comp fields in cobol?

656


Name the divisions, which are available in a cobol program?

685


how do you reference the printer file formats from cobol programs

659


How do define dynamic array in cobol.

669






)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?

1522


A table has two indexes defined. Which one will be used by the SEARCH?

757


What happens when we move a comp-3 field to an edited (say z (9). Zz-)?

776


Can we redefine the field of x(200) to less than 200?

816


What is Pic 9v99 Indicates in COBOL?

725


What is an in line perform? When would you use it? Anything else you wish to say about it.

643


input 1 input2 ouput1 output2 output 3 1 re 300 1 re 200 1 re 300 3 rc 500 1 re 200 2 rr 400 1 re 300 2 rr 400 1 rc 400 3 rc 500 1 rc 400 2 rr 700 2 rr 700 5 tt 900 5 tt 900 2 inputs r in flat file and output 1 is matched records,ouptput2 is unmatched of input1,output3 is unmatched of input2! how vl u get the output files using sequential order and to check with each and every records! let me know the procedure division ?

1868


What is cobol?

744


2 input fles: 2 flat files, with different number of records. both are having unique key for each record and already sorted in ascending order . match these files using unique key and in output only matching key value has to be written. please procide cobol logic

2108


how do you reference the variable block file formats from cobol programs

683