QTP as a system hog

Merol Newman meroln@specialist.co.uk
Tue, 18 Apr 2000 19:34:32 +0100


Hello Dave

I can see a dog chasing its tail! This sort of code looks a bit
3gl-ish to me (a strictly PH-only programmer).

It would work if you were running Quick as a ghost screen with
an INITIALIZE procedure doing a WHILE RETRIEVING on the KSAM
file, because you could say

IF  PERIOD01 = 0 
then let ITEM PERIOD01 = EXPIRE-YYYYMM

after which you could set PERIOD02 based on the NEW value of
PERIOD01.

But I think in QTP your temp items are all starting as 0 and
being evaluated at the same time, not one after the other in the
order written.

If what you want is a subfile containing all the year/month
expiry dates occurring in the file between the start and stop dates,
you need an intermediate pass, such as...

temp x
item x = 1 at expire-yyyymm
temp xx
item xx subtotal x
subfile intermed at expire-yyyymm include expire-yyyymm, xx
SUBFILE FO0600S1 INCLUDE EXPIRE-CREDITS

request next-request
access *intermed
sorted on expire-yyyymm
temp period01 zone*6
item period01 = expire-yyyymm if xx = 1
temp period02 zone*6
item period02 = expire-yyyymm if xx = 2
etc etc

SUBFILE FO0600S2 AT FINAL INCLUDE &
            PERIOD01, &
            PERIOD02, &
 
The problem with this is that you need to hard-code for a maximum
number of periods that would be selected, but I think you were
doing that anyway.

Hope this helps - I've done similar things myself many times, but
since they are one-off Support jobs rather than permanent programs,
it's not easy to find a tried-and-tested example - so allow for a
few syntax errors in my code!

Merol

Merol Newman
E-mail: meroln@specialist.co.uk <mailto:meroln@specialist.co.uk>


