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

how to refer the data field?

1795


What is the difference between next sentence and continue in cobol programing language?

700


Which division and paragraphs are mandatory for a COBOL program?

704


What do you understand by psb and acb?

659


Write a program to enter and display the names of students in a class using the occurs clause.

642






How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)

2718


What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?

705


What is the use of intialize verb?

738


Name the divisions, which are available in a cobol program?

675


What is rmode(any) ?

676


What are the pertinent COBOL commands?

2617


What are INPUT PROCEDURE and OUTPUT PROCEDURE?

679


i made it to stage 3 of an interview process wednessday they will quiz my knowledge again face to face for an analyst role recruiter said it will be based on Business requirements system is cobol and good ideas what they might ask etc

2096


how do you define single dimensional array and multidimensional array in your cobol?

664


How can we find that module can be called – whether DYNAMICALLY or STATICALLY?

705