Left Padding

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
sreddy
Participant
Posts: 144
Joined: Sun Oct 21, 2007 9:13 am

Left Padding

Post by sreddy »

Hi

I have a conversion job, job is working fine. But one of the column data is not matching when compare to production.

column data type is Char ( 9 )

In my production table the data is like this

000000001
000006535
000000023
009864321

After i ran job the data is loading in this format

1
6535
23
9864321

I need to add 0's ln left side.

Will it works
Str("0",9-Len(Lnk_In.V_NUM)) : Lnk_In.V_NUM

Any one can help me to resolve... ASAP please.
nani0907
Participant
Posts: 155
Joined: Wed Apr 18, 2007 10:30 am

Post by nani0907 »

yes the logic you have mentioned will work.

bcoz you first finding the number of zeros to append and then concatenate the value
thanks n regards
nani
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Or

Code: Select all

Right('000000000' : Trim(Lnk_In.V_NUM), 9)
You are the creator of your destiny - Swami Vivekananda
sreddy
Participant
Posts: 144
Joined: Sun Oct 21, 2007 9:13 am

Post by sreddy »

Thanks

My Logic is working fine.
Post Reply