Decimal getting stored as Junk value in Sequential file

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
RAJARP
Participant
Posts: 147
Joined: Thu Dec 06, 2007 6:46 am
Location: Chennai

Decimal getting stored as Junk value in Sequential file

Post by RAJARP »

Hi,
In a parallel job, the target is a seq file with two columns(one char field and one decimal field(4,2))

If i do a 'view data' from the SF stage, I am able to see the data properly.

Char_field|decimal_field
a1234|4356.73

But If i try to open that from unix

cat filename.txt
Char_field|decimal_field
a1234|y5t

And obviously this 'y5t' is not from source.I am not sure how this is happening.

Somebody please help!!!!

Thanks in advance,
Raja R P
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Decimal values are stored in binary. Convert to VarChar if you want to see their text equivalent. You're lucky that the binary representation did not corrupt your stty settings. The data browser effects a conversion.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

And before you ask, you'll need to use the DecimalToString function to do that conversion properly.
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
RAJARP
Participant
Posts: 147
Joined: Thu Dec 06, 2007 6:46 am
Location: Chennai

Post by RAJARP »

Thanks Ray and Andy,
It worked.I Used DecimalToString :-)
Post Reply