Chapter Contents

Previous

Next
DATETIMEw.d

DATETIMEw.d



Writes datetime values in the form ddmmmyy:hh:mm:ss.ss

Category: Date and Time
Alignment: right


Syntax
Syntax Description
Details
Examples
See Also

Syntax

DATETIMEw.d

Syntax Description

w
specifies the width of the output field.
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.

d
optionally specifies the number of digits to the right of the decimal point in the seconds value.
Requirement: must be less than w
Range: 0-39

Note:   If w-d< 17, SAS truncates the decimal values.  [cautionend]


Details

The DATETIMEw.d format writes SAS datetime values in the form ddmmmyy:hh:mm:ss.ss, where

dd
is an integer that represents the day of the month.

mmm
is the first three letters of the month name.

yy
is a two-digit integer that represents the year.

hh
is an integer that represents the hour.

mm
is an integer that represents the minutes.

ss.ss
is the number of seconds to two decimal places.


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:

DATEw.
TIMEw.d

Function:

DATETIME

Informats:

DATEw.
DATETIMEw.
TIMEw.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.