QTP question...

Rob Lobbe rlobbe@vic.bigpond.net.au
Tue, 5 Dec 2000 10:32:25 +1100


Art (and others)

Try fully qualifying your items.
Here are some suggestions to speed the entire process.

1. Use GLOBAL TEMPORARY for D-DATE-START & D-DATE-END as these only get
processed once (I assume that HSTSTRDT & HSTENDDT do not change during run)

2. Use ACCESS statement to link HIST to TRANS (Use ALIASes) Only FIND
records that "could" result in processing.

RUN HIST5

GLOBAL TEMP d-date-start CHAR*8 = GETSYSTEMVAL("HSTSTRDT")
GLOBAL TEMP d-date-end   CHAR*8 = GETSYSTEMVAL("HSTENDDT")

SET PROCESS LIMIT ...

REQUEST HIST5 ...

ACCESS *HIST2.SUBFILE ALIAS HIST2&
  LINK TO TRANS
    USING ACCOUNT OF HIST2 &
    VIA ACCOUNT
SELECT HIST2 IF ...
SELECT TRANS IF ...
SELECT IF ...

OUTPUT TRANS DELETE ALIAS del-trans &
  ON ERRORS REPORT &
    USING <primary-index> OF TRANS &
    VIA <primary-index>

BUILD ...

3. IF the link results in multiple occurrences of ACCOUNT OF TRANS a "SORT -
AT" combination may also be required

SORT ON account of trans

OUTPUT ... &
  AT account of trans

Rob Lobbe
Practice Manager
(x) Praxa Ltd


-----Original Message-----
From: owner-powerh-l@sphere.swau.edu
[mailto:owner-powerh-l@sphere.swau.edu]On Behalf Of Art Bahrs
Sent: Tuesday, December 05, 2000 9:07 AM
To: Power House ListServ
Subject: QTP question...


Hi All :)
   Ok.... Newbie question:  Why can't QTP find my fields referenced in the
IF clause of a OUTPUT statement?

Source Code:
   17     RUN HIST5
   18
   19     REQUEST HIST5 ON CALCULATION ERRORS REPORT ON EDIT ERRORS REPORT
   20
   21     SET PROCESS LIMIT 9999999 LOCK FILE UPDATE
   22
   23     ACCESS *HIST2.SUBFILE
   24
   28     DEFINE D-DATE-START CHAR*8 = GETSYSTEMVAL("HSTSTRDT")
   29
   30     DEFINE D-DATE-END   CHAR*8 = GETSYSTEMVAL("HSTENDDT")
   30.1
   37     OUTPUT TRANS DELETE ON ERRORS REPORT &
   37.1                VIA ACCOUNT USING ACCOUNT OF HIST2 &
   38                  IF ((POST-DATE >= D-DATE-START) AND &
   39                      (POST-DATE <= D-DATE-END) AND &
   40                      (TRANS-TYPE[2:1] = "1") AND &
   41                      (SERV <> "H-BAL"))
   43
   44     BUILD HIST5TST.OBJQ

Compile Try in QTP:
> RUN HIST5
>
> REQUEST HIST5 ON CALCULATION ERRORS REPORT ON EDIT ERRORS REPORT
>
> SET PROCESS LIMIT 9999999 LOCK FILE UPDATE
>
> ACCESS *HIST2.SUBFILE
*W* PowerHouse name for HIST2.SUBFILE is HIST2.
>
> DEFINE D-DATE-START CHAR*8 = GETSYSTEMVAL("HSTSTRDT")
>
> DEFINE D-DATE-END   CHAR*8 = GETSYSTEMVAL("HSTENDDT")
>
> OUTPUT TRANS DELETE ON ERRORS REPORT &
>              VIA ACCOUNT USING ACCOUNT OF HIST2 &
>              IF ((POST-DATE >= D-DATE-START) AND &
*E* Can't find item named POST-DATE.
>                  (POST-DATE <= D-DATE-END) AND &
*E* Can't find item named POST-DATE.
>                  (TRANS-TYPE[2:1] = "1") AND &
*E* Can't find item named TRANS-TYPE.
>                  (SERV <> "H-BAL"))
*E* Can't find item named SERV.
*W* Linkage should be via a unique key/index if the file is output only.
>
> BUILD HIST5TST.OBJQ
*E* There were errors in the source code. BUILD wasn't performed.

The Trans file is defined in the dictionary and the fields POST-DATE,
TRANS-TYPE & SERV exist in Trans.  The HIST2.SUBFILE file exists in the
current account.
 I have a file equation set for the database holding TRANS and for the
Dictionary....

Art "Confused again! hehe" Bahrs

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
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
This list is closed, thus to post to the list, you must be a subscriber.