Wat is the difference between NEXT and CONTINUE statement in
cobol,can any one explain with example.
Answers were Sorted based on User's Feedback
Answer / ankur kar
the following code explains u clearly
it will display only 3. if a>b
it will display 1 2 3. if a>b. let me know if it is not
|Is This Answer Correct ?||95 Yes||15 No|
Answer / satish k
Explanation for Next sentence:
So, over here the output is no doubt 3 provided A>B id true.
well, but it works is, the next sentence will always search
for the next executable sentence in the flow.
Here, the next executable sentence was display 3.so, it
executes and gives output as 3.
Explanation for Continue:
Here in Continue statement, it is just like 'do nothing'.
so, it will executes all the display statements.
|Is This Answer Correct ?||37 Yes||2 No|
Answer / krishna kumar
NEXT SENTENCE gives control to the verb following the next
period(.) while CONTINUE gives the control to the next verb
after the END-IF.
|Is This Answer Correct ?||36 Yes||3 No|
Answer / shubha
continue is no operation stmt, which transfers the control
to next stmt.
where as 'next sentence' transfers the control to next
|Is This Answer Correct ?||29 Yes||10 No|
Answer / girish kanswa
continue means it pass the control to the stmt when it find
explicit scope terminator(end-if,end-perform),and next
sentence means it pass d cntrl to d next sentence when it
finds implicit scope terminator(.)
|Is This Answer Correct ?||22 Yes||4 No|
Answer / osachari
next sentence transfers the control to the sentence which
after the first period. where as continue transfers the
control to the statement after the first scope
|Is This Answer Correct ?||6 Yes||0 No|
Answer / 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.
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
IF A = B
IF C = D
DISPLAY 'NOT EQUAL'
IF E = G
IF F = H
DISPLAY 'STRINGS ARE NOT EQUAL'
DISPLAY 'STRINGS ARE EQUAL'
STRINGS ARE EQUAL.
|Is This Answer Correct ?||8 Yes||2 No|
Answer / abhilash
Both mean transfer of control.
Continue - Will transfer control to next statement after
explicit scope terminator.( end-if, end-perform etc.)
Get Next - Will transfer control to next statement after
Implicit scope terminator (. operator)
|Is This Answer Correct ?||3 Yes||0 No|
Answer / vinutna koritala
continue will skip control to next executable instruction
after scope terminator. Next sentence will pass control to
next sentence after fullstop.Always prefer continue
|Is This Answer Correct ?||16 Yes||15 No|
Answer / 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
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.
|Is This Answer Correct ?||1 Yes||0 No|
How can we increase the size of an existing PDS to include more no. of modules. I tried the answer posted by Jagan(TSO PDS 'pds name') but did not find it working. The answer posted by kamal i know very well. Please suggest me a answer so that we don't need to delete the existing PDS and still we can change the size as well.
how can u pass the values into db2 values from cobol ?
How to find How Many Lines in Sysin DD * Parameter Thru Cobol Coding? If any one knows the Answer Please Reply .....Thanks From Shree
What is the linkage section?
How can we find out wether to declare the data items like Integer, Char,Comp? If comp types how can we decide wether it is Comp and Comp3.How it is? Please Explain... Cheers.
How to read a record from bottom of a file which is indexed by 'A'.
in how many mode we can open a file ?
what is a load module ?
In COBOL CALL-CALLING,if a program A is calling 3 sub- programs, dynamically, then it is said sub-programs will always will always in Initial Mode. My question is : Do we need to code CANCEL or (IS INITIAL) for dynamically called sub-programs or it is the property of Dynamically called pgms so every time sub-pgms are called they will be in initial mode. ***This question is only Dynamic call****, Please reply. Thank you in advance.
Wat is the difference between NEXT and CONTINUE statement in cobol,can any one explain with example.
I have a field with data type X(10). I want to perform arithmetic operation on this field? I tried doing it by moving the value into a numeric field. but it didn't work out. I am getting a S0C7 abend. Pls let me know if there is any way of getting this done?
how can u redefine picx(10) with pic 9(6).