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


Please Help Members By Posting Answers For Below Questions

Write the code implementing the perform … varying.

646


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?

702


In COBOL programming, what is PERFORM? What is VARYING?

672


What is inspect in cobol ?

806


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.

1119






How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?

1949


What is the use of intialize verb?

751


What is report-item in COBOL?

711


What kind of error is trapped by on size error option?

743


What is the difference between Global and External Variables?

666


How do you get the data to code the BMS macro?

1476


What are declaratives and what are their uses in cobol?

714


What rules are followed by the search verb.

638


What are the different rules for performing sort operation?

763


How arrays can be defined in COBOL?

665