Page 1 of 1

completing a result

Posted: Tue Sep 12, 2006 5:20 am
by incognico
Hello !

I have a question.
a.JO_NUM = "RI"
i have this in sql server
a.JO_NUM+replicate(space(1),6-LEN(a.JO_NUM))
result : "RI "

with datastage i try this:
Fmt(Extraction.JO_Num, "6-Len(Extraction.JO_Num)'Space(1)'U")

But the result is not good.
result "RI"

if you have a idea ..... thanks.

Nick

Posted: Tue Sep 12, 2006 5:31 am
by loveojha2
Try

Code: Select all

Fmt(Extraction.JO_Num,6-Len(Extraction.JO_Num) : ' L') 

Posted: Tue Sep 12, 2006 5:40 am
by incognico
argh...

No the result is "RI " with 2 blank and not "RI " with 4 blank (6-len=>4)
:?

Posted: Tue Sep 12, 2006 6:47 am
by kduke
I would use spaces() or str(). Should do what replicate used to do.

Posted: Tue Sep 12, 2006 6:57 am
by ray.wurlod
Seems too complex to me. I'd use:

Code: Select all

Fmt(a.JO_NUM, "L#6") 

Posted: Tue Sep 12, 2006 7:02 am
by incognico
Thank's Ray !
It's OK. :D