15 years after Y2K, its D20K for SAS

Reply
Frequent Contributor
Posts: 85

15 years after Y2K, its D20K for SAS

Compared with the billions of dollars spent around the world on Y2K projects 15 years ago, the impact of  D20K on the SAS system doesn’t deserve a mention. 

On October 4, 2014, raw SAS date values roll over to 20,000. 


%put Day 20,000: %sysfunc(putn(20000,date9.));

Day 20,000: 04OCT2014

And no doubt it will have been concerning a number of SAS users around the globe.  


SAS Institute have kept very quiet on the subject but I guess that is not surprising – SAS software had no problems with Y2K and nor will it with D20K .  Depending on how sites store dates.

Back at the beginning of April I pointed out to my organisation’s management the importance of ensuring that D20K did not impact our SAS applications.   And since then, we’ve been doing everything necessary to ensure things continue to run smoothly on October 4 and beyond.

                               

It’s ironic though, as it was with Y2K, that all this expenditure of time and money should produce no visible result – just everything continuing as normal. Hopefully all of us involved in D20K projects will be able to report successful outcomes to management, and maybe secure a performance bonus.  Or, at the very least, an appreciation of our efforts.   

Do you have celebrations planned for when the clock passes midnight and ushers in October 4, Day 20,000? Or are you going to be on-call, baby-sitting SAS applications? Or maybe you are one of those who think the world will come to end this time, so doesn’t matter anyway!


:smileymischief:

Occasional Contributor
Posts: 5

Re: 15 years after Y2K, its D20K for SAS

Jerry, I am surprised there has not been more discussion of ths issue. I guess it might be embarrassing for firms to admit they have a D20K problem.

No problems at my place I’m happy to report though. 


Perhaps we should mark the occasion by changing the SAS date formats on variables/output that displays todays date.  Just for the day of course.

Something like…

proc format;

  value d20k

   20000 = _same_

   other = [date9.];



Frequent Contributor
Posts: 85

Re: 15 years after Y2K, its D20K for SAS

I like the idea of “undressing” the SAS date for the day.  Perhaps something subtle with the flyover= style attribute...

ods escapechar='^';

ods html file='/myfolder/todays_class.htm';

title '^{style[flyover="SAS Day 20,000"] Today''s Class}' ;

proc print data=sashelp.class;

run;

ods html close;


Occasional Contributor
Posts: 15

Re: 15 years after Y2K, its D20K for SAS

Sorry both, I'm a newbie.. a little more explanation on this date issue will be of great help..

New Contributor
Posts: 2

Re: 15 years after Y2K, its D20K for SAS

SAS dates are stored as a sequential number starting with January 1, 1960 having a SAS date of 1.  October 4, 2014 is 19,999 days after January 1, 1960 - thus the SAS date for October 4, 2014 is 20,000.

New User
Posts: 1

Re: 15 years after Y2K, its D20K for SAS

JohnForster wrote:

SAS dates are stored as a sequential number starting with January 1, 1960 having a SAS date of 1.  October 4, 2014 is 19,999 days after January 1, 1960 - thus the SAS date for October 4, 2014 is 20,000.

Understood.  But why is this a problem?  SAS doesn't reconcile 20,001?

Keith

Also a Newbie

Valued Guide
Posts: 2,111

Re: 15 years after Y2K, its D20K for SAS

Sarath & Keith,

This is really a non-issue.  20,000 AD is not the same as day 20,000.  SAS has plenty of precision to store dates in length=4 (  SAS(R) 9.2 Companion for Windows, Second Edition ).

Doc Muhlbaier

Duke

Contributor
Posts: 30

Re: 15 years after Y2K, its D20K for SAS

