TRIM leading zeros

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
hargun
Participant
Posts: 188
Joined: Mon May 16, 2011 7:41 pm
Location: United States

TRIM leading zeros

Post by hargun »

hi,

i am getting column name acct_num as varchar(23) from source as DB2 stage and loading as it to target oracle table as acct_num varchar(30).

my job design is

DB2 STAGE.........xfm...............oracle stage


the data i m getting like this 00000000000000000664373.
i want to trim the leading zeros and want 664373 as output

in transformer i use trim(acct_num) but doesn't work.

please help me on this.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You have to tell it WHAT you want trimmed - by default it trims spaces. And you should also ensure you specify "leading".
-craig

"You can never have too many knives" -- Logan Nine Fingers
hargun
Participant
Posts: 188
Joined: Mon May 16, 2011 7:41 pm
Location: United States

Post by hargun »

Thanks chulett, I tried by giving leading and it works fine.
Post Reply