JDATE
Leonard_Berkowitz@harvardpilgrim.org
Leonard_Berkowitz@harvardpilgrim.org
Mon, 23 Feb 1998 06:45:23 -0500
---------------------------- Forwarded with Changes ---------------------------
From: powerh-l-owner@sphere.swau.edu at INTERNET
Date: 2/20/98 4:50PM
To: Leonard Berkowitz at YOGI
*To: powerh-l@lists.swau.edu at INTERNET
Subject: RE: Difference between QUIZ and QTP
-------------------------------------------------------------------------------
Of course the possibility of using JDATE occurred to me. However, my
assignment is to make existing code compliant for the year 2000, not to
improve code that was written 3 or 5 or 7 years ago. If I spent time
improving code, we would have to rename this project to Y3K <g>
====================
Leonard S. Berkowitz
(work) Leonard_Berkowitz@hphc.org
(home) lberkowitz@earthlink.net
______________________________ Forward Header __________________________________
Subject: RE: Difference between QUIZ and QTP
Author: powerh-l-owner@sphere.swau.edu at INTERNET
Date: 2/20/98 4:50 PM
Leonard:
Looks like you simply want the julian date.
Why not use an item type of jdate??
As in:
define create-dte jdate = sysdate
John Pickering
JWP Systems Inc
Toronto
--------------------------------------------------------------------------
--
Original message:
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.
ffffff=Leonard S. Berkowitz
(work) Leonard_Berkowitz@hphc.org