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
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
What is perform what is varying?
What are different data types in cobol?
Difference between array and sub-script ?
what are decleratives in cobol?
What are declaratives and what are their uses in cobol?
What is the utilization of copybook in cobol? Could we utilize a similar copybook?
In which area will you utilize 88 level items in cobol?
What is the Purpose of POINTER Phrase in STRING command in COBOL?
What is rmode(24)
What is the difference between comp and comp-3 usage?
What is length is cobol?
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?
Write a program to enter and display the names of students in a class using the occurs clause.
how do you reference the esds vsam file formats from cobol programs