Code Newbie > BAM Progress Code . Is there a way to make this f

Thanks guys.

I will see what I can do. Could I ask another question...

Instead of querying the table twice, could I query it once to take
all of the necessary joboper records and place this in an array or a
select list. Then use this to as the basis, or am I going on a
tangent.

Thanks again.

--- In vantage@yahoogroups.com, "Chris Robisch" <blue.wine@v...>
wrote:
> Also select also with the "company" field on almost every file in
Vantage.
>
> Progress uses a binary search method if you specify all fields of
an index
> in order. Otherwise, a sequential and much slower search is used.
>
> ----- Original Message -----
> From: "brychanwilliams" <brychanw@h...>
> To: <vantage@yahoogroups.com>
> Sent: Wednesday, July 20, 2005 1:36 PM
> Subject: [Vantage] Code Newbie > BAM Progress Code . Is there a
way to make
> this faster?
>
>
> > Hi,
> >
> > I have written a bit of basic code to create an alert based on
labor
> > qtys at previous operations under some conditions.
> >
> > I'm quite new to this but is there a way make this execute
quicker.
> > It only takes a couple of seconds but I would like it to work
> > quicker.
> >
> > Any help would be great.
> >
> > Vantage 6.1
> >
> > Thanks
> >
> >
> >
>
> /******************************************************************
**
> > ******
> >
*********************************************************************
> > ******/
> >
> > {ud/GlbAlert.i &TableName = "LaborDtl"}
> > DEFINE VARIABLE internaljobnum AS CHARACTER NO-UNDO.
> >
> > DEFINE VARIABLE currentqtycompleted as Decimal NO-UNDO.
> > DEFINE VARIABLE runqty as Decimal NO-UNDO.
> > DEFINE VARIABLE currentlaborqty as Decimal NO-UNDO.
> > DEFINE VARIABLE CurrentOp as integer NO-UNDO.
> >
> > DEFINE VARIABLE priorqtycompleted as Decimal NO-UNDO.
> > DEFINE VARIABLE prioroprseq as integer NO-UNDO.
> > DEFINE VARIABLE priorworkcode AS CHARACTER NO-UNDO.
> >
> >
> > Currentop = LaborDtl.OprSeq.
> >
> > FIND MFGSYS.JobOper
> > WHERE (MFGSYS.JobOper.JobNum = Labordtl.JobNum) and
> > (MFGSYS.JobOper.assemblyseq = Labordtl.assemblyseq) and
> > (MFGSYS.JobOper.Oprseq = Labordtl.OprSeq) NO-LOCK NO-ERROR.
> >
> > IF NOT AVAILABLE MFGSYS.JobOper THEN DO:
> > RETURN "CANCEL SEND".
> > RETURN .
> > END.
> > currentqtycompleted = MFGSYS.JobOper.QtyCompleted.
> >
> > mainloop:
> >
> > REPEAT:
> >
> > Currentop = (Currentop - 1).
> >
> > FIND MFGSYS.JobOper
> > WHERE MFGSYS.JobOper.JobNum = Labordtl.JobNum and
> > MFGSYS.JobOper.assemblyseq = Labordtl.assemblyseq and
> > MFGSYS.JobOper.OprSeq = Currentop NO-LOCK NO-ERROR.
> > IF AVAILABLE MFGSYS.JobOper THEN DO:
> >
> >
> > IF MFGSYS.JobOper.WCCode <> "CORE" AND
> > MFGSYS.JobOper.QtyPer = 1 AND MFGSYS.JobOper.LaborEntryMethod
<> "B"
> > THEN DO:
> >
> > priorworkcode = MFGSYS.JobOper.WCcode.
> > priorqtycompleted =
MFGSYS.JobOper.QtyCompleted.
> > prioroprseq = MFGSYS.JobOper.OprSeq.
> >
> > IF (currentqtycompleted >
priorqtycompleted)
> > THEN DO:
> >
> > Message "Prior Operation Seq - " +
string
> > (prioroprseq)
> > + " - Prior Wrk Code - " + string
> > (priorworkcode) +
> > " - QtyPer - " + string
> > (MFGSYS.JobOper.QtyPer) +
> > " - Prior Qty Completed " + string
> > (priorqtycompleted) View-as alert-box information buttons ok.
> >
> > END.
> > ELSE DO:
> > LEAVE mainloop.
> > END.
> >
> > LEAVE mainloop.
> > END.
> > END.
> >
> >
> > IF Currentop = 0 THEN DO:
> > LEAVE mainloop.
> > END.
> >
> > END.
> >
> >
> > Return.
> >
> >
> >
> >
> >
> > Useful links for the Yahoo!Groups Vantage Board are: ( Note:
You must
> > have already linked your email address to a yahoo id to enable
access. )
> > (1) To access the Files Section of our Yahoo!Group for Report
Builder and
> > Crystal Reports and other 'goodies', please goto:
> > http://groups.yahoo.com/group/vantage/files/.
> > (2) To search through old msg's goto:
> > http://groups.yahoo.com/group/vantage/messages
> > (3) To view links to Vendors that provide Vantage services goto:
> > http://groups.yahoo.com/group/vantage/links
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
Hi,

