You are coding a COBOL program that reads records from a file until a specific condition is met. Which type of PERFORM loop and termination condition would you use in this scenario, and why?

  • PERFORM THRU loop with a condition
  • PERFORM UNTIL loop with a condition
  • PERFORM VARYING loop with a condition in AFTER clause
  • PERFORM WITH TEST BEFORE loop with a condition
A PERFORM UNTIL loop with a condition would be suitable for reading records from a file until a specific condition is met. The PERFORM UNTIL loop iterates until the specified condition becomes true, making it ideal for scenarios where you need to process records until a certain criterion is satisfied.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *