Multiple choice technology mainframe

"Which tests are allowed with the following variable? 01 END-OF-FILE PIC X. 88 EOF VALUE 'N'."

  1. IF EOF THEN …

  2. IF EOF IS TRUE THEN ...

  3. IF END-OF-FILE = 'Y' THEN ...

  4. IF END-OF-FILE THEN ...

Reveal answer Fill a bubble to check yourself
A,C Correct answer
Explanation

In COBOL, the level 88 condition name EOF can be tested directly as a boolean: IF EOF THEN ... (tests if END-OF-FILE = 'N'). The underlying variable can also be compared to any value: IF END-OF-FILE = 'Y' THEN ... is valid syntax. IF EOF IS TRUE is not valid COBOL syntax for level 88 conditions, and a PIC X variable cannot be tested as a boolean without specifying a comparison.