> -----Original Message-----
> From: owner-powerh-l@sphere.swau.edu
> [mailto:owner-powerh-l@sphere.swau.edu]On Behalf Of Dave Knispel
> Sent: 18 April 2000 18:00
> To: powerh-l@lists.swau.edu; HP3000-L@raven.utc.edu
> Subject: Re: QTP as a system hog
>
>
> I had a request for the problem code.  Here it is...
> ============================================
> RUN FO06001T
>
> GLOBAL TEMPORARY TODAYS-DATE DATE INITIAL SYSDATE
>
> SET LOCK FILE REQUEST
>
> SET PROCESS LIMIT 5000000
> GLOBAL TEMP START-DATE ZONE*06 PARM
> GLOBAL TEMP STOP-DATE  ZONE*06 PARM
> ;------------------------------------------------
> REQUEST EXTRACT-EXPIRING
>    ACC EXPIRE-CREDITS
>    SEL IF EXPIRE-YYYYMM >= START-DATE               &
>       AND EXPIRE-YYYYMM <= STOP-DATE
>
>    SORT ON EXPIRE-YYYYMM
>    TEMP PERIOD01 ZONE*6
>    TEMP PERIOD02 ZONE*6
>    TEMP PERIOD03 ZONE*6
>    TEMP PERIOD04 ZONE*6
>    TEMP PERIOD05 ZONE*6
>    TEMP PERIOD06 ZONE*6
>    TEMP PERIOD07 ZONE*6
>    TEMP PERIOD08 ZONE*6
>    TEMP PERIOD09 ZONE*6
>    TEMP PERIOD10 ZONE*6
>    TEMP PERIOD11 ZONE*6
>    TEMP PERIOD12 ZONE*6
>
>    ITEM PERIOD01 = EXPIRE-YYYYMM                                &
>         IF  PERIOD01 = 0
>    ITEM PERIOD02 = EXPIRE-YYYYMM                                &
>         IF  PERIOD02 = 0                                        &
>        AND  EXPIRE-YYYYMM <> PERIOD01
>    ITEM PERIOD03 = EXPIRE-YYYYMM                                &
>         IF  PERIOD03 = 0                                        &
>        AND  EXPIRE-YYYYMM <> PERIOD01                           &
>        AND  EXPIRE-YYYYMM <> PERIOD02
>    ITEM PERIOD04 = EXPIRE-YYYYMM                                &
>         IF  PERIOD04 = 0                                        &
>        AND  EXPIRE-YYYYMM <> PERIOD01                           &
>        AND  EXPIRE-YYYYMM <> PERIOD02                           &
>        AND  EXPIRE-YYYYMM <> PERIOD03
>    ITEM PERIOD05 = EXPIRE-YYYYMM                                &
>         IF  PERIOD05 = 0                                        &
>        AND  EXPIRE-YYYYMM <> PERIOD01                           &
>        AND  EXPIRE-YYYYMM <> PERIOD02                           &
>        AND  EXPIRE-YYYYMM <> PERIOD03                           &
>        AND  EXPIRE-YYYYMM <> PERIOD04
>    ITEM PERIOD06 = EXPIRE-YYYYMM                                &
>         IF  PERIOD06 = 0                                        &
>        AND  EXPIRE-YYYYMM <> PERIOD01                           &
>        AND  EXPIRE-YYYYMM <> PERIOD02                           &
>        AND  EXPIRE-YYYYMM <> PERIOD03                           &
>        AND  EXPIRE-YYYYMM <> PERIOD04                           &
>        AND  EXPIRE-YYYYMM <> PERIOD05
>    ITEM PERIOD07 = EXPIRE-YYYYMM                                &
>         IF  PERIOD07 = 0                                        &
>        AND  EXPIRE-YYYYMM <> PERIOD01                           &
>        AND  EXPIRE-YYYYMM <> PERIOD02                           &
>        AND  EXPIRE-YYYYMM <> PERIOD03                           &
>        AND  EXPIRE-YYYYMM <> PERIOD04                           &
>        AND  EXPIRE-YYYYMM <> PERIOD05                           &
>        AND  EXPIRE-YYYYMM <> PERIOD06
>    ITEM PERIOD08 = EXPIRE-YYYYMM                                &
>         IF  PERIOD08 = 0                                        &
>        AND  EXPIRE-YYYYMM <> PERIOD01                           &
>        AND  EXPIRE-YYYYMM <> PERIOD02                           &
>        AND  EXPIRE-YYYYMM <> PERIOD03                           &
>        AND  EXPIRE-YYYYMM <> PERIOD04                           &
>        AND  EXPIRE-YYYYMM <> PERIOD05                           &
>        AND  EXPIRE-YYYYMM <> PERIOD06                           &
>        AND  EXPIRE-YYYYMM <> PERIOD07
>    ITEM PERIOD09 = EXPIRE-YYYYMM                                &
>         IF  PERIOD09 = 0                                        &
>        AND  EXPIRE-YYYYMM <> PERIOD01                           &
>        AND  EXPIRE-YYYYMM <> PERIOD02                           &
>        AND  EXPIRE-YYYYMM <> PERIOD03                           &
>        AND  EXPIRE-YYYYMM <> PERIOD04                           &
>        AND  EXPIRE-YYYYMM <> PERIOD05                           &
>        AND  EXPIRE-YYYYMM <> PERIOD06                           &
>        AND  EXPIRE-YYYYMM <> PERIOD07                           &
>        AND  EXPIRE-YYYYMM <> PERIOD08
>    ITEM PERIOD10 = EXPIRE-YYYYMM                                &
>         IF  PERIOD10 = 0                                        &
>        AND  EXPIRE-YYYYMM <> PERIOD01                           &
>        AND  EXPIRE-YYYYMM <> PERIOD02                           &
>        AND  EXPIRE-YYYYMM <> PERIOD03                           &
>        AND  EXPIRE-YYYYMM <> PERIOD04                           &
>        AND  EXPIRE-YYYYMM <> PERIOD05                           &
>        AND  EXPIRE-YYYYMM <> PERIOD06                           &
>        AND  EXPIRE-YYYYMM <> PERIOD07                           &
>        AND  EXPIRE-YYYYMM <> PERIOD08                           &
>        AND  EXPIRE-YYYYMM <> PERIOD09
>    ITEM PERIOD11 = EXPIRE-YYYYMM                                &
>         IF  PERIOD11 = 0                                        &
>        AND  EXPIRE-YYYYMM <> PERIOD01                           &
>        AND  EXPIRE-YYYYMM <> PERIOD02                           &
>        AND  EXPIRE-YYYYMM <> PERIOD03                           &
>        AND  EXPIRE-YYYYMM <> PERIOD04                           &
>        AND  EXPIRE-YYYYMM <> PERIOD05                           &
>        AND  EXPIRE-YYYYMM <> PERIOD06                           &
>        AND  EXPIRE-YYYYMM <> PERIOD07                           &
>        AND  EXPIRE-YYYYMM <> PERIOD08                           &
>        AND  EXPIRE-YYYYMM <> PERIOD09                           &
>        AND  EXPIRE-YYYYMM <> PERIOD10
>    ITEM PERIOD12 = EXPIRE-YYYYMM                                &
>         IF  PERIOD12 = 0                                        &
>        AND  EXPIRE-YYYYMM <> PERIOD01                           &
>        AND  EXPIRE-YYYYMM <> PERIOD02                           &
>        AND  EXPIRE-YYYYMM <> PERIOD03                           &
>        AND  EXPIRE-YYYYMM <> PERIOD04                           &
>        AND  EXPIRE-YYYYMM <> PERIOD05                           &
>        AND  EXPIRE-YYYYMM <> PERIOD06                           &
>        AND  EXPIRE-YYYYMM <> PERIOD07                           &
>        AND  EXPIRE-YYYYMM <> PERIOD08                           &
>        AND  EXPIRE-YYYYMM <> PERIOD09                           &
>        AND  EXPIRE-YYYYMM <> PERIOD10                           &
>        AND  EXPIRE-YYYYMM <> PERIOD11
>
>    SUBFILE FO0600S1 INCLUDE EXPIRE-CREDITS
>    SUBFILE FO0600S2 AT FINAL INCLUDE &
>            PERIOD01, &
>            PERIOD02, &
>            PERIOD03, &
>            PERIOD04, &
>            PERIOD05, &
>            PERIOD06, &
>            PERIOD07, &
>            PERIOD08, &
>            PERIOD09, &
>            PERIOD10, &
>            PERIOD11, &
>            PERIOD12
> ============================================
> David Knispel
> dave.knispel@frequencymarketing.com
> Phone: 513-248-5029
> Fax: 513-248-2672


= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
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.