Date: Mon, 10 Jun 1996 04:20:33 GMT
Reply-To: "K. Beckman" <102146.2003@COMPUSERVE.COM>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: "K. Beckman" <102146.2003@COMPUSERVE.COM>
Organization: CompuServe Incorporated
Subject: SAS Date Value
I would like to point something about SAS date values:
TWB2%Rates%FAR@GO50.COMP.PGE.COM wrote:
>Paul, SAS stores Julian dates as numbers like 89300 for the 300th day of
>1989. The SAS date value for 89300 is the number of days since 1/1/80, or
>roughly 3600.
"A date in SAS is represented by the number of days between January 1,
1960 and that date"
-- SAS User's Guide: Basics, Version 5 Edition, pp 528
This integer number is what is STORED and when displayed with a
numeric format it doesn't look like a date at all.
> You can display a SAS date value using many different formats:
>DATA _NULL_;
> TODAY='07JUN96'D;
> PUT TODAY 5.0 TODAY MMDDYY8. TODAY JULIAN5.;
>RUN;
This statement is true and this piece of code illustrates the point --
we are displayong the same SAS data value using different formats.
>You can interchange SAS date and SAS Julian date values:
There is no such thing as a "SAS Julian date value!" There is only
the SAS date value stored as described above which then may be
DISPLAYED in any number of date formats, including Julian.
>DATA _NULL_;
> TODAY='07JUN96'D;
> ASJ=JULDATE(TODAY);
> SAMPJUL=96150;
> YEARPART=ROUND(SAMPJUL,1000);
> * ROUND is OK because day portion will never exceed 366;
> DAYPART=MOD(SAMPJUL,1000);
> TODAY=MDY(1,1,YEARPART)+DAYPART-1;
>RUN;
I think this code only serves to confuse the neophyte. We already
have the SAS date variable "TODAY" so if we want to display (write) it
in a julian FORMAT all we need is to use that format (as the author
has already shown above). The functions YEAR and DAY are already
available for extracting day of the month and year from a SAS date
value (if there is some reason to do so) and, along with the TODAY
function are easily confused with the variable names used in the
example.
>Tim Berryhill - Contract Programmer and General Wizard
>TWB2@PGE.COM
>Frequently at Pacific Gas & Electric Co., San Francisco
>The correlation coefficient between their views and
>my postings is slightly less than 0
>----------------------[Reply - Original Message]----------------------
>Sent by:Paul Boon <Pboon@MINERVA.CIS.YALE.EDU>
> Dear SasUsers;
>Is it possible to convert a Julian and a sas date value back to MMDDYY.
I hope this helps.
Sincerely
Kurt D. Beckman
SAS Consultant
553 N. Pacific Coast Hwy, Suite B288
Redondo Beach, California 90277
Voice: 310-318-5291
Fax: 310-318-6220
Cellular: 310-486-4447
E-Mail: 102146.2003@compuserve.com