That did the trick - thanks, Kevin! I did the dollar sign and the comma, just to be safe. That only leaves the parens for negative amounts, which some accountants like (but I don't). I can live with that easily.

AMT             ICONV(AMT, 'MCC;$;]MCC;,;]MD2')
*************** *******************************
      $1,200.00 120000
     $-1,200.00 -120000
     -$1,200.00 -120000
    ($1,200.00)
       -1200.00 -120000
       -1200.00 -120000
       -1200.00 -120000
      (1200.00)

Charlie

On 08-11-2012 9:11 AM, Kevin Powick wrote:


On Thursday, 9 August 2012 20:47:25 UTC-4, Charlie Noah wrote:
I know I'm dense some days, but I can't seem to figure this one out. I am processing money data which comes in OCONVed. When I ICONV it I run into trouble with negative amounts when dollar signs and commas are involved. This is what I've tested (MR returns the same result as MD):

I don't think that a single conversion code will do it.  You'll either need multiple ICONV statements, or you can use a single ICONV statement with multiple conversion codes, separated by value marks.

For example, to strip out the "$" sign, use character replacement (MCC;X;Y) 

I can't remember if jBASE has constants such as @VM for a value mark, so I'll just code it with the actual value mark character in the following example.

VALUE = ICONV("$-1,000.00","MCC;$;]MD2") 


--
Kevin Powick
--
--
IMPORTANT: T24/Globus posts are no longer accepted on this forum.
 
To post, send email to [email protected]
To unsubscribe, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/jBASE?hl=en
 
 
 

--
--
IMPORTANT: T24/Globus posts are no longer accepted on this forum.
 
To post, send email to [email protected]
To unsubscribe, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/jBASE?hl=en
 
 
 

Reply via email to