View previous topic :: View next topic
|
Author |
Message |
MKP
New User
Joined: 23 Aug 2006 Posts: 12 Location: Chennai
|
|
|
|
Hi All,
Can anyone tell me the output of this code, and the reason behind that.
Code: |
01 Ws-var.
10 A PIC x(10) values 'ABCDE12345'.
10 B REDEFINES A OCCURS 5 TIMES PIC X(2).
02 WS-SUB PIC 99 VALUE ZERO.
02 NUM1 PIC 99 COMP-3 VALUE ZERO.
02 NUM2 PIC 99 VALUE ZERO.
2000-MAIN-PARA.
LABELA MOVE B(2) TO NUM2.
LABELB DISPLAY 'NUM2' NUM2.
LABELC MOVE B(5) TO NUM1.
LABELD DISPLAY 'NUM1' NUM1.
LABELE MOVE B(1) TO NUM1.
LABELF DISPLAY 'NUM1' NUM1.
LABELG MOVE B(2) TO NUM1.
LABELH DISPLAY 'NUM1' NUM1.
|
|
|
Back to top |
|
|
bhavishya_bhandari
New User
Joined: 30 May 2006 Posts: 7
|
|
|
|
are u trying to move Alphabatic value to numeric ??
it will give S0C7 ..!! |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi there ,
It will display
NUM2:C4 because b(2) contain CD & u declare num2 as 99
not sure abt this why it is changiung it to C$.
NUM1:45 because b(5) contain 45
NUM1:12 because b(1) contain AB & u declared it 9(2) comp-3
NUM1:34 because b(2) contain CD & u declared it 9(2) comp-3 |
|
Back to top |
|
|
|