01 A pic S9(3) COMP3
01 B REDEFINES A pic S9(6) COMP
Pd.
MOVE 100 TO B.
DISPLAY B ?
Whats the output of this REDEFINES
- dick scherrer
- Global moderator
- Posts: 6268
- Joined: Sat Jun 09, 2007 8:58 am
Re: Whats the output of this REDEFINES
Hello,
As i asked to your other topic, what happens when you try this?
As i asked to your other topic, what happens when you try this?
Hope this helps,
d.sch.
d.sch.
Re: Whats the output of this REDEFINES
Kinda got a problem, IIRC, 9(6) comp will occupy 4 bytes, while 9(3) comp3 will occupy 2 bytes, and I think COBOL gets really upset with a larger data area redefining a smaller one (he's OK with smaller redefining larger)....abkumarch wrote:01 A pic S9(3) COMP3
01 B REDEFINES A pic S9(6) COMP
MOVE 100 TO B.
DISPLAY B ?
So assuming you meant the other direction (or COBOL allowed it), A probably would contain an invalid low values....