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

What guidelines should be followed to write a structured cobol prgm?

673


What is the local-storage section?

683


What is the difference between Global and External Variables?

666


how do you reference the fixed unblock file formats from cobol programs

712


write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc

712






When is inspect verb is used in cobol?

679


I have a program with an Array of 5000 occurences which is being passed from 5 sub levels to the front end screen. Thess 5 programs using each 5*2 = 10 different arrays with size as 5000. This is causing the transaction to utilize more storage consupmtion. I am looking to reduce the storage consumption. As part of that initially i thought Dynamic array may solve my problem. After viewing the comments given i see its same as normal array. IS there any other way we can resolve this issue?

1232


Can you please let me know the centre name of INS certification in Kolkata.

1717


Define static linking and dynamic linking.

669


What is link edit in cobol?

774


Program A (Normal COBBAT) calling a B Program (DB2COBOL, COBBATDB which is using a VSAM file. its a dynamic call. How we will handle VSAM file decleration in our from JCL from where we are running A PGM. And should we have PLAN for A pGM also. if possible can some one post a sample JCL. Thanks for help in advance.

5065


What is comp-1 and comp-2?

766


Is it possible that the redefines clause has different picture clauses compared to the one it redefined?

678


Explain the configuration section of a cobol program with examples of syntax.

661


Are you comfortable in cobol or jcl?

643