Removing all preceding zeros [0]

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
Sourav
Participant
Posts: 17
Joined: Tue Sep 04, 2007 5:34 pm
Location: Delhi

Removing all preceding zeros [0]

Post by Sourav »

hi,

I have a source records which are not fixed length.I am giving some examples as mentioned below :

1. 0012345
2. 072945
3. 001239567
4. 1234576
5. 0007992345

But i need only those records except 0 [ removing all 0 from the preciding position ] means output will be like as follows .
1. 12345
2. 72945
3. 1239567
4. 1234576
5. 7992345

Kindly help me ..
nagarjuna
Premium Member
Premium Member
Posts: 533
Joined: Fri Jun 27, 2008 9:11 pm
Location: Chicago

Post by nagarjuna »

Read it as an integer
Nag
samsuf2002
Premium Member
Premium Member
Posts: 397
Joined: Wed Apr 12, 2006 2:28 pm
Location: Tennesse

Post by samsuf2002 »

Search the forum.
hi sam here
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The TRIM function, while usually called with only one parameter, has several options that are quite handy. In this case, you could do a

Code: Select all

Trim(In.NumberColumn,'0','L')
This means trim all leading 0's from the column "In.NumberColumn".
Post Reply