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
What guidelines should be followed to write a structured cobol prgm?
What is the local-storage section?
What is the difference between Global and External Variables?
how do you reference the fixed unblock file formats from cobol programs
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
When is inspect verb is used in cobol?
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?
Can you please let me know the centre name of INS certification in Kolkata.
Define static linking and dynamic linking.
What is link edit in cobol?
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.
What is comp-1 and comp-2?
Is it possible that the redefines clause has different picture clauses compared to the one it redefined?
Explain the configuration section of a cobol program with examples of syntax.
Are you comfortable in cobol or jcl?