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
problem while setting the precesion for a column
Moderators: chulett, rschirm, roy
and any idea about precesion ??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.
sun
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.