Populte Decimal value to a fixed width Seq. 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
ambasta
Participant
Posts: 93
Joined: Thu Jan 19, 2006 10:29 pm
Location: Bangalore

Populte Decimal value to a fixed width Seq. file

Post by ambasta »

Hi,
My Requirement is...
Source is oracle [Decimal(5,2)] and target is sequential file[7,2].how can we populate it.
Ex..if data is coming like 123.45 then populate 00123.45.
is it possible to populate decimal value in a fixed width file???
Can anyone please help me.
ambasta
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Same answer as in your other thread. Yes?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ambasta
Participant
Posts: 93
Joined: Thu Jan 19, 2006 10:29 pm
Location: Bangalore

Post by ambasta »

I am not sure...can we have anything like char(7,2)in sequential fixed width file???.if it is so,then according to my requirement it will occupy 8 spaces as period will also occupy one sapce.
ambasta
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Just declare it as a char(8).
-craig

"You can never have too many knives" -- Logan Nine Fingers
Kirtikumar
Participant
Posts: 437
Joined: Fri Oct 15, 2004 6:13 am
Location: Pune, India

Post by Kirtikumar »

Can it be done in the char(8)?
As per my understanding Decimal fields with decimal need two extra bytes one for period and one for sign. So data 00123.45 will need char(9) - 1 sign bytes, 5 bytes before decimal, 1 bytes for period and 2 bytes for after decimal.
Regards,
S. Kirtikumar.
Post Reply