Function to extract scale part of a Decimal value

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
suja.somu
Participant
Posts: 79
Joined: Thu Feb 07, 2013 10:51 pm

Function to extract scale part of a Decimal value

Post by suja.somu »

source column is a decimal data type of (7,2).

Data in source :

123.34
3456.45
12.45
8.1

Question is: what is the funtion that I can use to extract the scale part of the decimal

as in source



123.34 --> 34
3456.45 --> 45
12.45 --> 45
8.1 --> 1
chandra.shekhar@tcs.com
Premium Member
Premium Member
Posts: 353
Joined: Mon Jan 17, 2011 5:03 am
Location: Mumbai, India

Post by chandra.shekhar@tcs.com »

You can use any of the below functions to get the o/p :-

1) MantissaFromDecimal(<Column1>)
2) Field(<Column1>,'.',2)
Thanx and Regards,
ETL User
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Or even fieldname - Int(fieldname), multiplied by 10**x where x is the number of digits.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
suja.somu
Participant
Posts: 79
Joined: Thu Feb 07, 2013 10:51 pm

Post by suja.somu »

Thanks for the input. Closing the post as resolved.
Post Reply