In a COBOL program, you are tasked with processing a file containing variable-length records representing student transcripts. You need to determine the total number of records and their average length. Which COBOL construct would you use to achieve this?

  • FILE STATUS
  • LINAGE IS 66
  • OCCURS
  • RECORDING MODE IS V
The OCCURS clause in COBOL is used to define a table, and it can be leveraged to process variable-length records. By using OCCURS, you can iterate through the records, calculate the total length, and determine the average length based on the number of records processed.
Add your answer
Loading...

Leave a comment

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