I have written a bit of basic code to create an alert based on labor
qtys at previous operations under some conditions.

I'm quite new to this but is there a way make this execute quicker.
It only takes a couple of seconds but I would like it to work
quicker.

Any help would be great.

Vantage 6.1

Thanks



/********************************************************************
******
*********************************************************************
******/

{ud/GlbAlert.i &TableName = "LaborDtl"}
DEFINE VARIABLE internaljobnum AS CHARACTER NO-UNDO.

DEFINE VARIABLE currentqtycompleted as Decimal NO-UNDO.
DEFINE VARIABLE runqty as Decimal NO-UNDO.
DEFINE VARIABLE currentlaborqty as Decimal NO-UNDO.
DEFINE VARIABLE CurrentOp as integer NO-UNDO.

DEFINE VARIABLE priorqtycompleted as Decimal NO-UNDO.
DEFINE VARIABLE prioroprseq as integer NO-UNDO.
DEFINE VARIABLE priorworkcode AS CHARACTER NO-UNDO.


Currentop = LaborDtl.OprSeq.

FIND MFGSYS.JobOper
WHERE (MFGSYS.JobOper.JobNum = Labordtl.JobNum) and
(MFGSYS.JobOper.assemblyseq = Labordtl.assemblyseq) and
(MFGSYS.JobOper.Oprseq = Labordtl.OprSeq) NO-LOCK NO-ERROR.

IF NOT AVAILABLE MFGSYS.JobOper THEN DO:
RETURN "CANCEL SEND".
RETURN .
END.
currentqtycompleted = MFGSYS.JobOper.QtyCompleted.

mainloop:

REPEAT:

Currentop = (Currentop - 1).

FIND MFGSYS.JobOper
WHERE MFGSYS.JobOper.JobNum = Labordtl.JobNum and
MFGSYS.JobOper.assemblyseq = Labordtl.assemblyseq and
MFGSYS.JobOper.OprSeq = Currentop NO-LOCK NO-ERROR.
IF AVAILABLE MFGSYS.JobOper THEN DO:


IF MFGSYS.JobOper.WCCode <> "CORE" AND
MFGSYS.JobOper.QtyPer = 1 AND MFGSYS.JobOper.LaborEntryMethod <> "B"
THEN DO:

priorworkcode = MFGSYS.JobOper.WCcode.
priorqtycompleted = MFGSYS.JobOper.QtyCompleted.
prioroprseq = MFGSYS.JobOper.OprSeq.

IF (currentqtycompleted > priorqtycompleted)
THEN DO:

Message "Prior Operation Seq - " + string
(prioroprseq)
+ " - Prior Wrk Code - " + string
(priorworkcode) +
" - QtyPer - " + string
(MFGSYS.JobOper.QtyPer) +
" - Prior Qty Completed " + string
(priorqtycompleted) View-as alert-box information buttons ok.

END.
ELSE DO:
LEAVE mainloop.
END.

LEAVE mainloop.
END.
END.


