Replace . from integer

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
halpavan2
Participant
Posts: 31
Joined: Fri Apr 18, 2008 5:44 am
Location: Hyderabad

Replace . from integer

Post by halpavan2 »

Hello

I want to replace . from integer, how can i do this. I searched in fourm not able to find.

Input file.
1.0
2.0

Output should be
1
2

can anybody please help.

Thanks
Pavan
pavan
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Output where? To what datatype? You'll need to format it as a string to remove the natural decimal attributes you are showing now.
-craig

"You can never have too many knives" -- Logan Nine Fingers
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

To convert your number/decimal to an integer, as opposed to from an integer, try the AsInteger() function.
Choose a job you love, and you will never have to work a day in your life. - Confucius
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Or that. :wink:
-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 »

If the data type is string, you can use

Code: Select all

Field(InLink.TheString, ".", 1, 1)
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