DTWKDATXw. Format

Writes the date part of a SAS datetime value as the day of the week and the date in the form day-of-week, dd month-name yy (or yyyy).

Category: Date and Time
Alignment: Right

Syntax

DTWKDATXw.

Arguments

w

specifies the width of the output field.

Default 29
Range 3–37

Details

The DTWKDATXw. format writes SAS date values in the form day-of-week, dd month-name, yy or yyyy, where
day-of-week
is either the first three letters of the day name or the entire day name.
dd
is an integer that represents the day of the month.
month-name
is either the first three letters of the month name or the entire month name.
yy or yyyy
is a two-digit or four-digit integer that represents the year.

Comparisons

The DTWKDATXw. format is similar to the WEEKDATXw. format in that they both write date values. The difference is that DTWKDATXw. expects a SAS datetime value as input, and WEEKDATXw. expects a SAS date value.

Example

The example table uses as input the value 1678898894, which is the SAS datetime value that corresponds to March 14, 2013, at 04:48:14 PM.
Statements
Results
----+----1----+----2----+----3
select put(1678898894,dtwkdatx.);
  Saturday, 14 March 2013
select put(1678898894,dtwkdatx3.);
Sat
select put(1678898894,dtwkdatx8.);
     Sat
select put(1678898894,dtwkdatx25.);
    Saturday, 14 Mar 2013
Last updated: February 23, 2017