![]() Chapter Contents |
![]() Previous |
![]() Next |
| DATETIMEw.d |
| Category: | Date and Time |
| Alignment: | right |
| Syntax | |
| Syntax Description | |
| Details | |
| Examples | |
| See Also |
Syntax |
| DATETIMEw.d |
| Default: | 16 |
| Range: | 7-40 |
| Tip: | SAS requires a minimum w value of 16 to write a SAS datetime value with the date, hour, and seconds. Add an additional two places to w to return values with optional decimal fractions of seconds. |
| Requirement: | must be less than w |
| Range: | 0-39 |
Note: If
w-d< 17, SAS truncates the decimal values. ![[cautionend]](../common/images/cautend.gif)
| Details |
The DATETIMEw.d format writes SAS datetime values in the form ddmmmyy:hh:mm:ss.ss, where
| Examples |
The example table uses the input value of 1347453583, which is the SAS datetime value that corresponds to September 12, 2002, at 12:39:43 PM.
| SAS Statements | Results |
|---|---|
----+----1----+----2 |
|
put event datetime.; |
12SEP02:12:39:43 |
put event datetime7.; |
12SEP02 |
put event datetime12.; |
12SEP02:12 |
put event datetime18.; |
12SEP02:12:39:43 |
put event datetime18.1; |
12SEP02:12:39:43.0 |
put event datetime19; |
12SEP2002:12:39:43 |
put event datetime20.1; |
12SEP2002:12:39:43.0 |
put event datetime21.2; |
12SEP2002:12:39:43.00 |
| See Also |
| Formats:
| |||||||
| Function:
| |||||||
| Informats:
|
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.