Problem with Temp-Table

Ross Stanek

New Member
I keep getting an error 200 on the following code but I do not see any problem. Once again I am new to Progress and could use a little help on this error.

------------------

define var itemcnt as deci label "Count".
define var totavecst as deci label "Average Cost".
define var dd as char label "Discontinued".
define var averagecst as deci.
define TEMP-TABLE AveCst
field Item# as char
field ItemDesc as char
field Disc as char
field Cat as char
field AvCst as deci
field Retail as deci
index AvCst is primary AvCst descending
index ItemDesc ascending.
for each istock no-lock,
each iprice no-lock where iprice.item-num = istock.item-num and price-code = 1,
each invmas no-lock where invmas.type = 'T' and invmas.item-num = istock.item-num break by istock.item-num:
ACCUMULATE average-cost (AVERAGE BY istock.item-num).
if Code-1 begins 'DD' Then DO:
dd = 'Yes'.
END.
if LAST-OF(istock.item-num) THEN DO:
averagecst = ACCUM AVERAGE BY istock.item-num average-cost.
CREATE AveCst.
AveCst.Item# = istock.item-num.
AveCst.ItemDesc = invmas.item-desc.
AveCst.Disc = dd.
AveCst.Cat = category.
AveCst.AvCst = averagecst.
AveCst.Retail = level[1].
END.
END.
for each AveCst no-lock:
display Item# ItemDesc Disc Cat AvCst Retail with width 254.
dd = ' '.
END.


Thanks,

Ross
 
Hi

One thing that I did notice - in defining your temp-table


index AvCst is primary AvCst descending
index ItemDesc ascending.


the last line should have an index name as well as an index item -

ie

index i-indexname Itemdesc ascending.

Try that to see if it helps

Mike
 
Back
Top