Page 1 of 1

Populte Decimal value to a fixed width Seq. file

Posted: Fri Oct 06, 2006 5:51 am
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.

Posted: Fri Oct 06, 2006 6:03 am
by chulett
Same answer as in your other thread. Yes?

Posted: Fri Oct 06, 2006 6:22 am
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.

Posted: Fri Oct 06, 2006 6:28 am
by chulett
Just declare it as a char(8).

Posted: Mon Oct 09, 2006 12:43 am
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.