Page 1 of 1

Convert Negative number in round braces ()

Posted: Fri May 14, 2010 4:46 am
by satheesh_color
Hi All,

I have to convert the negative numbers into positive value with braces [()].

Eg:1

Input Output
-13.90 <13.90>

Eg2:

Input Output
<-13.90> (13.90)

Please let me know you thoughts on this.


Thanks,
Satheesh

Posted: Fri May 14, 2010 4:57 am
by Sainath.Srinivasan
That appears more a presentation requirement. aka reporting.

Posted: Fri May 14, 2010 5:57 am
by ray.wurlod
Check out the "MD" conversions for Iconv() and Oconv() in the DataStage BASIC manual. They can manage these kinds of conversion, though I might observe that having a "-" inside angle brackets is very unusual.

Posted: Fri May 14, 2010 6:06 am
by battaliou
if index(StageVar,'-',1) > 0 then '(' :Convert(StageVar,'()','') :')' else StageVar