Page 1 of 1

How to mask the minus sign

Posted: Wed Sep 13, 2006 4:42 pm
by Shree0410
Hi all,

I have a column on my file with DEC(10,2), on this columns, the value from the source system is coming as 12345.67-, means a '-'(negative) sign at the end, the target system that Datastage has to send this field is expecting the '-' sign in the beginning, like -12345.67.

I tried using the Iconv and ML2M function, but the decimal places are getting effected.

I appreciate your help on this

Posted: Wed Sep 13, 2006 4:56 pm
by kris007
Try this derivation

Code: Select all

Oconv(Iconv(InputColumn,"ML2M"), "MD2")
or

Code: Select all

If Right(InputColumn,1) = '-' Then '-':InputColumn[1,Len(InputColumn)-1] Else InputColumn

Posted: Wed Sep 13, 2006 5:36 pm
by ray.wurlod
Iconv() is a fairly clever function. Try

Code: Select all

Oconv(Iconv(InLink.TheValue,"MD2"),"MD2")