|Date: ||Tue, 31 Dec 2002 11:38:47 -0500|
|Reply-To: ||"Wolf, Matt" <wolf.m@EI.COM>|
|Sender: ||"SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>|
|From: ||"Wolf, Matt" <wolf.m@EI.COM>|
|Subject: ||Re: Create a date column|
Thanks for that rather detailed explanation. Actually, I'm new to SAS, but
not to computer dates. Part of the problem I've having with SAS is that I'm
used to using Excel and I keep trying to program SAS to manipulate data as I
would do it in Excel. That leads to some rather inelegant and inefficient
code. Thanks for your help.
From: Biff Canlett [mailto:Biff@CANLETT.COM]
Sent: Monday, December 30, 2002 10:38 PM
Subject: Re: Create a date column
You had some real heavy weights chime in on your question, but I wonder if
you understand SAS dates. If not, you are going to be really confused if
you try to output these newly created dates.
If you already know this, please forgive me. SAS "dates", aren't.
Acutually, SAS dates are stored as the number of days that have elapsed
since a fixed point on the calendar. If you try to print a SAS date
directly, without formatting, it will look very strange. BTW, this concept
is also used in Excel, DB2 dBase and lots of other environments I'm sure.
To print or output a SAS date in a meaningful manner, you must associate a
format with it. The great advantage of this is that you can select what the
date will look like by which format you choose. In older legacy systems you
might need to resort to a complicated subroutine to change a date from
yymmdd format to mmddyy. In SAS you only need to associate a new format.
There are many other advantages to serialized dates, and I recommend you
spend some time reading if you are not familiar. At least now you will know
"what's up" if you date looks like 14,237 .