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
What is rmode(24)
which is Best IBM Mainframe Training and Placement Institute in Ameerpet Hyderabad
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
Can you please let me know the centre name of INS certification in Kolkata.
How do you code cobol to access a parameter that has been defined in jcl? And do you code the parm parameter on the exec line in jcl?
How can you get the ksds file records into your cobol program?
What is the difference between comp and comp-3?
How to traceback if I am getting SOC7 or SOC4 abend? List down the steps
HOw can I get the negative sign while deduct high value from low value
Write a program to explain size error.
Write the code to count the sum of n natural numbers.
What is Pic 9v99 Indicates in COBOL?
Why would you use find and get rather than to obtain?
How to remove the spaces at the end of each record in the output file of variable length, via cobol program?
Can we change the password using ALTER? anyone tried and changed?