Date Parm Problem

Michael C. Lee mclsys@home.com
Wed, 15 Jul 1998 08:50:42 -0700


You can make the define with the PARM option on it CENTURY INCLUDED but still
have the prompts format YYMMDD as follows:

DEFINE DATE-IN DATE CENTURY INCLUDED = &
               PARM FORMAT YYMMDD PROMPT "Enter date (YYMMDD):  "

Then on you're other date...
DEFINE DATE-OUT DATE CENTURY INCLUDED =  &
              19000000 + mod(DATE-IN,1000000) if  DATE-IN > 19500101 else &
              20000000 + mod(DATE-IN,1000000) if DATE-IN >  0

Better yet if you use the next version of Powerhouse with it's CENTURY WINDOW
feature which will do the work for you. You won't need the 2nd define. As well
in the next version you can set the dictionary to allow the user to enter the
century in FORMAT YYMMDD dates if they choose.

Mike Lee
MCL Systems Inc.
mclsys@home.com

Calvin.Dimsha@gsle.gensig.com wrote:

> We are using Quiz v7.29.c8 on HP3000 MPE/ix v5.5 pp4.
>
> Our 3rd party business application has chosen "1950 logic" to be year 2000
> compliant, therefore the Image databases will continue to store 6 digit
> dates.  All date prompts in the software will continue to be 6 digit.
>
> We are in the process of revising over 1000 Quiz reports to make them year
> 2000 compliant, using the same "1950 logic."  Dates used in comparisons or
> sorts, whether from the database or input by the user, will be converted to
> CENTURY INCLUDED, all transparent to the user.
>
> For example:
>
> DEFINE DATE-IN DATE = PARM PROMPT "Enter date (YYMMDD): "
> ;remember: dictionary is "century excluded"
> ;date-in is 6 digit by default
> DEFINE DATE-OUT DATE CENTURY INCLUDED = &
>  19000000 + DATE-IN IF DATE-IN > 500101 ELSE &
>  20000000 + DATE-IN IF DATE-IN > 0
> ;use date-out in compares, sorts, and output
>
> The Problem:
> ------------
> This works for all dates except 2/29/2000 which would be input as 000229.
> When that date is input an error message results because it is interpreted
> as 2/29/1900 which did not exist.
>
> I could change DATE-IN to CENTURY INCLUDED, but I'm afraid of mass
> confusion among the users, not to mention plenty of job streams which would
> also need revising.  No thanks.
>
> The only viable workaround I see is to define DATE-IN as NUM*6.  The
> problem with that is users could enter any number, even if it is not a
> valid date.
>
> Am I missing something?  I there some easy solution?  Is there a way to
> make 2/29/1900 a valid date?  (We don't have any data older than 1980.)
>
> Calvin Dimsha
> GS Laboratory Equipment
> Asheville, NC
> calvin.dimsha@gsle.gensig.com
>
> The views expressed here are mine and do not reflect the official policy of
> my employer or the organization through which the Internet was accessed.
> = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
> Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
> Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
> powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
> 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
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.