Multiple choice technology mainframe

how many bytes s9(9) comp-3 takes

  1. 2

  2. 5

  3. 6

  4. 9

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

In COBOL, S9(9) COMP-3 (packed decimal) format stores each digit in half a byte (nibble), with the last nibble holding the sign. For 9 digits plus sign: (9 digits / 2 digits per byte) = 4.5 bytes, which rounds up to 5 bytes total. The formula is: (integer_digits/2) + 1, giving (9/2) + 1 = 5 bytes for S9(9) COMP-3.