Wat is the difference between NEXT and CONTINUE statement in
cobol,can any one explain with example.
Answer Posted / rajasekhar
.NEXT Sentence is used to skip the statements and the control will move after the period operator.
.CONTINUE is statement in which the control is move to after scope terminator.
Example:
ws section
01 A PIC 99 VALUE 2
O1 B PIC 99 VALUE 2
01 C PIC 99 VALUE 3
01 D PIC 99 VALUE 3
01 E PIC XXXXX VALUE HAI
01 F PIC XXXXX VALUE HELLO
01 G PIC X(3) VALUE HAI
01 H PIC X(5) VALUE HELLO
PROCEDURE DIVISION
IF A = B
IF C = D
NEXT SENTENCE
DISPLAY 'NOT EQUAL'
END-IF.
DISPLAY 'EQUAL'
END-IF.
IF E = G
IF F = H
CONTINUE
DISPLAY 'STRINGS ARE NOT EQUAL'
END-IF.
DISPLAY 'STRINGS ARE EQUAL'
END-IF.
STOP RUN.
OUTPUT:-
EQUAL
STRINGS ARE EQUAL.
| Is This Answer Correct ? | 8 Yes | 3 No |
Post New Answer View All Answers
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
how do you reference the rrds file formats from cobol programs
EXPLAIN MAIN FRAME TESTING PROCESS...HOW TO FIX THE MAINFRAME BUGS?
If you are current on the owner of a set, what is the difference between obtain next and obtain first?
If you are current on the owner of a set, what is the difference between an obtain next and obtain first? Actually in which topic will we use dis???Plz explain it clearly
In COBOL, what is the different between index and subscript?
i have 10 names in an array and my name is one of them also array is not in sorted order i need to display my name using index how will i do this
How do we get current date from system with century in COBOL?
Give some examples of command terminators?
Why is it necessary that file needs to be opened in I-O mode for REWRITE?
Are you comfortable in cobol or jcl?
What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?
Hi pls anybody tell me about " ANALYSIS DOCUMENT PREPARATION AND ESTIMATION OF TASK " (in real time project)."I want to update a sequential file in my project" for that purpose i need both structures i mean analysis document and estimation of task.
What are all the divisions of a COBOL program?
write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc