Interview Questions

What is PERFORM? What is VARYING?

COBOL Interview Questions


(Continued from previous question...)

What is PERFORM? What is VARYING?

Q: What is PERFORM? What is VARYING? (More details about these clauses)

A: The PERFORM statement is a PROCEDURE DIVSION statement which transfer control to one or more specified procedures and control as specified the number of times the procedures are executed. After execution of the specified procedures is completed. (i.e.., for the appropriate number of times or until some specified condition is met), control is transferred to the next executable statement following the PERFORM statement. There are 5 types of PERFORM statement:
a) Basic PERFORM
b) PERFORM TIMES
c) PERFORM UNTIL
d) PERFORM VARYING
e) IN-LINE PERFORM

(Continued on next question...)

Other Interview Questions