Unexpected QTP result

Watt, Peter pwatt@dairyworld.com
Tue, 20 Apr 1999 15:11:41 -0700


I seem to remember encountering the same problem many years ago on the
HP3000.  Try changing the output statement to 'output TEST-SCORES del if KNT
> 0'.  If I remember correctly, we determined that the temporary item does
not get incremented until after the output statement.

Regards,
Peter Watt

	-----Original Message-----
	From:	John MacLerran [SMTP:macljohn@isu.edu]
	Sent:	Tuesday, April 20, 1999 2:57 PM
	To:	powerh-l@lists.swau.edu
	Subject:	Unexpected QTP result

	Hello,

	I'm trying to use Qtp to delete duplicate records in a detail
dataset
	(HP3000 TurboImage, MPE 5.5, PH 7.29c5).  The data looks like this:

	id      exam-type      score-type        test-date     %score
	raw-score  pass-fail
	1097    ENGL                 1            04/15/99
	77               77              P
	1097    ENGL                 1            04/15/99
	77               77              P
	1097    ENGL                 1            04/15/99
	77               77              P
	1097    ENGL                 2            04/15/99
	61               61              P
	1097    ENGL                 2            04/15/99
	61               61              P
	1097    ENGL                 2            04/15/99
	61               61              P

	etc.  There should be only one record for each ID, Exam-Type,
	Score-type, Test-Date, Score, Raw-Score, and Pass-fail combination,
but
	as it now stands, there are 8 or more.

	Here's the QTP we tried to use to delete all but the first record.

	acc TEST-SCORES
	sort on ID on EXAM-TYPE on SCORE-TYPE on DATE-TEST on SCORE &
	       on RAW-SCORE on PASS-FAIL
	set process lim 80000
	set lock file update
	temp KNT
	   item KNT count reset at PASS-FAIL
	output TEST-SCORES del if KNT > 1
	subfile tempsub include ID, KNT, EXAM-TYPE, SCORE-TYPE, DATE-TEST, &
	          SCORE, RAW-SCORE, PASS-FAIL
	go

	What happened was that _all_ of the records in the TEST-SCORES
dataset
	were deleted.  Afterward, the tempsub subfile looks like this:

	id          knt    exam-type    score-type      test-date
	%score       raw-score  pass-fail
	1097       1       ENGL               1            04/15/99
	77               77              P
	1097       2       ENGL               1            04/15/99
	77               77              P
	1097       3       ENGL               1            04/15/99
	77               77              P
	1097       1       ENGL               2            04/15/99
	61               61              P
	1097       2       ENGL               2            04/15/99
	61               61              P
	1097       3       ENGL               2            04/15/99
	61               61              P

	The count field looks like it's incrementing properly, so we thought
	that records 2 and 3 from each control group would be deleted,
leaving
	us with record 1 in the dataset.

	Why did Qtp delete all the records in the dataset?  Am I missing
	something obvious?

	Ponderingly yours...
	
----------------------------------------------------------------------
	  John MacLerran
	  IT Systems Analyst                       email:   macljohn@isu.edu
	  Idaho State University                             V(208) 236-2872
	  http://www.isu.edu/~macljohn                       F(208) 236-3673
	
----------------------------------------------------------------------


	= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
= = = =
	Subscribe: "subscribe powerh-l" in message body to
majordomo@lists.swau.edu
	Unsubscribe: "unsubscribe powerh-l" in message to
majordomo@lists.swau.edu
	powerh-l@lists.swau.edu is gatewayed one-way to
bit.listserv.powerh-l
	This list is closed, thus to post to the list, you must be a
subscriber.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.