Conversion from QUIZ to QTP, Part II

Rich `Lego-Man' Jesse - 7633 RJESSE@QTIWORLD.COM
Thu, 08 Jul 1999 16:18:37 -0500 (CDT)


Hey again,

I've got everything in my QUIZ report converted to QTP (733d3 on HP 10.20
accessing an Oracle 7.3.4.3.0 db), except for a counter that's giving me some
trouble.  I've looked in the manuals, looked at examples, and tried a bunch of
variations on the counter with no luck.

Here's the closest I've come to obtaining the correct results (just a working
fragment of the actual code):

  RUN QT123
  REQUEST QT123
  SET PROCESS NOLIMIT
  SET LOCK FILE UPDATE

  ACCESS DB_FILE01	&
	LINK MY_KEY OF DB_FILE01 VIAINDEX F02_MY_KEY TO DB_FILE02

  DEFINE  COMPARE_TODAYS_DATE	NUM = DAYS(SYSDATE)
  DEFINE  D_TODAYS_DATE		DATE = SYSDATE
  DEFINE	D_FILE_TEST_DATE	NUM = DAYS(FILE_TEST_DATE OF DB_FILE02)
  DEFINE  D_MASTER_LABEL_COUNT	NUM*5 = 1

  DEFINE D_TOT_QTY FLOAT SIZE 8 = (QTY01 OF DB_FILE01 + QTY02 OF DB_FILE01)
  DEFINE SORT_STUFF CHAR*34 = ORDERNO OF DB_FILE01 +	&
	OTHERNO OF DB_FILE01 + PARTNO OF DB_FILE01
  DEFINE MY_CRITERIA NUM*1 = 1 IF (D_FILE_TEST_DATE >= COMPARE_TODAYS_DATE) OR &
	(RSTATUS OF DB_FILE02 = "R" AND CFLAG OF DB_FILE02 = "Y" AND &
	LFLAG OF DB_FILE02 = " ") ELSE 0

  SELECT IF 0 <> D_TOT_QTY

  SORT						&
	ON MY_CRITERIA				&
	ON FILE_TEST_DATE OF DB_FILE02		&
	ON SORT_STUFF

  DEFINE	D_GROUP_COUNT	NUM*5 = 1 IF (1 = MY_CRITERIA) ELSE 0
  TEMPORARY	T_GROUP_COUNT	NUM*5
  ITEM		T_GROUP_COUNT SUBTOTAL D_GROUP_COUNT AT SORT_STUFF

  OUTPUT QT123_FILE ADD
	ITEM ORDERNO		FINAL ORDERNO OF DB_FILE01
	ITEM FILE_TEST_DATE	FINAL FILE_TEST_DATE OF DB_FILE02
	ITEM TOT_QTY		FINAL D_TOT_QTY
	ITEM TODAYS_DATE	FINAL D_TODAYS_DATE
	ITEM GROUP_COUNT	FINAL T_GROUP_COUNT

  GO
  EXIT

My problem is the item GROUP_COUNT.  The count is short by one.  It's missing
the first group.  Maybe it's a problem with the way I'm doing the subtotaling? 
Or maybe a problem of timing between the AT SORT_STUFF and when the DEFINEs and
TEMPORARYs get evaluated?

I've checked thru the QTP Reference manual, the "Using QTP" manual, and the
Cognos website.  I figured I'd stop here first before logging a call.

Any info is appreciated!  TIA!

Rich Jesse                              Programmer/Analyst (/DBA/SysAdmin/etc.)
rjesse@qtiworld.com                     Quad/Tech International, Sussex, WI USA
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
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.