IF Currentop = 0 THEN DO:
LEAVE mainloop.
END.

END.


Return.
Hi,

Try adding joins on the company.

You are hitting some of the largest tables on the system, work with the
sql explorer or some other more interactive environment to tune your
query.

Take care,

Steve


-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of brychanwilliams
Sent: Wednesday, July 20, 2005 4:36 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Code Newbie > BAM Progress Code . Is there a way to
make this faster?

Hi,

I have written a bit of basic code to create an alert based on labor
qtys at previous operations under some conditions.

I'm quite new to this but is there a way make this execute quicker.
It only takes a couple of seconds but I would like it to work
quicker.

Any help would be great.

Vantage 6.1

Thanks



/********************************************************************
******
*********************************************************************
******/

{ud/GlbAlert.i &TableName = "LaborDtl"}
DEFINE VARIABLE internaljobnum AS CHARACTER NO-UNDO.

DEFINE VARIABLE currentqtycompleted as Decimal NO-UNDO.
DEFINE VARIABLE runqty as Decimal NO-UNDO.
DEFINE VARIABLE currentlaborqty as Decimal NO-UNDO.
DEFINE VARIABLE CurrentOp as integer NO-UNDO.

DEFINE VARIABLE priorqtycompleted as Decimal NO-UNDO.
DEFINE VARIABLE prioroprseq as integer NO-UNDO.
DEFINE VARIABLE priorworkcode AS CHARACTER NO-UNDO.


Currentop = LaborDtl.OprSeq.

FIND MFGSYS.JobOper
WHERE (MFGSYS.JobOper.JobNum = Labordtl.JobNum) and
(MFGSYS.JobOper.assemblyseq = Labordtl.assemblyseq) and
(MFGSYS.JobOper.Oprseq = Labordtl.OprSeq) NO-LOCK NO-ERROR.

IF NOT AVAILABLE MFGSYS.JobOper THEN DO:
RETURN "CANCEL SEND".
RETURN .
END.
currentqtycompleted = MFGSYS.JobOper.QtyCompleted.

mainloop:

REPEAT:

Currentop = (Currentop - 1).

FIND MFGSYS.JobOper
WHERE MFGSYS.JobOper.JobNum = Labordtl.JobNum and
MFGSYS.JobOper.assemblyseq = Labordtl.assemblyseq and
MFGSYS.JobOper.OprSeq = Currentop NO-LOCK NO-ERROR.
IF AVAILABLE MFGSYS.JobOper THEN DO:


IF MFGSYS.JobOper.WCCode <> "CORE" AND
MFGSYS.JobOper.QtyPer = 1 AND MFGSYS.JobOper.LaborEntryMethod <> "B"
THEN DO:

priorworkcode = MFGSYS.JobOper.WCcode.
priorqtycompleted = MFGSYS.JobOper.QtyCompleted.
prioroprseq = MFGSYS.JobOper.OprSeq.

IF (currentqtycompleted > priorqtycompleted)
THEN DO:

Message "Prior Operation Seq - " + string
(prioroprseq)
+ " - Prior Wrk Code - " + string
(priorworkcode) +
" - QtyPer - " + string
(MFGSYS.JobOper.QtyPer) +
" - Prior Qty Completed " + string
(priorqtycompleted) View-as alert-box information buttons ok.

END.
ELSE DO:
LEAVE mainloop.
END.

LEAVE mainloop.
END.
END.


IF Currentop = 0 THEN DO:
LEAVE mainloop.
END.

END.


Return.





Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must
have already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder
and Crystal Reports and other 'goodies', please goto:
http://groups.yahoo.com/group/vantage/files/.
(2) To search through old msg's goto:
http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto:
http://groups.yahoo.com/group/vantage/links
Yahoo! Groups Links
Also select also with the "company" field on almost every file in Vantage.

Progress uses a binary search method if you specify all fields of an index
in order. Otherwise, a sequential and much slower search is used.

----- Original Message -----
From: "brychanwilliams" <brychanw@...>
To: <vantage@yahoogroups.com>
Sent: Wednesday, July 20, 2005 1:36 PM
Subject: [Vantage] Code Newbie > BAM Progress Code . Is there a way to make
this faster?


