Multiple choice technology programming languages

You store it as YYYYMMDD in 8 bytes. What is the COBOL definition of this field?

  1. Pic Y(4)M(2)D(2)

  2. Pic date(yyyymmdd)

  3. Pic date(8)

  4. Pic X(8)

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

In COBOL, alphanumeric/string data is defined using PIC X(n) where n is the length. Since YYYYMMDD is stored as 8 characters, PIC X(8) is the correct definition. PIC Y, PIC M, PIC D are not valid COBOL picture clauses, and Pic date(...) is not standard COBOL syntax.