Formats are purely a presentation layer. They are not used internally at all
with respect to the data values.
You could argue that the EDITOR should warn you if you do something stupid
but I am not a fan of SAS's editor. However, the language itself is not the
culprit here. The language only knows numeric and string. It doesn't care
about the format at all except for display.
Savian "Bridging SAS and Microsoft Technologies"
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Audimar
Sent: Friday, June 22, 2007 5:14 AM
Subject: Re: DATETIME conversion by SAS 9
> NO NO NO - there is NO conversion
That's basically my point. :-) SAS doesn't have a true datetime type similar
to C#'s System.DateTime type, so it cannot do a realistic custom date
formatting in cases where the time unit changes with the format (as in DATE
to DATETIME, or the other way around). Because there is no internal
conversion of the underlying data, a user like me finds it unrealistic to
see the weird date format conversions inside the SAS data editor or table
> It is the same with SAS defined formats, there is nothing to stop you
> attaching DOLLAR15. to variables for date or datetime.
Which is a poor design or editing environment, in my opinion. The SAS data
editor should not show formats not appropriate for a date when the
column/variable being edited has a TIME/DATETIME format! Who would change a
date variable to a DOLLAR or currency variable???
> An application (that e.g. you have written) can "understand" the metadata
> embodied in formats but the SAS compiler can not.
That's not true, otherwise it can't do even the most basic format
transformation. When it comes to dates, SAS does a "dumb" format
transformation because it doesn't recognize any unit changes that comes with