Unexplained QTP behavior
Deskin, Bob
Bob.Deskin@Cognos.COM
Wed, 24 Sep 2003 14:55:49 -0400
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C382CD.78858A30
Content-Type: text/plain
The basic problem is that even though the ITEM statement for TI-REC-CNT
appears before the SORT statement, it is not processed until the output
phase. ITEM statements are output phase statements. So having TI-REC-CNT in
the sort simply sorts on the same value, 0, for each transaction.
Bob Deskin
Product Manager, Application Development Tools, Cognos Inc.
bob.deskin@cognos.com (613) 738-1338 ext 7268 FAX: (613) 727-1178
3755 Riverside Drive P.O. Box 9707 Stn. T, Ottawa ON K1G 4K9 CANADA
-----Original Message-----
From: Mike Palandri [mailto:palandri@4j.lane.edu]
Sent: Wednesday, September 24, 2003 2:25 PM
To: powerh-l@lists.swau.edu
Subject: Unexplained QTP behavior
Sorry for the double post, I forgot the Subject on the original.
===================================
Hi yall,
I'm puzzled by some behavior I encountered in QTP 7.10 F4 OpenVMS. Here's
a simple example distilled from the longer program:
A file has four items and four records with the following values:
Item0 Item1 Item2 Item3
AAAAAA 111111 1 A
AAAAAA 111111 2 B
AAAAAA 111111 2 C
AAAAAA 111111 3 D
This QTP reads the file and creates a subfile:
CAN CLE
ACCESS TESTREC
TEMP TI-ITEM INT*02
TEMP TI-REC-CNT INT*10
ITEM TI-ITEM INITIAL 0
ITEM TI-REC-CNT INITIAL 0
SORT ON ITEM0, ITEM1, ITEM2, TI-REC-CNT
ITEM TI-REC-CNT = TI-REC-CNT + 1
ITEM TI-ITEM = ITEM2 AT TI-REC-CNT RESET AT ITEM1
SUBFILE TT1 KEEP INCLUDE &
ITEM0, &
ITEM1, &
ITEM2, &
TI-REC-CNT, &
TI-ITEM
Here's what ends up in the subfile:
Item0 Item1 Item2 TI-REC-CNT TI-ITEM
AAAAAA 111111 1 1 0
AAAAAA 111111 2 2 1
AAAAAA 111111 2 3 1
AAAAAA 111111 3 4 2
TI-REC-CNT provides a control break on every record. The break is used to
assign the value of ITEM2 to the temp TI-ITEM. Because TI-REC-CNT changes
on every record, I thought that this assignment would take place on every
record.
However, on the third record, where the value of Item2 is the same as Item2
in the second record, the break never occurs, and the assignment of Item2
to TI-ITEM doesn't happen. The break truly does not occur; I ran a trace
and found "at end" processing of Ti-Rec-Cnt on the first, third, and
fourth complexes, but not the second:
# NEW RECORD COMPLEX -> 1
**** PROCESSING AT END OF TI-REC-CNT 1
**** ITEM TI-ITEM = : AT TI-REC-CNT
**** BEFORE 0
**** AFTER 1
# NEW RECORD COMPLEX -> 3
**** PROCESSING AT END OF TI-REC-CNT 3
**** ITEM TI-ITEM = : AT TI-REC-CNT
**** BEFORE 1
**** AFTER 2
# NEW RECORD COMPLEX -> 4
**** PROCESSING AT END OF TI-REC-CNT 4
**** ITEM TI-ITEM = : AT TI-REC-CNT
**** BEFORE 2
**** AFTER 3
However, if an additional sort key is inserted on the sort statement
between Item2 and Ti-Rec-Cnt, the "At end" processing for Ti-Rec-Cnt occurs
on all four complexes, and the code works as (I) expected.
New sort statement:
SORT ON ITEM0, ITEM1, ITEM2, ITEM3, TI-REC-CNT
New resulting subfile:
Item0 Item1 Item2 TI-REC-CNT TI-ITEM
AAAAAA 111111 1 1 0
AAAAAA 111111 2 2 1
AAAAAA 111111 2 3 2
AAAAAA 111111 3 4 2
It seems to me that the "AT" for the lowest level sort key should be
processed the same regardless of the value of higher level sort keys, or
reports with headings at multiple levels of control breaks would not work.
Anybody know what's going on?
Thanks,
Mike
..
= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Mailing list: powerh-l@lists.swau.edu
Subscribe: "subscribe" in message body to powerh-l-request@lists.swau.edu
Unsubscribe: "unsubscribe <password>" in message body to
powerh-l-request@lists.swau.edu
http://lists.swau.edu/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you must be a subscriber.
Mike
..
= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Mailing list: powerh-l@lists.swau.edu
Subscribe: "subscribe" in message body to powerh-l-request@lists.swau.edu
Unsubscribe: "unsubscribe <password>" in message body to
powerh-l-request@lists.swau.edu
http://lists.swau.edu/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you must be a subscriber.
Join us at Cognos' biggest event of the year Enterprise 2003, The Cognos
Business Forum. Taking place in over 25 cities around the world, it's an
opportunity for Business and IT leaders to learn about strategies for
driving performance. Visit http://www.cognos.com/enterprise03 for more
details.
This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so. Thank you.
------_=_NextPart_001_01C382CD.78858A30
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3DUS-ASCII">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2654.89">
<TITLE>RE: Unexplained QTP behavior</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=3D2>The basic problem is that even though the ITEM =
statement for TI-REC-CNT appears before the SORT statement, it is not =
processed until the output phase. ITEM statements are output phase =
statements. So having TI-REC-CNT in the sort simply sorts on the same =
value, 0, for each transaction.</FONT></P>
<P><FONT SIZE=3D2>Bob =
Deskin =
</FONT>
<BR><FONT SIZE=3D2>Product Manager, Application Development Tools, =
Cognos Inc.</FONT>
<BR><FONT SIZE=3D2>bob.deskin@cognos.com (613) 738-1338 ext 7268 FAX: =
(613) 727-1178</FONT>
<BR><FONT SIZE=3D2>3755 Riverside Drive P.O. Box 9707 Stn. T, Ottawa ON =
K1G 4K9 CANADA</FONT>
</P>
<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Mike Palandri [<A =
HREF=3D"mailto:palandri@4j.lane.edu">mailto:palandri@4j.lane.edu</A>]</F=
ONT>
<BR><FONT SIZE=3D2>Sent: Wednesday, September 24, 2003 2:25 PM</FONT>
<BR><FONT SIZE=3D2>To: powerh-l@lists.swau.edu</FONT>
<BR><FONT SIZE=3D2>Subject: Unexplained QTP behavior</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>Sorry for the double post, I forgot the Subject on =
the original.</FONT>
</P>
<P><FONT =
SIZE=3D2>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</FONT>
<BR><FONT SIZE=3D2>Hi yall,</FONT>
</P>
<P><FONT SIZE=3D2>I'm puzzled by some behavior I encountered in QTP =
7.10 F4 OpenVMS. Here's </FONT>
<BR><FONT SIZE=3D2>a simple example distilled from the longer =
program:</FONT>
</P>
<P><FONT SIZE=3D2>A file has four items and four records with the =
following values:</FONT>
</P>
<P><FONT SIZE=3D2> Item0 Item1 =
Item2 Item3</FONT>
<BR><FONT SIZE=3D2> AAAAAA 111111 =
1 A</FONT>
<BR><FONT SIZE=3D2> AAAAAA 111111 =
2 B</FONT>
<BR><FONT SIZE=3D2> AAAAAA 111111 =
2 C</FONT>
<BR><FONT SIZE=3D2> AAAAAA 111111 =
3 D</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=3D2>This QTP reads the file and creates a subfile:</FONT>
</P>
<P><FONT SIZE=3D2>CAN CLE</FONT>
<BR><FONT SIZE=3D2>ACCESS TESTREC</FONT>
</P>
<P><FONT SIZE=3D2>TEMP TI-ITEM =
INT*02</FONT>
<BR><FONT SIZE=3D2>TEMP TI-REC-CNT INT*10</FONT>
</P>
<P><FONT SIZE=3D2>ITEM TI-ITEM INITIAL =
0</FONT>
<BR><FONT SIZE=3D2>ITEM TI-REC-CNT INITIAL 0</FONT>
</P>
<P><FONT SIZE=3D2>SORT ON ITEM0, ITEM1, ITEM2, TI-REC-CNT</FONT>
</P>
<P><FONT SIZE=3D2>ITEM TI-REC-CNT =3D TI-REC-CNT + 1</FONT>
<BR><FONT SIZE=3D2>ITEM TI-ITEM =3D ITEM2 AT TI-REC-CNT RESET AT =
ITEM1</FONT>
</P>
<P><FONT SIZE=3D2>SUBFILE TT1 KEEP INCLUDE &</FONT>
<BR><FONT SIZE=3D2> ITEM0, &</FONT>
<BR><FONT SIZE=3D2> ITEM1, &</FONT>
<BR><FONT SIZE=3D2> ITEM2, &</FONT>
<BR><FONT SIZE=3D2> TI-REC-CNT, &</FONT>
<BR><FONT SIZE=3D2> TI-ITEM</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=3D2>Here's what ends up in the subfile:</FONT>
</P>
<P><FONT SIZE=3D2>Item0 Item1 Item2 =
TI-REC-CNT TI-ITEM</FONT>
<BR><FONT SIZE=3D2> AAAAAA 111111 =
1  =
; 1 0</FONT>
<BR><FONT SIZE=3D2> AAAAAA 111111 =
2  =
; 2 1</FONT>
<BR><FONT SIZE=3D2> AAAAAA 111111 =
2  =
; 3 1</FONT>
<BR><FONT SIZE=3D2> AAAAAA 111111 =
3  =
; 4 2</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=3D2>TI-REC-CNT provides a control break on every =
record. The break is used to </FONT>
<BR><FONT SIZE=3D2>assign the value of ITEM2 to the temp TI-ITEM. =
Because TI-REC-CNT changes </FONT>
<BR><FONT SIZE=3D2>on every record, I thought that this assignment =
would take place on every </FONT>
<BR><FONT SIZE=3D2>record.</FONT>
</P>
<P><FONT SIZE=3D2>However, on the third record, where the value of =
Item2 is the same as Item2 </FONT>
<BR><FONT SIZE=3D2>in the second record, the break never occurs, and =
the assignment of Item2 </FONT>
<BR><FONT SIZE=3D2>to TI-ITEM doesn't happen. The break truly =
does not occur; I ran a trace </FONT>
<BR><FONT SIZE=3D2>and found "at end" processing of =
Ti-Rec-Cnt on the first, third, and </FONT>
<BR><FONT SIZE=3D2>fourth complexes, but not the second:</FONT>
</P>
<P><FONT SIZE=3D2># NEW RECORD COMPLEX -> 1</FONT>
<BR><FONT SIZE=3D2>**** PROCESSING AT END OF TI-REC-CNT 1</FONT>
<BR><FONT SIZE=3D2>**** ITEM TI-ITEM =3D =
: AT TI-REC-CNT</FONT>
<BR><FONT SIZE=3D2>**** =
BEFORE =
0</FONT>
<BR><FONT SIZE=3D2>**** =
AFTER &=
nbsp; 1</FONT>
</P>
<BR>
<P><FONT SIZE=3D2># NEW RECORD COMPLEX -> 3</FONT>
<BR><FONT SIZE=3D2>**** PROCESSING AT END OF TI-REC-CNT 3</FONT>
<BR><FONT SIZE=3D2>**** ITEM TI-ITEM =3D =
: AT TI-REC-CNT</FONT>
<BR><FONT SIZE=3D2>**** =
BEFORE =
1</FONT>
<BR><FONT SIZE=3D2>**** =
AFTER &=
nbsp; 2</FONT>
</P>
<BR>
<P><FONT SIZE=3D2># NEW RECORD COMPLEX -> 4</FONT>
<BR><FONT SIZE=3D2>**** PROCESSING AT END OF TI-REC-CNT 4</FONT>
<BR><FONT SIZE=3D2>**** ITEM TI-ITEM =3D =
: AT TI-REC-CNT</FONT>
<BR><FONT SIZE=3D2>**** =
BEFORE =
2</FONT>
<BR><FONT SIZE=3D2>**** =
AFTER &=
nbsp; 3</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>However, if an additional sort key is inserted on the =
sort statement </FONT>
<BR><FONT SIZE=3D2>between Item2 and Ti-Rec-Cnt, the "At end" =
processing for Ti-Rec-Cnt occurs </FONT>
<BR><FONT SIZE=3D2>on all four complexes, and the code works as (I) =
expected.</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>New sort statement:</FONT>
<BR><FONT SIZE=3D2>SORT ON ITEM0, ITEM1, ITEM2, ITEM3, =
TI-REC-CNT</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=3D2>New resulting subfile:</FONT>
<BR><FONT SIZE=3D2> Item0 Item1 =
Item2 TI-REC-CNT TI-ITEM</FONT>
</P>
<P><FONT SIZE=3D2> AAAAAA 111111 =
1  =
; 1 0</FONT>
<BR><FONT SIZE=3D2> AAAAAA 111111 =
2  =
; 2 1</FONT>
<BR><FONT SIZE=3D2> AAAAAA 111111 =
2  =
; 3 2</FONT>
<BR><FONT SIZE=3D2> AAAAAA 111111 =
3  =
; 4 2</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>It seems to me that the "AT" for the lowest =
level sort key should be </FONT>
<BR><FONT SIZE=3D2>processed the same regardless of the value of higher =
level sort keys, or </FONT>
<BR><FONT SIZE=3D2>reports with headings at multiple levels of control =
breaks would not work.</FONT>
</P>
<P><FONT SIZE=3D2>Anybody know what's going on?</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>Thanks,</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>Mike</FONT>
<BR><FONT SIZE=3D2>..</FONT>
</P>
<P><FONT SIZE=3D2>=3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =
=3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D</FONT>
<BR><FONT SIZE=3D2>Mailing list: powerh-l@lists.swau.edu</FONT>
<BR><FONT SIZE=3D2>Subscribe: "subscribe" in message body to =
powerh-l-request@lists.swau.edu</FONT>
<BR><FONT SIZE=3D2>Unsubscribe: "unsubscribe =
<password>" in message body to </FONT>
<BR><FONT SIZE=3D2>powerh-l-request@lists.swau.edu</FONT>
<BR><FONT SIZE=3D2><A =
HREF=3D"http://lists.swau.edu/mailman/listinfo/powerh-l" =
TARGET=3D"_blank">http://lists.swau.edu/mailman/listinfo/powerh-l</A></F=
ONT>
<BR><FONT SIZE=3D2>This list is closed, thus to post to the list you =
must be a subscriber.</FONT>
</P>
<P><FONT SIZE=3D2>Mike</FONT>
<BR><FONT SIZE=3D2>..</FONT>
</P>
<P><FONT SIZE=3D2>=3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =
=3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D</FONT>
<BR><FONT SIZE=3D2>Mailing list: powerh-l@lists.swau.edu</FONT>
<BR><FONT SIZE=3D2>Subscribe: "subscribe" in message body to =
powerh-l-request@lists.swau.edu</FONT>
<BR><FONT SIZE=3D2>Unsubscribe: "unsubscribe =
<password>" in message body to =
powerh-l-request@lists.swau.edu</FONT>
<BR><FONT SIZE=3D2><A =
HREF=3D"http://lists.swau.edu/mailman/listinfo/powerh-l" =
TARGET=3D"_blank">http://lists.swau.edu/mailman/listinfo/powerh-l</A></F=
ONT>
<BR><FONT SIZE=3D2>This list is closed, thus to post to the list you =
must be a subscriber.</FONT>
</P>
<P><FONT SIZE=3D2>Join us at Cognos' biggest event of the year<I> =
Enterprise 2003, The Cognos Business Forum</I>. Taking place in =
over 25 cities around the world, it's an opportunity for Business and =
IT leaders to learn about strategies for driving performance. Visit<U> =
<A HREF=3D"http://www.cognos.com/enterprise03" =
TARGET=3D"_blank">http://www.cognos.com/enterprise03</A></U> for more =
details. </FONT></P>
<P><FONT SIZE=3D2>This message may contain privileged and/or =
confidential information. If you have received this e-mail in =
error or are not the intended recipient, you may not use, copy, =
disseminate or distribute it; do not open any attachments, delete it =
immediately from your system and notify the sender promptly by e-mail =
that you have done so. Thank you.</FONT></P>
</BODY>
</HTML>
------_=_NextPart_001_01C382CD.78858A30--