removing '$' sign while reading source amount column

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
sridharvis
Premium Member
Premium Member
Posts: 26
Joined: Thu Apr 17, 2008 1:38 pm
Location: Chennai

removing '$' sign while reading source amount column

Post by sridharvis »

Hi,

I have a scenario where my source file has a amount column CLAIM_AMT.
The amount column comes as $100.00 in my source file, The source file is a csv file.

I need to multiply the CLAIM_AMT by 20 and load it to the target, so is there any way i can remove $ symbol when i read my source , instead of handling it in a transformer ?

Regards,
Sridhar V
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

You can treat $ as a delimiter and rest as decimal.

Can you provide one sample record.

What happens in case of negative, zero or null values ?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Assuming that CLAIM_AMT is a string, and that the "$" you wish to remove is in the first character position:

Code: Select all

Right(InLink.CLAIM_AMT, Len(CLAIM_AMT)-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