Multiple choice technology mainframe

You store date 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 YYYYMMDD in 8 bytes without editing, it's stored as an alphanumeric string. PIC X(8) defines an 8-byte alphanumeric field, which is appropriate for this format. The other options are invalid or inappropriate PIC clauses.