Problem updating last record written at sort break in QTP
David Morrison - Corporate
dmorrison@mcbrideelectric.com
Thu, 9 Dec 2004 11:20:35 -0800
This is a multi-part message in MIME format.
------_=_NextPart_001_01C4DE24.28AB0955
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Tim,
=20
Well, you can always break it up into 2 requests. In Request #1, output =
a subfile so you have what you need to access and update the file at =
item-no.
=20
David Morrison
McBride Electric
-----Original Message-----
From: powerh-l-admin@lists.sowder.com =
[mailto:powerh-l-admin@lists.sowder.com]On Behalf Of Tim Cummings
Sent: Thursday, December 09, 2004 11:11 AM
To: Cognos Powerhouse List (E-mail)
Subject: RE: Problem updating last record written at sort break in QTP
=20
I'm not allowed to send out actual code, so I have to cut out some stuff
and change the names of other stuff. The code below is all I can share.
=20
The problem I believe the problem is in the phases of QTP processing =
(I'm guessing).
=20
=20
Tim
CAN CLE=20
ACCESS ORDER-ITEMS &=20
LINK XXX OF ORDER-ITEMS &=20
TO PR-XXX OF XXX-RATIO=20
=20
=20
DEFINE SPOILED-CREDITS INTEGER SIGNED SIZE 4 =3D BR-CREDITS of =
order-items &=20
* QUANTITY-ON-HAND of =
order-items &=20
* (PR-PERCENT of =
XXX-ratio / 100)=20
TEMPORARY CREDIT-TOTAL NUM*8=20
SORT ON ITEM-NO=20
ITEM CREDIT-TOTAL SUBTOTAL SPOILED-CREDITS RESET AT ITEM-NO=20
OUTPUT TRANSACTIONS ADD NOITEMS ALIAS Oo-TRX=20
ITEM UNIT OF Oo-TRX INITIAL "9999999999"=20
ITEM TRAN-KEY OF Oo-TRX INITIAL "Oo" + ITEM-NO + PR-PREFIX=20
ITEM CREDITS OF Oo-TRX FINAL SPOILED-CREDITS=20
OUTPUT TRANSACTIONS UPDATE ALIAS LASTOo AT ITEM-NO &=20
VIA TRAN-KEY USING "Oo" + ITEM-NO + PR-PREFIX &=20
IF 0 <> (BR-CREDITS * QUANTITY-ON-HAND - CREDIT-TOTAL)=20
ITEM CREDITS OF LASTOo =3D CREDITS OF LASTOo+ ((BR-CREDITS * =
QUANTITY-ON-HAND - CREDIT-TOTAL * -1))=20
GO=20
Executing request 1 ...=20
-------------------------------------------------------------------------=
------=20
Cannot find record with this key/index value. =
[3]=20
File: LASTOO
Linkitem: UNIT=20
Linkitem: LINK-UNIT=20
Linkitem: TRAN-KEY Oo1000105920=20
Action Taken: Run terminated.=20
-------------------------------------------------------------------------=
------=20
Records read:=20
ORDER-ITEMS 5,790=20
XXX-RATIO 3=20
Transactions processed: 3=20
Records processed: Added Updated Unchanged =
Deleted=20
ORDER-ITEMS 0 0 0 =
0=20
OO-TRX 3 0 0 =
0=20
LASTOO 0 0 0 =
0=20
Finished.=20
>=20
-----Original Message-----
From: David Morrison - Corporate [mailto:dmorrison@mcbrideelectric.com]
Sent: Thursday, December 09, 2004 1:39 PM
To: Tim Cummings; Cognos Powerhouse List (E-mail)
Subject: RE: Problem updating last record written at sort break in QTP
Tim,
=20
I'm not sure what's causing the QTP error; I think you need to include =
more of the program (e.g., the reference to LastOq).
=20
Side issues: Using " * .01 " may be faster and/or more accurate than " =
/ 100", and there's no need to ever multiply by -1.
=20
Thanks.
=20
David Morrison
=20
------_=_NextPart_001_01C4DE24.28AB0955
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<TITLE>Problem updating last record written at sort break in QTP</TITLE>
<META content=3D"MSHTML 6.00.2800.1476" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D920101919-09122004><FONT color=3D#0000ff=20
size=3D2>Tim,</FONT></SPAN></DIV>
<DIV><SPAN class=3D920101919-09122004><FONT color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D920101919-09122004><FONT color=3D#0000ff =
size=3D2>Well, you can=20
always break it up into 2 requests. In Request #1, output a =
subfile so you=20
have what you need to access and update the file at =
item-no.</FONT></SPAN></DIV>
<DIV><SPAN class=3D920101919-09122004><FONT color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D920101919-09122004><FONT color=3D#0000ff =
size=3D2>David=20
Morrison</FONT></SPAN></DIV>
<DIV><SPAN class=3D920101919-09122004><FONT color=3D#0000ff =
size=3D2>McBride=20
Electric</FONT></SPAN></DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
<DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
size=3D2>-----Original Message-----<BR><B>From:</B>=20
powerh-l-admin@lists.sowder.com =
[mailto:powerh-l-admin@lists.sowder.com]<B>On=20
Behalf Of </B>Tim Cummings<BR><B>Sent:</B> Thursday, December 09, 2004 =
11:11=20
AM<BR><B>To:</B> Cognos Powerhouse List (E-mail)<BR><B>Subject:</B> =
RE:=20
Problem updating last record written at sort break in =
QTP<BR><BR></FONT></DIV>
<DIV><FONT face=3DArial><SPAN class=3D625244418-09122004> </DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff size=3D2><SPAN=20
class=3D625244418-09122004>I'm not allowed to send out actual code, so =
I have to=20
cut out some stuff</SPAN></FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff size=3D2><SPAN=20
class=3D625244418-09122004>and change the names of other stuff. =
The code=20
below is all I can share.</SPAN></FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff size=3D2><SPAN=20
class=3D625244418-09122004></SPAN></FONT> </DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff size=3D2><SPAN=20
class=3D625244418-09122004>The problem I believe the problem is in the =
phases of=20
QTP processing (I'm guessing).</SPAN></FONT></DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff size=3D2><SPAN=20
class=3D625244418-09122004></SPAN></FONT> </DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff size=3D2><SPAN=20
class=3D625244418-09122004></SPAN></FONT> </DIV>
<DIV><FONT face=3D"Courier New" color=3D#0000ff size=3D2><SPAN=20
class=3D625244418-09122004>Tim</SPAN></FONT></DIV>
<DIV>
<P><FONT color=3D#0000ff><FONT size=3D2><FONT face=3D"Courier New">CAN =
CLE</FONT>=20
</FONT></FONT></P>
<P><FONT color=3D#0000ff><FONT size=3D2><FONT face=3D"Courier =
New"> =20
ACCESS ORDER-ITEMS &</FONT> <BR><FONT=20
face=3D"Courier New"> LINK XXX OF ORDER-ITEMS=20
&</FONT> <BR><FONT face=3D"Courier =
New"> =20
TO PR-XXX OF XXX-RATIO</FONT> <BR><FONT face=3D"Courier =
New"> =20
</FONT><BR><FONT face=3D"Courier New"> </FONT><BR><FONT=20
face=3D"Courier New"> DEFINE SPOILED-CREDITS INTEGER =
SIGNED SIZE 4 =3D=20
BR-CREDITS of order-items &</FONT> <BR><FONT=20
face=3D"Courier =
New"> &n=
bsp; &nb=
sp; &nbs=
p; =20
* QUANTITY-ON-HAND of order-items &</FONT> <BR><FONT=20
face=3D"Courier =
New"> &n=
bsp; &nb=
sp; &nbs=
p; =20
* (PR-PERCENT of XXX-ratio / 100) </FONT></FONT></FONT></P>
<P><FONT color=3D#0000ff><FONT size=3D2><FONT face=3D"Courier =
New"> =20
TEMPORARY CREDIT-TOTAL NUM*8</FONT> </FONT></FONT></P>
<P><FONT color=3D#0000ff><FONT size=3D2><FONT face=3D"Courier =
New"> SORT=20
ON ITEM-NO</FONT> </FONT></FONT></P>
<P><FONT color=3D#0000ff><FONT size=3D2><FONT face=3D"Courier =
New"> ITEM=20
CREDIT-TOTAL SUBTOTAL SPOILED-CREDITS RESET AT ITEM-NO</FONT>=20
</FONT></FONT></P>
<P><FONT color=3D#0000ff><FONT size=3D2><FONT=20
face=3D"Courier New"> OUTPUT TRANSACTIONS ADD =
NOITEMS ALIAS=20
Oo-TRX</FONT> <BR><FONT face=3D"Courier New"> ITEM=20
UNIT OF =
Oo-TRX=20
INITIAL "9999999999"</FONT> <BR><FONT face=3D"Courier =
New"> =20
ITEM TRAN-KEY OF Oo-TRX INITIAL =
"Oo" +=20
ITEM-NO + PR-PREFIX</FONT> <BR><FONT face=3D"Courier =
New"> =20
ITEM CREDITS OF Oo-TRX=20
FINAL SPOILED-CREDITS</FONT> </FONT></FONT></P>
<P><FONT color=3D#0000ff><FONT size=3D2><FONT=20
face=3D"Courier New"> OUTPUT TRANSACTIONS UPDATE =
ALIAS LASTOo=20
AT ITEM-NO &</FONT> <BR><FONT=20
face=3D"Courier New"> VIA TRAN-KEY =
USING=20
"Oo" + ITEM-NO + PR-PREFIX &</FONT> <BR><FONT=20
face=3D"Courier New"> IF 0 =
<>=20
(BR-CREDITS * QUANTITY-ON-HAND - CREDIT-TOTAL)</FONT> <BR><FONT=20
face=3D"Courier New"> ITEM CREDITS OF LASTOo =3D =
CREDITS OF=20
LASTOo+ ((BR-CREDITS * QUANTITY-ON-HAND - CREDIT-TOTAL * -1))</FONT> =
<BR><FONT=20
face=3D"Courier New">GO</FONT> </FONT></FONT></P><BR>
<P><FONT color=3D#0000ff><FONT size=3D2><FONT face=3Dr_ansi>Executing =
request 1=20
...</FONT> <BR><FONT=20
=
face=3Dr_ansi>-----------------------------------------------------------=
--------------------</FONT>=20
<BR><FONT face=3Dr_ansi>Cannot find record with this key/index=20
=
value. &=
nbsp; &n=
bsp; =20
[3] </FONT><BR><FONT face=3Dr_ansi> File: =20
LASTOO</FONT><BR><FONT face=3Dr_ansi> =
Linkitem: =20
UNIT</FONT> <BR><FONT face=3Dr_ansi> =
Linkitem: =20
LINK-UNIT</FONT> <BR><FONT face=3Dr_ansi> =20
Linkitem: =20
=
TRAN-KEY  =
; =
=20
O<SPAN class=3D625244418-09122004>o</SPAN>1000105920</FONT> =
</FONT></FONT></P>
<P><FONT color=3D#0000ff><FONT size=3D2><FONT face=3Dr_ansi>Action =
Taken: Run=20
terminated.</FONT> <BR><FONT=20
=
face=3Dr_ansi>-----------------------------------------------------------=
--------------------</FONT>=20
</FONT></FONT></P>
<P><FONT color=3D#0000ff><FONT size=3D2><FONT face=3Dr_ansi>Records =
read:</FONT>=20
<BR><FONT face=3Dr_ansi> =20
=
ORDER-ITEMS &n=
bsp; &nb=
sp; =20
5,790</FONT> <BR><FONT face=3Dr_ansi> =20
=
XXX-RATIO &nbs=
p;  =
; =20
3</FONT> </FONT></FONT></P>
<P><FONT color=3D#0000ff><FONT size=3D2><FONT =
face=3Dr_ansi>Transactions=20
=
processed: &nb=
sp; =20
3</FONT> </FONT></FONT></P>
<P><FONT color=3D#0000ff><FONT size=3D2><FONT face=3Dr_ansi>Records=20
=
processed: &nb=
sp; =20
Added Updated Unchanged =20
Deleted</FONT> <BR><FONT face=3Dr_ansi> =20
=
ORDER-ITEMS &n=
bsp; &nb=
sp; =20
0 =20
0 =20
0 0</FONT> =
<BR><FONT=20
face=3Dr_ansi> =20
=
OO-TRX &=
nbsp; &n=
bsp; =20
3 =20
0 =20
0 =20
0</FONT> <BR><FONT face=3Dr_ansi> =20
=
LASTOO &=
nbsp; &n=
bsp; =20
0 =20
0 =20
0 0</FONT>=20
</FONT></FONT></P>
<P><FONT color=3D#0000ff><FONT size=3D2><FONT =
face=3Dr_ansi>Finished.</FONT>=20
<BR><FONT face=3Dr_ansi>>=20
</FONT></FONT></FONT></P><BR><BR><BR><BR><BR></SPAN></FONT></DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
<DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
size=3D2>-----Original Message-----<BR><B>From:</B> David Morrison - =
Corporate=20
[mailto:dmorrison@mcbrideelectric.com]<BR><B>Sent:</B> Thursday, =
December=20
09, 2004 1:39 PM<BR><B>To:</B> Tim Cummings; Cognos Powerhouse List=20
(E-mail)<BR><B>Subject:</B> RE: Problem updating last record written =
at sort=20
break in QTP<BR><BR></FONT></DIV>
<DIV><SPAN class=3D608573018-09122004><FONT color=3D#0000ff=20
size=3D2>Tim,</FONT></SPAN></DIV>
<DIV><SPAN class=3D608573018-09122004><FONT color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D608573018-09122004><FONT color=3D#0000ff =
size=3D2>I'm not sure=20
what's causing the QTP error; I think you need to include more of =
the=20
program (e.g., the reference to LastOq).</FONT></SPAN></DIV>
<DIV><SPAN class=3D608573018-09122004><FONT color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D608573018-09122004><FONT color=3D#0000ff =
size=3D2>Side=20
issues: Using " * .01 " may be faster and/or more =
accurate than=20
" / 100", and there's no need to ever multiply by =
-1.</FONT></SPAN></DIV>
<DIV><SPAN class=3D608573018-09122004><FONT color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D608573018-09122004><FONT color=3D#0000ff=20
size=3D2>Thanks.</FONT></SPAN></DIV>
<DIV><SPAN class=3D608573018-09122004><FONT color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D608573018-09122004><FONT color=3D#0000ff =
size=3D2>David=20
Morrison</FONT></SPAN></DIV>
<BLOCKQUOTE><FONT face=3DArial color=3D#0000ff=20
=
size=3D2></FONT> </BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTM=
L>
------_=_NextPart_001_01C4DE24.28AB0955--