How to mask the minus sign

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
Shree0410
Participant
Posts: 70
Joined: Tue Nov 29, 2005 7:25 pm

How to mask the minus sign

Post 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
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post 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
Kris

Where's the "Any" key?-Homer Simpson
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Iconv() is a fairly clever function. Try

Code: Select all

Oconv(Iconv(InLink.TheValue,"MD2"),"MD2")
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