Difference between QUIZ and QTP

Leonard_Berkowitz@harvardpilgrim.org Leonard_Berkowitz@harvardpilgrim.org
Fri, 20 Feb 1998 14:42:58 -0500


On the HP3000, PH 7.09, with our dictionary set as follows:

02/20/98              xxxxxxxxxxxxxxxxxxxxxxxxxxxxx               Page    1

                           For DICTIONARY:  PDH

    Dictionary Name:    xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    Created:            On 02/03/98         By PDL   7.09.E

    -- Date Options --
    Century Included?:  Yes                  Default Century:    19

Now consider the following code:

DEF FRSTYR INT*8 = NCONVERT(ASCII(FLOOR(SYSDATE/10000)) + "0101")
DEF CREATE-DTE CHAR*5 = ASCII(FRSTYR)[3:2] + ASCII((DAYS(SYSDATE) + &
                                             1 - (DAYS(FRSTYR))),3)

For CREATE-DTE, QUIZ reports 98051 (what I want)
                QTP writes   01051 (not what I want)

I can make QTP behave correctly by forcing the first ASCII to be 8 digits,
thus:

DEF FRSTYR INT*8 = NCONVERT(ASCII(FLOOR(SYSDATE/10000)) + "0101")
DEF CREATE-DTE CHAR*5 = ASCII(FRSTYR,8)[3:2] + ASCII((DAYS(SYSDATE) + &
                                             1 - (DAYS(FRSTYR))),3)

                              ^^^^^^^^^

FRSTYR, in QUIZ at least is 19980101 so it is 8 digits, and thus the ASCII
function should default to 8.

Any comments?

By the way, I know that the 01 instead of 98 is the first 01 of 0101
because I ran the routine with 0203 and QTP wrote 02051.

Have a good weekend, all.

====================
Leonard S. Berkowitz
(work) Leonard_Berkowitz@hphc.org