how to remove commas ?

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
jayawant_hsbc
Participant
Posts: 7
Joined: Wed Jan 05, 2005 11:05 pm

how to remove commas ?

Post by jayawant_hsbc »

hi my problem is that,
we r reading frm a flat file and the digits are seperated by commas and we need to remove the commas ex
1,500.00 is to be formatted to 1500.00.
tell me the solution using enterprise edition as well as server edition
thankyou
rasi
Participant
Posts: 464
Joined: Fri Oct 25, 2002 1:33 am
Location: Australia, Sydney

Post by rasi »

Hi

In Server there are so many ways to do this. The easiest is to replace , with nothing. Also you can use Oconv(Oconv(Input,"MCN"),"MD2") to convert it to your format.
Regards
Siva

Listening to the Learned

"The most precious wealth is the wealth acquired by the ear Indeed, of all wealth that wealth is the crown." - Thirukural By Thiruvalluvar
nchincholikar
Participant
Posts: 21
Joined: Sun Jul 18, 2004 11:32 pm

Re: how to remove commas ?

Post by nchincholikar »

[quote="jayawant_hsbc"]hi my problem is that,
we r reading frm a flat file and the digits are seperated by commas and we need to remove the commas ex
1,500.00 is to be formatted to 1500.00.
tell me the solution using enterprise edition as well as server edition
thankyou[/quote]

Try using
Oconv(IConv(To_T.Salary,"MD2"),"MD2")

Regards
Naren
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The fastest solution is Convert(",", "", TheNumber) - to which rasi alluded.
This function is available in both server and enterprise (parallel) editions.
For mainframe (390) jobs the CONVERT function is not available; you would need to manufacture something using POSITION, SUBSTRING and CHARACTER_LENGTH built-in functions.
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