Convert Negative number in round braces ()

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
satheesh_color
Participant
Posts: 182
Joined: Thu Jun 16, 2005 2:05 am

Convert Negative number in round braces ()

Post 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
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

That appears more a presentation requirement. aka reporting.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
battaliou
Participant
Posts: 155
Joined: Mon Feb 24, 2003 7:28 am
Location: London
Contact:

Post by battaliou »

if index(StageVar,'-',1) > 0 then '(' :Convert(StageVar,'()','') :')' else StageVar
3NF: Every non-key attribute must provide a fact about the key, the whole key, and nothing but the key. So help me Codd.
Post Reply