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 / muttaiah
My Opinion is we won't be able to change GOTO with Perform
here. why because if we use perform instead of goto like
this..
compute C = A + B.
Perform para 100-display.
compute D = C - D.
Perform 200-display.
what will happen means once c value is calculated. It wil
execute 100-display para once it completes. It will
calcualte d value. which is not the case in goto. Once C
value is calculated the control is passed to 100-display
para. The control will never return and cal D value.
what say!!
Correct me if i'm wrong please
| Is This Answer Correct ? | 10 Yes | 0 No |
Post New Answer View All Answers
What is amode(24)?
What are declaratives and what are their uses in cobol?
how to move the records from file to array table. give with code example
INREC AND OUTREC? HOW TO SPLIT 5K RECORDS TO DIFFERENT FILES IN A FILE IN COBOL? RESTART IN COBOL-DB2? ISOLATION LEVELS?
System Testing for Mainframe Developers What is System Testing? integration testing ? what's the procedure ..
What is the problem of ordered sequential files access?
i was faced one question- i have value -00001234.56 Suppress the zeroes and the output should be -1234.56 But Not - 1234.56 spaces should not be available after suppressing the zeroes. logic in jcl and cobol?
What is the difference between next sentence and continue in cobol programing language?
What is the difference between comp and comp-3?
How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?
What is the difference between Global and External Variables?
What are 77 levels used for?
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.
Explain how to differentiate call by context by comparing it to other calls?
Can you please let me know the centre name of INS certification in Kolkata.