Multiple choice technology mainframe

What is the syntax to find actual lenght of a record in a variable file in Cobol?

  1. Not possible

  2. Using RECORD SIZE def in FD seciton

  3. RECORD IS DEPENDING ON BATCH-RECORD-SIZE where BATCH-RECORD-SIZE is 77 working storage varaible

  4. RECORD is varying depending on BATCH-RECORD-SIZE wher BACTCH-RECORD-SIZE is 77 working storage varibale

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

In COBOL, for variable-length records, the correct syntax is RECORD IS VARYING DEPENDING ON followed by the variable name that holds the actual record length. This is specified in the FD (File Description) section. The variable must be defined in WORKING-STORAGE as a 77-level item.