Need to put leading zero at right if it is null

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
vinbhate
Participant
Posts: 36
Joined: Tue Jul 17, 2007 12:51 am
Location: India-Mumbai

Need to put leading zero at right if it is null

Post by vinbhate »

Hi All,
I have one requirement if data is
01
1
16
78
4
I need wherever there is 1 or 4 i need to put leading zero in left
it should be
01,01,16,78,04


Can anybody help me with syntax please it will be great help
Regards and Thanks,
Vinita Bhate
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Try

Code: Select all

Fmt(InLink.TheNumber, "R%2")
or

Code: Select all

Fmt(InLink.TheNumber, "R'0'2")
or

Code: Select all

Right("00" : InLink.TheNumber, 2)
just for three.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vinbhate
Participant
Posts: 36
Joined: Tue Jul 17, 2007 12:51 am
Location: India-Mumbai

Post by vinbhate »

Thanks Ray!!!!
Regards and Thanks,
Vinita Bhate
Post Reply