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
-
AnushaReddy
- Participant
- Posts: 13
- Joined: Thu Dec 02, 2010 2:55 am
Post
by AnushaReddy »
Hi,
There is a oracle table which has below column
"DEP_ID" Decimal(22,5)
But while reading data from the table using datastage i have declared metadata in the "ORACLE CONNECTOR" as Decimal(22,2)
My concern is will it just truncate the rest of the decimal part or will it round off?
Data in the table " 23.56789"
When read using datastage will it be 23.56 or 23.57
-
anbu
- Premium Member
- Posts: 596
- Joined: Sat Feb 18, 2006 2:25 am
- Location: india
Post
by anbu »
Why dont you run the job and see the result?
You are the creator of your destiny - Swami Vivekananda
-
priyadarshikunal
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
Post
by priyadarshikunal »
there is a environment variable for that, have a look.
why not read the value as it is and then round or truncate as your job logic. This gives you more control over the data.
Priyadarshi Kunal
Genius may have its limitations, but stupidity is not thus handicapped.
-
AnushaReddy
- Participant
- Posts: 13
- Joined: Thu Dec 02, 2010 2:55 am
Post
by AnushaReddy »
I am able to see the data is being round off to the nearest value.
So need help to prevent this.
Input : 123.448
Output as per data stage job : 123.45
Output expected is : 123.44
-
anbu
- Premium Member
- Posts: 596
- Joined: Sat Feb 18, 2006 2:25 am
- Location: india
Post
by anbu »
Use oracle function trunc
2 is the number of decimal places to truncate to
You are the creator of your destiny - Swami Vivekananda
-
chulett
- Charter Member
- Posts: 43085
- Joined: Tue Nov 12, 2002 4:34 pm
- Location: Denver, CO
Post
by chulett »
Or select it with the proper scale and then use DecimalToDecimal() within the job to truncate it during the conversion to the lower scale.
-craig
"You can never have too many knives" -- Logan Nine Fingers
-
ray.wurlod
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
-
Contact:
Post
by ray.wurlod »
Learn about the rtype option that goes with these conversion functions to specify how you want the value to be rounded.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.