Urgent ********* Decimal to pass without rounding

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
DS4DRIVER
Premium Member
Premium Member
Posts: 39
Joined: Thu Oct 30, 2003 1:37 pm

Urgent ********* Decimal to pass without rounding

Post by DS4DRIVER »

Hi,
I have a PX job that reads a Sequential File and Loads the data into a DB2 table. One of the Column is defined as Decimal 16 with Precision 15. After running the job, when i checked the Output in DB2 table, this Column had rounded values.

Is there any way that i can make my job read the Column value as it is from the Sequential file and load the data into the table without any rounding.

Example of one of the Result for this column

Loaded Value(In the Table) Expected Value(Comming from the Source)
-0.000000009200000 -0.000000009169240

FYI: i used the function- DecimalToDecimal(PCT_SETLMT)
This is rounding off the whole value to 0's

I also used DecimalToDecimal(PCT_SETLMT, 15)
This gives a Fatal Error: APT_CombinedOperatorController(1),3: Caught exception from runLocally(): APT_ParseError: Parsing parameters "15" for conversion "decimal=decimal_from_decimal(decimal)": Unexpected input "15" found at beginning of conversion args

This is the way this function should be used-
DecimalToDecimal(%decimal%,[%rounding%])
mpouet
Participant
Posts: 34
Joined: Mon Oct 18, 2004 10:23 am
Location: France

Re: Urgent ********* Decimal to pass without rounding

Post by mpouet »

Hi,

Declare your field in the sequential file as string 18 and try this :
StringToDecimal(convert(".", "", Link.Field))/1000000000000000

It must work... tell us

Bye
Matthieu
Post Reply