Adding Zeros to string

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
LavanyaRamesh007
Participant
Posts: 42
Joined: Mon Apr 21, 2008 1:49 am

Adding Zeros to string

Post by LavanyaRamesh007 »

My input is something like this:
Input:'ABC DEF GHI'
Input string has few spaces in between, and I want the output in such a way that Zeros come in everyblank space. All the spaces need to be replaced by zeros

Output shoud be: 'ABC00DEF0GHI'. Should i have to use transformer to achieve this? And is there any function or a routine that will help me do this?
satishbalantrapu
Participant
Posts: 12
Joined: Wed Jul 25, 2007 6:56 am
Location: Hyd

Re: Adding Zeros to string

Post by satishbalantrapu »

Yes
You can use convert function in transformer

Thanks,
Satish
AmeyJoshi14
Participant
Posts: 334
Joined: Fri Dec 01, 2006 5:17 am
Location: Texas

Post by AmeyJoshi14 »

Hi,
You can use Parallel version of Ereplace()... :wink:
The below link might help you out:
viewtopic.php?t=106358&highlight=Ereplace

With the help pf the above link you can also build your own routine to achieve this... :)
http://findingjobsindatastage.blogspot.com/
Theory is when you know all and nothing works. Practice is when all works and nobody knows why. In this case we have put together theory and practice: nothing works. and nobody knows why! (Albert Einstein)
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

Convert function will do the trick.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

... Convert() uses fewer resources than Ereplace().
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
LavanyaRamesh007
Participant
Posts: 42
Joined: Mon Apr 21, 2008 1:49 am

Post by LavanyaRamesh007 »

ray.wurlod wrote:... Convert() uses fewer resources than Ereplace(). ...
Hi Guys..

It worked out. Thanks a lot
Post Reply