Looping Statements Interview Questions


Perform Statement -

How do you use loops in COBOL?

Looping programming involves making a set of statements run in a repetitive, iterative, or looping manner. In looping programming, the statements execute repeatedly until the coded condition is true.

What are the looping statement?

PERFORM Statement

Different types of perform statements?

PERFORM statement is mainly two types at high level based on how it is coded to perform the task –

  • Inline PERFORM
  • Outline PERFORM

What is PERFORM?

PERFORM statement executes the statement block repeatedly. The repetitive execution can be conditional or unconditional.

What is meant by an inline PERFORM?

PERFORM statement executes the statements block that is coded inline (between PERFORM and END-PERFORM).

What is the outline PERFORM?

PERFORM statement executes statements block that are coded outline (in a separate paragraph or section outside of PERFORM).

How do you use the PERFORM WITH TEST BEFORE statement in COBOL, and what is its purpose?

It tests the condition before executing the statements block. It is default with PERFORM if not coded any.

What is the use of the PERFORM WITH TEST AFTER statement in COBOL?

It tests the condition after executing the statements block. Statements block gets executed once regardless of the condition truth value.

Which Search verb is equivalent to PERFORM...VARYING?

Simple SEARCH

Frequently Asked Questions -

What are various types of Perform in COBOL?
Explain the different types of perform in programming?
What are different ways of PERFORM, If you want to come out of it and you use GOTO how will be the execution?

What is an in-line PERFORM?
How in-line PERFORM can be coded?
What is an in line PERFORM? What is the use of it?

What is the use of the PERFORM VARYING statement in COBOL, and how can it be used to implement loops with variable counters?

What search verb means PERFORM when it comes to varying?

What is the use of the PERFORM UNTIL statement in COBOL, and how is it different from the PERFORM VARYING statement?