There is nothing intrinsic in jBASE (or any other multi-value
implementation that I know of) that can do running totals.

A dictionary subroutine would be able to accomplish this. Here is a
simple example:

Create a file called TEST with 3 records:

    A
001 1

    B
001 2

    C
001 3

Create this subroutine:

0001     SUBROUTINE runtot
0002     COMMON /runtot/ runningtotal
0003     INCLUDE qbasiccommonpick
0004     EQU ItemCount TO access(4)
0005     IF ItemCount = 1 THEN runningtotal = 0
0006     runningtotal += access(3)<1>
0007     newpick(12) = runningtotal
0008     RETURN

Create this dictionary:

   RT
001 A
002 1
003
004
005
006
007
008 CALL runtot
009 R
010 6

jsh ~ -->LIST TEST *A1 RT

TEST.......... *A1........... RT....

A              1                   1
B              2                   3
C              3                   6

You would have to perform the BASIC equivalent of

A;S(N(MATERIAL-COST) * N(MULT)R)

and plug that into the code in place of 'access(3)<1>'.

I know stuff ;-)

Dan


On Nov 10, 2:32 pm, wsw <[email protected]> wrote:
> Is there a way to obtain a running total for a single value attribute
> using a dictionary entry? Using A;S(N(MATERIAL-COST) * N(MULT)R),
> where MULT = 1, I can obtain the total value of a multivalue
> attribute.
>
> Thanks,
>
> WW

-- 
Please read the posting guidelines at: 
http://groups.google.com/group/jBASE/web/Posting%20Guidelines

IMPORTANT: Type T24: at the start of the subject line for questions specific to 
Globus/T24

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