Sarath and Keith: Jerry is kidding. As noted above, SAS stores dates as binary numeric variables, so there's nothing special about date 20,000 or even 10,000. The joke is that management would be paying programmers lots of money to fix a problem that doesn't exist (note that "early in April" i.e. April Fool's Day).

(Apologies if anybody feels I've spoiled the joke by explaining it - I enjoyed it, but I'm also mindful that we have people here who are less familiar with traditions like April Fool's Day, and I wouldn't want anybody losing sleep over this!)

Frequent Contributor
Posts: 85

Re: 15 years after Y2K, its D20K for SAS

Thanks Geoffrey.  The choice of the "mischief" emoticon in the original post was also deliberate.

I'm glad to see though, that the post has stimulated some serious discussion of future, if not immediate, date issues.

Seems cryonic preservation of SAS programmers, as well as COBOL programmers, could be a good idea.  And profitable.  Any recommendations for reputable organisations?

Grand Advisor
Posts: 10,210

Re: 15 years after Y2K, its D20K for SAS

When working with data around the time of the Y2K scare I kept getting questions from management about the dates I was storing. So I build a quick SAS program to simulate reading dates. It stopped getting valid results from the MDY function in year 20,000 AD. They stopped asking when I said the dates were good through 19,999.

I suspect that may be because 20000 is another exception to the leap year rules. Many people never got that was the issue behind much of Y2K date issues. Years with multiples of 100 are not leap years unless they are also multiples of 400 (i.e. 2000).

I try to assign SAS date values to anything that comes close, even just Month/Year combinations for the consistency and manipulation tools available instead of constantly having to write my own to deal with odd date layouts.

Community Manager
Posts: 2,693

Re: 15 years after Y2K, its D20K for SAS

Glad to know that some of you are planning ahead to the Year 20000! And seems like we just finished thinking about the year 9999:

In the year 9999... - The SAS Dummy

Chris

Esteemed Advisor
Posts: 7,293

Re: 15 years after Y2K, its D20K for SAS

Chris: Nice blog article. However, it got me wondering whether the macro (exportxl) that , and I wrote will still work with year 20000+ dates, as I highly doubt that I will still be around to support it.

I just posted the latest version of the macro (A Poor/Rich SAS Users Proc Export - sasCommunity) which now includes the ability to either use or not use declared formats. The macro:

only requires base SAS

runs 35 times faster than ODS methods

extremely simple to code

creates an Excel file that opens more quickly than any other method

provides capabilities not available with other methods

* copying datasets to your clipboard

* including a row of either variable names or labels

* ability to apply or disregard a dataset's formats

* using Excel templates

* ability to modify existing worksheets

* using ranges without have to predefine them

* point and click compatible

* no 32/64 bit compatibility issues

* year 20000+ compatible (at least it passed our one test)

For test data, I used the following:

proc format;

  value $gender

  'F'='Female'

  'M'='Male'

  ;

  value agegroups

  10-12='Younger'

  13-15='Average'

  16-20='Older'

  ;

run;

data test;

  set sashelp.class;

  format sex $gender.;

  format age agegroups.;

  format date worddate19.;

  label sex='Gender';

  label age='Age Group';

  if _n_ eq 6 then date="28FEB4000"d+1;

  else if _n_ eq 7 then date="28FEB20000"d+1;

  else if _n_ eq 11 then date="31DEC9999"d;

  else if _n_ eq 18 then date="31DEC19999"d;

  else date="25SEP2014"d;

run;

I then ran:

%exportxl(data=test,outfile=c:\class.xlsx,useformats=Y,usenames=L)

which produced:

Name      Gender  Age Group   height   weight        date

Alfred    Male    Average     69      112.5  September 25, 2014

Alice     Female  Average     56.5     84    September 25, 2014

Barbara   Female  Average     65.3     98    September 25, 2014

Carol     Female  Average     62.8    102.5  September 25, 2014

Henry     Male    Average     63.5    102.5  September 25, 2014

James     Male    Younger     57.3     83    March 1, 4000

Jane      Female  Younger     59.8     84.5  March 1, 20000

Janet     Female  Average     62.5    112.5  September 25, 2014

Jeffrey   Male    Average     62.5     84    September 25, 2014

John      Male    Younger     59       99.5  September 25, 2014

Joyce     Female  Younger     51.3     50.5  December 31, 9999

Judy      Female  Average     64.3     90    September 25, 2014

Louise    Female  Younger     56.3     77    September 25, 2014

Mary      Female  Average     66.5    112    September 25, 2014

Philip    Male    Older       72      150    September 25, 2014

Robert    Male    Younger     64.8    128    September 25, 2014

Ronald    Male    Average     67      133    September 25, 2014

Thomas    Male    Younger     57.5     85    December 31, 19999

William   Male    Average     66.5    112    September 25, 2014


Occasional Contributor tlt
Occasional Contributor
Posts: 11

Re: 15 years after Y2K, its D20K for SAS

Dear all,

I'm really relieved, though a little sad, to see in Arthur's trace that Thomas will be still in our class on December 31, 19999;-)))

On my site, we rely heavily on Oracle (with SAS Access, of course)

And I think I'm the only one worrying about how things would go the day after December 31, 9999 AD ???

Hopefully, I would be retired by then.

Square 2 the yound people, as we said in French

Cheers.

Esteemed Advisor
Posts: 7,293

Re: 15 years after Y2K, its D20K for SAS

Since I was only able to report first names, I'd think that a small town one-room school has a good chance of having students with the same first names 2 or 3 times over an 18,000 year period.

Second, based on Chris's blog, you may have a problem with February 28, 4000 + 1. SAS apparently has adopted the 4000 rule proposal but, since it hasn't been officially adopted, Oracle and Microsoft have not adopted it.

Occasional Contributor tlt
Occasional Contributor
Posts: 11

Re: 15 years after Y2K, its D20K for SAS

Dear all,

Forward to the past ...

Let's say that as a rule of thumb, it is decided that, aside of missing date, every "suspicious" date in your databases will be forced to January 1rst of year 0001.This may happen if your site rely heavily on Oracle databases.

And in the case of a decease date, where still alive people have missing decease date.

What should SAS users do ? .D

Better off watching Ellen deGeneres sending her staff to the Walking Dead maze.

Have fun .

PS  Dear Chris, I've missed your in the year 9999 article. What a shame. Also missed Zager & Evans.

Ask a Question
Discussion stats
  • 20 replies
  • 1458 views
  • 1 like
  • 11 in conversation