Losing Decimal Values

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
JezT
Participant
Posts: 75
Joined: Wed Sep 15, 2004 1:52 am

Losing Decimal Values

Post by JezT »

I have a job that loads value data into a DB2 table. The source file has the values stored as a BigInt (15) whereas the target is set to Decimal (15,2).

As the source values are in pence and we want to load as pounds I am dividing the source value by 100.

So if my source value is 2079, I want to load it as 20.79 but when I run the job it is being loaded as 20.00 and the 'pence' value is being lost.

Any suggestions ?
girija
Participant
Posts: 89
Joined: Fri Mar 24, 2006 1:51 pm
Location: Hartford

Post by girija »

Use AsDouble or AsFloat and divide by 100.0. C/C++ syntex.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Try Decimal(17,2). The precision figure includes the scale digits.
Or try Oconv(InLink.TheAmount, "MD2") as your conversion.

AsDouble() and AsFloat() are pertinent only to parallel jobs.
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