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


Please Help Members By Posting Answers For Below Questions

How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)

2718


What is perform what is varying?

698


What are different data types in cobol?

683


Difference between array and sub-script ?

1157


what are decleratives in cobol?

1825






What are declaratives and what are their uses in cobol?

702


What is the utilization of copybook in cobol? Could we utilize a similar copybook?

704


In which area will you utilize 88 level items in cobol?

709


What is the Purpose of POINTER Phrase in STRING command in COBOL?

711


What is rmode(24)

676


What is the difference between comp and comp-3 usage?

670


What is length is cobol?

641


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?

690


Write a program to enter and display the names of students in a class using the occurs clause.

645


how do you reference the esds vsam file formats from cobol programs

625