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
I have program P1 which calls file F1 which has 100 records and following structure 001 .................. 002 .................. 003 .................. 098 .................... 099 ................... 100 .................... Now I want to read these files and write these records in file F2 in following manner. 001 ...... 051 ..... 002 ...... 052 ..... 003 ...... 053 ..... .......... ....... .......... ....... .......... ....... 048 ........ 098 ...... 049 .......... 099 ....... 050 .... 100 ......
What is the difference between PIC 9.99 and PIC9v99?
How do you define a variable of comp-1 and comp-2?
How to know whether the module is dynamical or statistical?
What is the difference between binary search and sequential search?
what is the difference between COBOL2 AND COBOL390?
Give some examples of command terminators?
What is amode(24)?
can you please let me know if there is any walkins for COBOL/PLI/DB2/IMS/JCL in pune other than IBM and ITC infotech
What is the Purpose of POINTER Phrase in STRING command in COBOL?
How to print 10 to 1 if the input have only 10 digit number?
I have to write to a outfile where the number of records in that file should be the header of that file using IMS.. can anyone help me in this issue
What rules are to be followed while using the corresponding options?
What are the pertinent COBOL commands?
What are the different rules for performing sort operation?