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
Program A (Normal COBBAT) calling a B Program (DB2COBOL, COBBATDB which is using a VSAM file. its a dynamic call. How we will handle VSAM file decleration in our from JCL from where we are running A PGM. And should we have PLAN for A pGM also. if possible can some one post a sample JCL. Thanks for help in advance.
What is link edit in cobol?
What is the difference between next sentence and continue in cobol programing language?
if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need
Whats the difference between search & search ALL?
What is the compute verb? How is it used?
What are the different rules for performing sort operation?
What is rmode(any) ?
How to use the same COBOL program in Batch and CICS on lines? explain with an example
What is rmode(24)
what is the use of outrecord?
here is my requirement A1 is alphanumeric with value 'A1B2C3D4' as defined below 05 A1 PIC X(8) VALUE IS 'A1B2C3D4' but i need to have A2,A3 as ABCD & 1234 repectively...... A2 = ABCD A3 = 1234 Can you please explain me what are the different ways to do it?
What kind of error is trapped by on size error option?
Which mode is used to operate the sequential file?
how to move the records from file to array table. give with code example