Subject: | |
From: | |
Reply To: | |
Date: | Wed, 28 Oct 1998 09:03:39 -0500 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Ted,
Try COMPUTE TOTAL-PRESENT-PRO ROUNDED = FUNCTION SUM(PRESENT(ALL)).
Note the "ROUNDED". This kind of problem occurs with NUMVAL too.
John Zoltak
North American Mfg Co
> -----Original Message-----
> From: Ted Ashton [SMTP:[log in to unmask]]
> Sent: Tuesday, October 27, 1998 11:20 PM
> To: [log in to unmask]
> Subject: [HP3000-L] FUNCTION SUM(ELEMENT(ALL))
>
> <*shudder*>
>
> I'm obviously too new to this COBOL stuff. I've got a table which is
> defined
> as (in part):
>
> 01 PRORATED-ITEMS-LIST.
> 03 PRORATED-ITEM OCCURS 200 INDEXED BY PRO-INDEX, PRO-MAX.
> .
> .
> .
> 05 PRESENT PIC S9(5)V99 COMP SYNC.
>
> I also have:
>
> 03 TOTAL-PRESENT-PRO PIC -(5)9.99.
>
> and in the code I did a
>
> COMPUTE TOTAL-PRESENT-PRO = FUNCTION SUM(PRESENT(ALL)).
>
> After all, it's what the manual said I could. So now, for example, I
> have the
> following numbers in the table:
>
> 43.87
> 79.52
> 216.00
> 37.50
> 1182.50
> -443.50
> -645.00
>
> and in TOTAL-PRESENT-PRO, I get:
>
> 470.88
>
> Could someone spare a moment to explain to me what's going on here? I
> thought
> COBOL was "the language which wouldn't lose pennies" !
>
> Ted
> --
> Ted Ashton ([log in to unmask]), Info Serv, Southern Adventist
> University
> ==========================================================
> The imaginary number is a fine and wonderful recourse of the divine
> spirit,
> almost an amphibian between being and not being.
> -- Leibniz, Gottfried Whilhem (1646-1716)
|
|
|