So how about just adding the 100 years?
In the syntax below, it prevents adding 100 years to any date that is
more than 1/1/1908 (you could use any date that makes sense with your
if (testdt<date.mdy(1,1,1908)) testdt=datesum(testdt,100,"YEAR").
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of
Sent: Friday, June 29, 2007 7:30 AM
Subject: Re: [SPSSX-L] Quick solution for a date problem?
Thank you. Unfortunately, I do not have any additional syntax or
output; this data was entered by a student of a colleague (and the
student is no longer here). So I am not sure if the student actually
entered the dates "1902" (all four digits) or what, but the dates should
range from 1998-2002. We have checked the options for the century as
you have specified, no luck. Regardless, thanks for your help.
----- Original Message -----
From: Richard Ristow <email@example.com>
Date: Thursday, June 28, 2007 10:16 pm
Subject: Re: Quick solution for a date problem?
To: KEVIN MANNING <firstname.lastname@example.org>, SPSSX-L@LISTSERV.UGA.EDU
Cc: "Oliver, Richard" <email@example.com>, Melissa Ives
> At 03:48 PM 6/28/2007, KEVIN MANNING wrote:
> >Date is entered as a variable as dd/mm/yyyy, but for some reason the
> >dates for 2000+ are reading as dd/mm/1901, dd/mm/1902, ...instead of
> >dd/mm/2001, so on. Anyone know of an easy way to fix this problem?
> See Richard Oliver's reply, but you can see that he's a bit mystified,
> As general advice: When you aren't getting the result you want, it
> helps if you can give us the exact syntax that seems not to be
> working; some test data, with some input you passed to the syntax; and
> the output from that data and the syntax, with any error or warning
> messages exactly as they were printed. And, what output you wanted
> instead of the output you got.
> The more we know, the more we can help. And debugging is like
> proofreading, or medical diagnosis: It's the details, and the exact
> information, that matter.
> -Good luck, and by all means give us a follow-up post,
PRIVILEGED AND CONFIDENTIAL INFORMATION
This transmittal and any attachments may contain PRIVILEGED AND
CONFIDENTIAL information and is intended only for the use of the
addressee. If you are not the designated recipient, or an employee
or agent authorized to deliver such transmittals to the designated
recipient, you are hereby notified that any dissemination,
copying or publication of this transmittal is strictly prohibited. If
you have received this transmittal in error, please notify us
immediately by replying to the sender and delete this copy from your
system. You may also call us at (309) 827-6026 for assistance.