Multiple choice technology web technology

01 WS-TOP PIC X(1) 01 WS-TOP-RED REDEFINES WS-TOP PIC X(2). If you MOVE "12" to WS-TOP-RED, DISPLAY WS-TOP will show

  1. 12

  2. 1

  3. 2

  4. 121

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

In COBOL, WS-TOP is defined as PIC X(1) (1 character). WS-TOP-RED REDEFINES WS-TOP as PIC X(2) (2 characters). When you MOVE '12' to WS-TOP-RED, both characters are stored. However, WS-TOP can only access the first character due to its PIC X(1) definition, so DISPLAY WS-TOP shows '1'. Option C is correct.