View previous topic :: View next topic |
Author |
Message |
enge Beginner
Joined: 12 Oct 2004 Posts: 78 Topics: 39
|
Posted: Fri Apr 29, 2005 7:21 am Post subject: decimals of a packed field in a zoned field |
|
|
hi all,
i have this problem:
in a field defined pic 9(7)V9(06) comp-3 i must move the decimals ( V9(06)) in a zoned field 9(06).
for example:
123,456 (packed) ---- > 456000 (zoned ,456000) but NOT 000456.
thanks in advance. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Fri Apr 29, 2005 7:49 am Post subject: |
|
|
Enge,
Try this
Code: |
01 WS-COMP3 PIC S9(07)V9(06) COMP-3 VALUE 123.456.
01 WS-NUM PIC 9(7).9(6).
01 WS-CHAR PIC X(14).
01 WS-INT PIC 9(7).
01 WS-DEC PIC 9(6).
MOVE WS-COMP3 TO WS-NUM
MOVE WS-NUM TO WS-CHAR
UNSTRING WS-CHAR DELIMITED BY '.' INTO WS-INT WS-DEC
|
Hope this helps...
Cheers
kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
|
|