Hi,
I have a scenario where I need to Load 7 character length value into PIC S9(5) COMP-3 datatype filed, As per the datatype it is accepting only 5 characters from the source to target. If I tried to populate more than 5 characters the target field is filled with zeros. Is any possible way to acheieve this without changigng the target field length?
Regds
RS
Loading into Packed Decimal Field
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 82
- Joined: Fri Jun 03, 2005 5:23 am
- Location: Bangalore
- Contact:
Loading into Packed Decimal Field
Rajasekhar
PICS S9(5) COMP-3 is a standardized COBOL format, it can contains values from -99999 through 99999 and always uses 3 Bytes (6 nibbles or 24 bits) to store this information. Each digit is stored in 4 bits (1 nibble) and the sign occupies another 4 bits.
7 numeric digits will fit into a PIC S9(7) COMP-3 which occupies 4 Bytes of storage. If you only have 3 Bytes of space available, switch to COMP type.
7 numeric digits will fit into a PIC S9(7) COMP-3 which occupies 4 Bytes of storage. If you only have 3 Bytes of space available, switch to COMP type.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>