Multiple choice technology mainframe

In Working Storage section, 02 A PIC 9 VALUE 2. 02 B REDEFINES A PIC 9. 02 C REDEFINES A PIC 9. Following statement is present in Procedure Division. Compute A = B + C What will be the values in A, B and C after executing the above statement?

  1. A=4, B=2, C=4

  2. A=4, B=4, C=4

  3. A=2, B=2, C=2

  4. Statement will be errored out.

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

REDEFINES makes B and C share the same memory location as A. Initially, all three equal 2. When 'COMPUTE A = B + C' executes: B is 2, C is 2, so B+C = 4. This 4 is stored in A. Since B and C redefine A, they immediately reflect A's new value. All three now equal 4 because they reference the same memory location. Redefinition creates shared storage, not independent copies.