How do you define COMP-1 / COMP-2?
-
DEFINE WS-VAR PIC(9) COMP-1
-
01 WS-VAR PIC(9) COMP-1
-
01 WS-VAR USAGE COMP-1
-
Author should learn COBOL
Reveal answer
Fill a bubble to check yourself
C
Correct answer
Explanation
COMP-1 and COMP-2 are defined using the USAGE clause, not the PIC clause. The correct syntax is '01 WS-VAR USAGE COMP-1' for single-precision floating point or 'USAGE COMP-2' for double-precision. Options A and B incorrectly use PIC.
AI explanation
COBOL data items declare a usage clause with the USAGE keyword (or it can be implicit), so a floating-point item is defined as 01 WS-VAR USAGE COMP-1. There's no DEFINE verb for data definitions in COBOL, and omitting USAGE before the type keyword isn't standard syntax for declaring the usage clause explicitly.