[wsesug] FW: "Y2k02 Problem" with SAS 9.3

  • From: "Mosquera, Tomas (OFM)" <Tomas.Mosquera@xxxxxxxxxx>
  • To: "wsesug@xxxxxxxxxxxxx" <wsesug@xxxxxxxxxxxxx>
  • Date: Fri, 10 Jan 2020 00:32:09 +0000



An FYI to those still on SAS 9.3.  the default YEARCUTOFF in SAS 9.3 is1920.  
Thus a SAS date of DDJAN20 would be interpreted as January 1920, not 2020.  
Read Dr John Whittington's anecdote below for more background info.

Tomas





-----Original Message-----
From: SAS(r) Discussion <SAS-L@xxxxxxxxxxxxxxxx> On Behalf Of John Whittington
Sent: Thursday, January 9, 2020 5:46 AM
To: SAS-L@xxxxxxxxxxxxxxxx
Subject: "Y2k02 Problem" with SAS 9.3

I don't know how many people are still using SAS 9.3 (or earlier!), but I 
wonder if others have encountered this issue in recent days.

Last week, one of my clients (running 9.3) reported that two or three of their 
SAS programs were 'not working as expected' with new data.

When I looked, having confirmed that they were correct in what they were 
saying, I could find no error messages in the SAS logs.  However, by the time I 
got to look, another program was misbehaving in a more fundamental fashion, and 
when I looked at the log of that I found a "not correctly sorted" error message 
in relation to a merge statement (with a BY).

It then didn't take long to diagnose the problem.  They were still using 9.3's 
default YEARCUTOFF of 1920, so that ('new') dates of the form DDJAN20 were 
being interpreted as dates in January1920.  With the programs they initially 
complained about, all relevant datasets were being sorted similarly (with the 
DDJAN20 ones getting sorted to the very start of the dataset), so there was no 
problem with merging, but in the final case a dataset which was sorted in this 
way was being merged with one that had not been sorted (since the way in which 
it was created rendered it inevitable that the observations would be in true 
date order) - hence the error message.

The problem was then easily resolved by adding a YEARCUTOFF option statement to 
their autoexec.sas.

I'm a little surprised that the default YEARCUTOFF was increased to only 1926 
in 9.4 (although I presume there was some good reason!), but assume that things 
will change before we get to the year 2026.

Kind Regards,

John

----------------------------------------------------------------
Dr John Whittington,       Voice:    +44 (0) 1296 730225
Mediscience Services       Fax:      +44 (0) 1296 738893
Twyford Manor, Twyford,    E-mail:   John.W@xxxxxxxxxxxxxxxxx
Buckingham  MK18 4EL, UK
----------------------------------------------------------------

Other related posts:

  • » [wsesug] FW: "Y2k02 Problem" with SAS 9.3 - Mosquera, Tomas (OFM)