Subject: | |
From: | |
Reply To: | John C. Vestal |
Date: | Tue, 18 May 1999 09:55:20 -0400 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
In article
<[log in to unmask]>,
<[log in to unmask]> wrote:
> John,
> I'm sure you can use an ',EDIT="-^^^^.^^^^" ' statement on a DISPLAY,FILE=
> or
> similar statement to format your number as you wish. The EDIT attribute is
> also available on the FORMAT statement.
>
> RAT
Hello all,
Well, I found a messy solution, but a solution non-the-less. I
can't use display because the record is 670 bytes wide. I ended up
making the item an X(23) subdefined as an Z(23,4,23). I used a routine
to convert the Z to an X. Here is that routine. Comments are welcome:
LIST
TEMP-DOLLARS ,INIT: <<Z(18)>>
TEMP-CENTS ,INIT; <<9(04)>>
IF (HOLD-XACTN-AMT) > 0 THEN
LET (TEMP-DOLLARS) = (HOLD-XACTN-AMT) - .5
ELSE IF (HOLD-XACTN-AMT) < 0 THEN
LET (TEMP-DOLLARS) = (HOLD-XACTN-AMT) + .5;
LET (TEMP-CENTS) = [[(HOLD-XACTN-AMT) - (TEMP-DOLLARS)] * 10000];
IF (TEMP-CENTS) < 0 THEN
LET (TEMP-CENTS) = -(TEMP-CENTS);
LET (AMT-DOLLARS) = (TEMP-DOLLARS);
MOVE (AMT-DOLLARS) = -(AMT-DOLLARS);
MOVE (AMT-DECIMAL) = ".";
LET (AMT-CENTS) = (TEMP-CENTS);
Also
AMT-DOLLARS is an X(18)
AMT-DECIMAL is an X(01)
AMT-CENTS is an X(04)
All these are subdefined in the formetted output X(23).
John
--
Nortel Networks MS: 82C101 Phone: (919) 905-5331
Attn: John C. Vestal Fax: (919) 905-4121
P.O. Box 13010
RTP, NC 27709 <mailto:[log in to unmask]>
|
|
|