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
vij
Participant
Posts: 131
Joined: Fri Nov 17, 2006 12:43 am

Left padding

Post by vij »

hi,
I want to know how 0s are left padded to a string.
i used this function - padstring(sting,"0",10) but it does a right padding.

I tried with -10 for a left pad, even then it is not working... can anyone help me on this?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Code: Select all

Str("0", 10-Len(MyString)) : MyString
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
lottokahe
Premium Member
Premium Member
Posts: 21
Joined: Thu Nov 02, 2006 5:56 am

Thanks

Post by lottokahe »

ray.wurlod wrote:

Code: Select all

Str("0", 10-Len(MyString)) : MyString
...

Thank you Ray. That is exactly what i needed.
Greetings,

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

Post by ray.wurlod »

Welcome aboard. :D
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