You are working on a COBOL program where you need to process a list of customer names. Which type of PERFORM loop would be most appropriate for this task, and why?

  • PERFORM THRU loop
  • PERFORM UNTIL loop
  • PERFORM VARYING loop
  • PERFORM WITH TEST BEFORE loop
A PERFORM VARYING loop would be most appropriate for processing a list of customer names. This loop is used when there is a need to iterate through a range of values, such as processing elements in an array or a list. It allows you to control the loop by specifying the initial and final values, making it suitable for handling customer names sequentially.
Add your answer
Loading...

Leave a comment

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