Loading into Packed Decimal Field

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
irajasekharhexa
Premium Member
Premium Member
Posts: 82
Joined: Fri Jun 03, 2005 5:23 am
Location: Bangalore
Contact:

Loading into Packed Decimal Field

Post by irajasekharhexa »

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
Rajasekhar
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

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.
Post Reply