Left Pad a string with specified character

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
abhilashnair
Participant
Posts: 284
Joined: Fri Oct 13, 2006 4:31 am

Left Pad a string with specified character

Post by abhilashnair »

How do I left pad an input string with a specific character and get the desired output? For example, if the input is ABC I want to pad X to the left of ABC and get the output as XABC
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

For that specific case, with "X" as the pad character and 4 as the width of the output:

Code: Select all

Right(Str("X",4):InLink.TheField, 4)
Generalize to other requirements.
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