How to replace the GOTO statement in COBOL without changing
the structure of program. e.g. consider following code...
I.D.
E.D.
D.D.
P.D.
compute C = A + B.
GOTO para 100-display.
compute D = C - D.
GOTO 200-display.
some other logic......
........
GOTO 300-para.
......
......
GOTO 400-para.
Now I want to replacce all GOTO statements without
changing the structure and otput of program.
Answer Posted / muttaiah
My Opinion is we won't be able to change GOTO with Perform
here. why because if we use perform instead of goto like
this..
compute C = A + B.
Perform para 100-display.
compute D = C - D.
Perform 200-display.
what will happen means once c value is calculated. It wil
execute 100-display para once it completes. It will
calcualte d value. which is not the case in goto. Once C
value is calculated the control is passed to 100-display
para. The control will never return and cal D value.
what say!!
Correct me if i'm wrong please
Is This Answer Correct ? | 10 Yes | 0 No |
Post New Answer View All Answers
Explain how to differentiate call by context by comparing it to other calls?
What is the LINKAGE SECTION used in COBOL?
What is the difference between external and global variables in COBOL?
What are the different rules for performing sort operation?
How do you differentiate between cobol and cobol-ii?
How do we get current date from system with century in COBOL?
What is the Purpose of Pointer in the string?
What is the problem of ordered sequential files access?
What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?
For rewrite, why is it mandatory that file needs to be opened?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?
if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need
What is a scope terminator give example?
What are different data types in cobol?
What is amode(24)?