Difference between QUIZ and QTP

Deskin, Bob Bob.Deskin@cognos.com
Fri, 20 Feb 1998 15:51:10 -0500


Since I'm watching out for date related issues (for year 2000), I tested
this and got the same values in both QUIZ and QTP in versions 7.09 and
7.29 - the value you wanted 980101. The only thing I can think of is
that you ran with a different dictionary which had century excluded. In
that case, SYSDATE would be only 6 digits. Is this possible?

Bob Deskin              
Senior Product Advisor  bob.deskin@cognos.com
Cognos Inc.             (613) 738-1338 ext 4205 FAX: (613) 228-3149
3755 Riverside Drive P.O. Box 9707 Stn. T, Ottawa ON K1G 4K9 CANADA


> ----------
> From:
> Leonard_Berkowitz@harvardpilgrim.org[SMTP:Leonard_Berkowitz@harvardpil
> grim.org]
> Sent: 	February 20, 1998 2:42 PM
> To: 	        -         (052)Powerh-L (074)powerh-l(a)lists.swau.edu
> Subject: 	Difference between QUIZ and QTP
> 
> 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
> 
>