Date Intervals, Formats, and Functions |
Table 4.2 lists some of the SAS date and datetime informats available in SAS to read date, time, and datetime values. See Chapter 3, Working with Time Series Data, for a discussion of the use of date and datetime informats. See SAS Language Reference: Concepts for a complete description of these informats.
For each informat, Table 4.2 shows an example of a date or datetime value written in the style that the informat is designed to read. The date 17 October 1991 and the time 2:25:32 p.m. are used for the example in all cases. Table 4.2 shows the width range allowed by the informat and the default width.
Informat |
Width |
Default |
|
Example |
Description |
Range |
Width |
DATEw. |
day, month abbreviation, and year: |
7–32 |
7 |
17oct91 |
ddmonyy |
||
DATETIMEw.d |
date and time: ddmonyy:hh:mm:ss |
13–40 |
18 |
17oct91:14:45:32 |
|||
DDMMYYw. |
day, month, year: ddmmyy, dd/mm/yy, |
6–32 |
6 |
17/10/91 |
dd-mm-yy, or dd mm yy |
||
JULIANw. |
year and day of year (Julian dates): yyddd |
5–32 |
5 |
91290 |
|||
MMDDYYw. |
month, day, year: mmddyy, mm/dd/yy, |
6–32 |
6 |
10/17/91 |
mm-dd-yy, or mm dd yy |
||
MONYYw. |
month abbreviation and year |
5–32 |
5 |
Oct91 |
|||
NENGOw. |
Japanese Nengo notation |
7–32 |
10 |
H.03/10/17 |
|||
TIMEw.d |
hours, minutes, seconds: hh:mm:ss |
5–32 |
8 |
14:45:32 |
or hours, minutes: hh:mm. |
||
WEEKVw. |
ISO 8601 year, week, day of week: yyyy-Www-dd |
3–200 |
11 |
1991-W42-04 |
|||
YYMMDDw. |
year, month, day: yymmdd, yy/mm/dd, |
6–32 |
6 |
91/10/17 |
yy-mm-dd, or yy mm dd |
||
YYQw. |
year and quarter of year: yyQq |
4–32 |
4 |
91Q4 |
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.