> Hi,
>
> I have written a bit of basic code to create an alert based on labor
> qtys at previous operations under some conditions.
>
> I'm quite new to this but is there a way make this execute quicker.
> It only takes a couple of seconds but I would like it to work
> quicker.
>
> Any help would be great.
>
> Vantage 6.1
>
> Thanks
>
>
>
> /********************************************************************
> ******
> *********************************************************************
> ******/
>
> {ud/GlbAlert.i &TableName = "LaborDtl"}
> DEFINE VARIABLE internaljobnum AS CHARACTER NO-UNDO.
>
> DEFINE VARIABLE currentqtycompleted as Decimal NO-UNDO.
> DEFINE VARIABLE runqty as Decimal NO-UNDO.
> DEFINE VARIABLE currentlaborqty as Decimal NO-UNDO.
> DEFINE VARIABLE CurrentOp as integer NO-UNDO.
>
> DEFINE VARIABLE priorqtycompleted as Decimal NO-UNDO.
> DEFINE VARIABLE prioroprseq as integer NO-UNDO.
> DEFINE VARIABLE priorworkcode AS CHARACTER NO-UNDO.
>
>
> Currentop = LaborDtl.OprSeq.
>
> FIND MFGSYS.JobOper
> WHERE (MFGSYS.JobOper.JobNum = Labordtl.JobNum) and
> (MFGSYS.JobOper.assemblyseq = Labordtl.assemblyseq) and
> (MFGSYS.JobOper.Oprseq = Labordtl.OprSeq) NO-LOCK NO-ERROR.
>
> IF NOT AVAILABLE MFGSYS.JobOper THEN DO:
> RETURN "CANCEL SEND".
> RETURN .
> END.
> currentqtycompleted = MFGSYS.JobOper.QtyCompleted.
>
> mainloop:
>
> REPEAT:
>
> Currentop = (Currentop - 1).
>
> FIND MFGSYS.JobOper
> WHERE MFGSYS.JobOper.JobNum = Labordtl.JobNum and
> MFGSYS.JobOper.assemblyseq = Labordtl.assemblyseq and
> MFGSYS.JobOper.OprSeq = Currentop NO-LOCK NO-ERROR.
> IF AVAILABLE MFGSYS.JobOper THEN DO:
>
>
> IF MFGSYS.JobOper.WCCode <> "CORE" AND
> MFGSYS.JobOper.QtyPer = 1 AND MFGSYS.JobOper.LaborEntryMethod <> "B"
> THEN DO:
>
> priorworkcode = MFGSYS.JobOper.WCcode.
> priorqtycompleted = MFGSYS.JobOper.QtyCompleted.
> prioroprseq = MFGSYS.JobOper.OprSeq.
>
> IF (currentqtycompleted > priorqtycompleted)
> THEN DO:
>
> Message "Prior Operation Seq - " + string
> (prioroprseq)
> + " - Prior Wrk Code - " + string
> (priorworkcode) +
> " - QtyPer - " + string
> (MFGSYS.JobOper.QtyPer) +
> " - Prior Qty Completed " + string
> (priorqtycompleted) View-as alert-box information buttons ok.
>
> END.
> ELSE DO:
> LEAVE mainloop.
> END.
>
> LEAVE mainloop.
> END.
> END.
>
>
> IF Currentop = 0 THEN DO:
> LEAVE mainloop.
> END.
>
> END.
>
>
> Return.
>
>
>
>
>
> Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must
> have already linked your email address to a yahoo id to enable access. )
> (1) To access the Files Section of our Yahoo!Group for Report Builder and
> Crystal Reports and other 'goodies', please goto:
> http://groups.yahoo.com/group/vantage/files/.
> (2) To search through old msg's goto:
> http://groups.yahoo.com/group/vantage/messages
> (3) To view links to Vendors that provide Vantage services goto:
> http://groups.yahoo.com/group/vantage/links
> Yahoo! Groups Links
>
>
>
>
>
>