HP3000-L Archives

October 1998, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
John Zoltak <[log in to unmask]>
Reply To:
John Zoltak <[log in to unmask]>
Date:
Wed, 28 Oct 1998 09:03:39 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (66 lines)
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)

ATOM RSS1 RSS2