Multiple choice technology mainframe

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

When storing a date as alphanumeric characters in YYYYMMDD format (8 bytes), the COBOL picture clause is PIC X(8). This defines an 8-character alphanumeric field. COBOL has no built-in DATE picture clause that automatically formats as YYYYMMDD.