non significant spaces,on the left must be replaced 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
amreesh_singh
Participant
Posts: 15
Joined: Tue Aug 26, 2008 5:07 am

non significant spaces,on the left must be replaced zeros

Post by amreesh_singh »

The QTY column with integer datatype of length 7 the non significant spaces on the left must be replaced zeros.
If the incoming value is 388, the ouput should be 0000388.

I have used the follwing thing in transformer but its not working

Right(Str("0",7):Trim(Out_Agg.QTY),7)

How to go about it.

Thanks in advance

Amreesh
cfuller
Premium Member
Premium Member
Posts: 70
Joined: Mon Mar 24, 2003 10:08 pm
Location: Australia

Post by cfuller »

Try something like -

Fmt(Trim(Out_Agg.OUT),"7'0'R")

:D

(I'm assuming FMT is available in Parallel, I'm not sure, if not sorry I can't help)
Regards
Chris Fuller

"Reality is what refuses to go away when you stop believing in it"
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Fmt() is not available in parallel jobs. Had you bothered to Search you would have discovered that it's even easier than your "solution". Assuming you require a seven-character wide result with leading zeroes, use something like

Code: Select all

Right(("0000000" : OutAgg.QTY), 7)
The inner parentheses are not actually needed.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
amreesh_singh
Participant
Posts: 15
Joined: Tue Aug 26, 2008 5:07 am

Post by amreesh_singh »

ray.wurlod wrote:Fmt() is not available in parallel jobs. Had you bothered to Search you would have discovered that it's even easier than your "solution". Assuming you ...
Hi ,
Can you please provide me the solution , it will be a great help
Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Can you please purchase a premium membership, so that you can see my solution (and help to keep DSXchange alive)?
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