Numeric to decimal Data Type problem

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
kd813
Participant
Posts: 20
Joined: Wed Feb 22, 2006 9:14 pm
Location: pune

Numeric to decimal Data Type problem

Post by kd813 »

Hi,

I am reading data as numeric(9,3) and the data is like 1.22,1.00,0.00.1.234,1.230
and want the output data in the below format as
1.22,1,0,1.234,1.23

how to achieve this?

Thanks,
kd813
Abburi
Participant
Posts: 31
Joined: Tue May 29, 2007 12:38 pm

Re: Numeric to decimal Data Type problem

Post by Abburi »

kd813 wrote:Hi,

I am reading data as numeric(9,3) and the data is like 1.22,1.00,0.00.1.234,1.230
and want the output data in the below format as
1.22,1,0,1.234,1.23

how to achieve this?

Thanks,
kd813
Hi,

are you talking about remove null/0 values which are placed after decimal point, say 1.00 to 1, is it ? Can you provide some more info for better understanding
ds_developer
Premium Member
Premium Member
Posts: 224
Joined: Tue Sep 24, 2002 7:32 am
Location: Denver, CO USA

Post by ds_developer »

Where are you putting the data...in a database, in a sequential file? The solution depends on your target.

John
kd813
Participant
Posts: 20
Joined: Wed Feb 22, 2006 9:14 pm
Location: pune

Post by kd813 »

ds_developer wrote:Where are you putting the data...in a database, in a sequential file? The solution depends on your target.

John

I m putting it in a sequential file
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The easiest solution is to use a server job or a "BASIC Transformer" stage in a parallel job. Simply add 0 to the number; DataStage BASIC returns the shortest possible string for each arithmetic result.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

Read it as 'Real' (9,3) you will get the output you asked for.
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
kd813
Participant
Posts: 20
Joined: Wed Feb 22, 2006 9:14 pm
Location: pune

Post by kd813 »

if i m reading it as real(9,3)
then the output is like
1.0123000E+01 for input 10.123
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

Just write what ever you read from the source as 'Real' to a peek or a file with final source value as VARCHAR and see the result.
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
kd813
Participant
Posts: 20
Joined: Wed Feb 22, 2006 9:14 pm
Location: pune

Post by kd813 »

going further its required to perform some mathematical operations on the data so its not feasible to store it as varchar
Post Reply