Problem with Date(days()) functions
Cousins, Michael
Michael.Cousins@Cognos.COM
Thu, 8 Apr 1999 09:54:50 -0400
Jay wrote:
>It is set to 19 and I doubt the client will be
>willing to change the dictionary to CENTURY INCLUDED,
>because we are working on a Y2K project using date
>windowing, so we are not expanding their dates
>in the dictionary.
>We will be working with both 1900 and 2000 dates,
>so won't changing the default century
>cause us problems?
>Will the INPUT CENTURY dictionary setting help us
>at all? We are date windowing for using 20 as a
>pivot date, so any dates over 20 are considered
>to be 1900's and anydays less than 20 are considered
>to be 2000's. I'm notterrible sure how INPUT CENTURY
>works.
------
Leave the DEFAULT CENTURY as 19 and use INPUT CENTURY. At the end of this
year you will need only change the DEFAULT CENTURY and recompile the PDL.
You can also leave the date FORMAT as MMDDYY - but without CENTURY INCLUDED
the test code you supplied will not work, for the reasons clearly documented
by Bob Deskin. This is the way the product has always worked.
INPUT CENTURY 19 FROM 20 can be used to help you with your date window. It
specifies the century 19 be assumed and added to a century included date
where only a two digit year is input and the year value is greater than or
equal to 20. Else 20 will be assumed and added.
If INPUT CENTURY is not used then the DEFAULT CENTURY is value used.
If one of those is not coded then 19 is used.
INPUT CENTURY is for INPUT only. It has nothing to do with translating a 6
digit date read from a file into an 8 digit date field. If you are going to
use pivot year logic, and not convert your 6 digit dates to 8 digit dates,
then you have to look at the date processing for all of your dates in all of
your code.
One other function that was added to 819 is the CENTURY function. You can
make use of it to work with the pivot year you have choosen to use in the
INPUT CENTURY option. For example, assuming <dateitem1> is a 6 digit date
you can use:
DEFINE <dateitem2> = ADDCENTURY(<dateitem1>,CENTURY(<dateitem1>))
With this expression you can expect that the century added to <dateitem1>
will be the century as defined by the INPUT CENTURY 19 FROM 20 statement. In
this fashion the CENTURY function can be used to simplfy your pivot year
date processing.
Michael Cousins
Technical Specialist
Cognos, Inc.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
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.