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 / krishnan a
Instead of GOTO we can use PERFORM noneed to go EVALUATE
also
compute C = A + B.
PERFORM 100-display.
compute D = C - D.
PERFORM 200-display.
some other logic......
........
PERFORM 300-para.
......
......
PERFORM 400-para.
Is This Answer Correct ? | 8 Yes | 5 No |
Post New Answer View All Answers
Write the code implementing the perform … varying.
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?
In COBOL programming, what is PERFORM? What is VARYING?
What is inspect in cobol ?
I have File 1 occurs 5 times with Employee-ID,Employee-Name,Employee-Dept (EEE and MECH). I have File 2 occurs 10 times with Employee-ID,Employee-Name,Employee-Dept (EEE,CIVIL,CHEMICAL and MECH). In FIle 1 and FIle 2 , for matching Employee-DEPT (Only MECH) , we need to move entire records from file1 to file 2. We should not use 2D array. Your help is needed here.
How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?
What is the use of intialize verb?
What is report-item in COBOL?
What kind of error is trapped by on size error option?
What is the difference between Global and External Variables?
How do you get the data to code the BMS macro?
What are declaratives and what are their uses in cobol?
What rules are followed by the search verb.
What are the different rules for performing sort operation?
How arrays can be defined in COBOL?