Greg,

Here are some of my notes from the past:

Converting an amount to a (COMP-3 SIGNED) packed field:

        if amt lt 0     then sign="D" ; amt=abs(amt)                           
                else sign="C"                                          
                                                                   
        amt=iconv(amt[1,len(amt)-1],'MX'):iconv(amt[len(amt),1]:sign,'MX') 

   -or-

        if amt lt 0     then sign="D" ; amt=abs(amt)                           
                else sign="F"                                          
                                                                   
        amt=iconv(amt[1,len(amt)-1],'MX'):iconv(amt[len(amt),1]:sign,'MX') 

   -or-

        if amt lt 0 then amt=iconv(amt,'MP')                
                    else                                    
                         amt=oconv(iconv(amt*10,'MP'),'MX') 
                         amt[1]='C'                         
                         amt=iconv(amt,'MX')                
                    end                                     

Hope that helps,
Don

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Coelho, Gregory
Sent: Tuesday, January 17, 2006 10:09 AM
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] RE: Number Conversion


Mark,

If you do get a chance to send the code along I'd greatly appreciate it.

Thanks,

Greg :)

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mark Eastwood
Sent: Tuesday, January 17, 2006 10:02 AM
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] RE: Number Conversion

I don't think there is a standard conversion to do this - I've always
had to write a little subroutine to deal with it. I would post the
program, but I'm not on the system today. 

Mark :( 


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Coelho, Gregory
Sent: Tuesday, January 17, 2006 7:52 AM
To: u2-users@listserver.u2ug.org
Subject: [U2] RE: Number Conversion

EEEK! Hummm, Is there anyone that can help me with number conversion? I
need to convert a negative monetary amount pulled in by
FMT(OCONV(X.AMOUNT, "MD"), "8\0R") to meet S9(6)V99 or Z8.2 format.
COBOL programmers may recognize this comp-3 format - padded with leading
zeros the right most character must use an EBCDIC symbol to reflect a
negative amount:} = 0, J = neg. 1, K = neg. 2, L = neg. 3 ... R = neg.
9. Any help or direction would be greatly appreciated.
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to