I have a report that I am creating in Progress (OpenEdge Release 10.1C03) and it is running slowly, actually it has not finished running yet. It is for a whole company with multiple orders and lines but it is only viewing specific products from an input list, a cando list of taken bys and a cando list of warehouses.
I have deleted alot of the miscellaneous out of the following to make it shorter (like all the variables):
output to /temp/SKJ1312013.csv.
export delimiter "~t"
"InvoiceDT"
"Invoice#"
"SaleDT"
"ProductSKU"
"Quantity".
INPUT FROM /home/joef/cramerrew/finallist.
All the variables are defined here*
v-whse = "dsp,fhp,fws,gar,jan,lac,lft,lit,mob,nat,oxf,tup,vks".
v-takenby = "abs,amj,ddw,dfv,dtb,eak,jbbn,jrt,lacf,ldl,lrj,lsc,mgr,mlhd,mtps,pgl,rl h,sh, thdc,tv".
REPEAT:
IMPORT DELIMITER ","
v1.
FOR EACH oeeh use-index k-invproc WHERE oeeh.cono = 1 AND
oeeh.stagecd >= 4 and oeeh.stagecd <= 5
and oeeh.invoicedt >= 01/01/13
/* beg-date */
AND oeeh.invoicedt <= 01/31/13
/* end-date */
and oeeh.langcd = 'sr'
and can-do(v-whse,oeeh.whse)
and can-do(v-takenby,oeeh.takenby)
NO-LOCK,
each icsd where icsd.cono = oeeh.cono and icsd.whse = oeeh.whse no-lock,
EACH oeel OF oeeh use-index k-oeel WHERE oeel.cono =
1 and (oeel.vendno = 50110 or oeel.vendno = 81150)
and oeel.qtyship > 0 and oeel.specnstype <> "L" and oeel.statustype ne 'c' NO-LOCK,
each icsc where icsc.catalog = oeel.shipprod no-lock
break by oeeh.orderno by oeeh.ordersuf by oeel.shipprod:
kohlerprod = if icsc.vendprod = v1 then v1 else "".
if oeel.returnfl then v-qtyship = oeel.qtyship * -1.
if not oeel.returnfl then v-qtyship = oeel.qtyship.
accumulate v-qtyship (sub-total by oeel.shipprod).
v-qtyship# = (ACCUM SUB-TOTAL BY oeel.shipprod v-qtyship).
assign V-Invoice# = string(oeeh.orderno) + "-" + string(oeeh.ordersuf).
if oeeh.takenby = "amj" then do: V-BPN = "3247570". V-BPNfname = "Annie" . V-BPNlname = "Jones". end.
if oeeh.takenby = "dtb" then do: V-BPN = "3190293". V-BPNfname = "David" . V-BPNlname = "Bowie". end.
IF NOT LAST-OF(oeel.shipprod) THEN NEXT.
if cramerprod = "" then next.
export delimiter "~t"
InvoiceDT
Invoice#
SaleDT
ProductSKU
Quantity.
end.
end.
output close.
I have deleted alot of the miscellaneous out of the following to make it shorter (like all the variables):
output to /temp/SKJ1312013.csv.
export delimiter "~t"
"InvoiceDT"
"Invoice#"
"SaleDT"
"ProductSKU"
"Quantity".
INPUT FROM /home/joef/cramerrew/finallist.
All the variables are defined here*
v-whse = "dsp,fhp,fws,gar,jan,lac,lft,lit,mob,nat,oxf,tup,vks".
v-takenby = "abs,amj,ddw,dfv,dtb,eak,jbbn,jrt,lacf,ldl,lrj,lsc,mgr,mlhd,mtps,pgl,rl h,sh, thdc,tv".
REPEAT:
IMPORT DELIMITER ","
v1.
FOR EACH oeeh use-index k-invproc WHERE oeeh.cono = 1 AND
oeeh.stagecd >= 4 and oeeh.stagecd <= 5
and oeeh.invoicedt >= 01/01/13
/* beg-date */
AND oeeh.invoicedt <= 01/31/13
/* end-date */
and oeeh.langcd = 'sr'
and can-do(v-whse,oeeh.whse)
and can-do(v-takenby,oeeh.takenby)
NO-LOCK,
each icsd where icsd.cono = oeeh.cono and icsd.whse = oeeh.whse no-lock,
EACH oeel OF oeeh use-index k-oeel WHERE oeel.cono =
1 and (oeel.vendno = 50110 or oeel.vendno = 81150)
and oeel.qtyship > 0 and oeel.specnstype <> "L" and oeel.statustype ne 'c' NO-LOCK,
each icsc where icsc.catalog = oeel.shipprod no-lock
break by oeeh.orderno by oeeh.ordersuf by oeel.shipprod:
kohlerprod = if icsc.vendprod = v1 then v1 else "".
if oeel.returnfl then v-qtyship = oeel.qtyship * -1.
if not oeel.returnfl then v-qtyship = oeel.qtyship.
accumulate v-qtyship (sub-total by oeel.shipprod).
v-qtyship# = (ACCUM SUB-TOTAL BY oeel.shipprod v-qtyship).
assign V-Invoice# = string(oeeh.orderno) + "-" + string(oeeh.ordersuf).
if oeeh.takenby = "amj" then do: V-BPN = "3247570". V-BPNfname = "Annie" . V-BPNlname = "Jones". end.
if oeeh.takenby = "dtb" then do: V-BPN = "3190293". V-BPNfname = "David" . V-BPNlname = "Bowie". end.
IF NOT LAST-OF(oeel.shipprod) THEN NEXT.
if cramerprod = "" then next.
export delimiter "~t"
InvoiceDT
Invoice#
SaleDT
ProductSKU
Quantity.
end.
end.
output close.