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 / suraj borge
Using evaluate statement
take the value of para in a variable then evaluate it for ex.
evaluate xyz
when 100 perform para-100
when 200 perform para-200
..
.
.
.
.
like that we can replace the goto statement .
| Is This Answer Correct ? | 8 Yes | 2 No |
Post New Answer View All Answers
Difference between array and sub-script ?
what happens if parmparameter passes zero bytes to the program
1.Is it possible to move the data from 99.99 to 99v99? 2.What is the CICS-vsam Compilation process? 3.In My GDG 5 generation will be there GDG3 got an abend what will happen? 4.In my GDG first generation is +1 And I want to add the new generation what will happen previous generation? 5.How can you give the PIC clause below conditions A). s9 (reddy), B). s9 (5) occurs 5 times? 6.How override the proc from a particular step? and what is symbolic and override Procs?
What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?
What guidelines should be followed to write a structured cobol prgm?
Discuss about changing dataset name in proc.
What is the difference between next sentence and continue in cobol programing language?
Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc
What are the rules of the move verb?
What is the difference between structured cobol programming and object alternativelyiented cobol?
What is the difference between Call and a Link?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?
What are all the divisions of a COBOL program?
What is the default value(s) for an initialize? What keyword will allow for an override of the default?
How you can read the file from bottom?