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.
Loading...
Related Quiz
- You are designing a COBOL program to handle employee records, which include both personal and job-related data. How would you structure the data to represent these two categories effectively?
- In COBOL, when specifying an alternate index, the ALTERNATE KEY IS clause is used to define the _______ structure.
- You are working on a COBOL program that deals with financial transactions. Which COBOL data type would you choose to store currency amounts with two decimal places accurately?
- You are tasked with processing sales transaction data, and some transactions may be recorded twice due to system glitches. How would you ensure that such duplicate transactions are detected and managed correctly?
- What is a cursor in COBOL when dealing with database operations?