problem while setting the precesion for a column

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
suneyes
Participant
Posts: 82
Joined: Mon Jul 21, 2008 8:42 am

problem while setting the precesion for a column

Post by suneyes »

Hi,
I have a SQL statemet like
select
trim(to_char(((( 46900.69 - 46057.79 ) * 36500 ) / ( 46057.79 * to_number(to_date(20080624,'yyyymmdd') - to_date(20080601,'yyyymmdd')) ) ) - ( 0.0734 * 100 ),'s999.9999999999' ))
from dual


whose out put looks like this
+21.7027667540

Now I need to implement similar functionality in datastage transformer stage where alll the values present in the above query are input columns to the transformer stage.

I have implemented similar functionality using datastage .
But I am having problem with the sign(+/-) and precesion of the result.
Sign is shown only for '-'ve results.
I need to get the output in 's999.9999999999' format.

Is there any way in datastage where we can menction the precesion of an output column??

Please help me with this
sun
dspxlearn
Premium Member
Premium Member
Posts: 291
Joined: Sat Sep 10, 2005 1:26 am

Post by dspxlearn »

By default we don't get '+' signs for any positive calculations as we get '-' sign for negative values.
If your requirement is to have an '+' sign simply concatinate '+' to your calculation result. But, your target data type should be of Varchar/Char type.
Thanks and Regards!!
dspxlearn
suneyes
Participant
Posts: 82
Joined: Mon Jul 21, 2008 8:42 am

Post by suneyes »

dspxlearn wrote:By default we don't get '+' signs for any positive calculations as we get '-' sign for negative values.
If your requirement is to have an '+' sign simply concatinate '+' to your calculation result. But, your target data type should be of Varchar/Char type.
and any idea about precesion ??
sun
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Precision and scale are set for the Decimal data type. When you are converting this to a string, the precision and scale of the Decimal input field are preserved in the string output field. You may also need the optional argument fix_zero, to specify that a decimal number consisting of all zeroes is to be treated as valid.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply