Multiple choice technology mainframe

WS-NUM-1 PIC S9(04)MOVE -95 TO WS-NUM-1DISPLAY WS-NUM-1 What will be the display?

  1. 009E

  2. 009N

  3. 0095

  4. -0095

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

PIC S9(04) is a signed 4-digit number. When moving -95 to this field, it stores as X'009D' in hexadecimal. The last digit 'D' is the zoned decimal representation for signed negative 5 in COBOL's display format (C=positive, D=negative for certain digits). DISPLAY shows the last character as 'N' which is the EBCDIC character for hex D.