WEEKDAY Function

From a SAS date value, returns an integer that corresponds to the day of the week.

Category: Date and Time

Syntax

WEEKDAY(date)

Required Argument

date

specifies a SAS expression that represents a SAS date value.

Details

The WEEKDAY function produces an integer that represents the day of the week, where 1=Sunday, 2=Monday, ..., 7=Saturday.

Example

The following SAS statements produce this result.
SAS Statement
Result
x=weekday('16mar97'd);
put x;
 
1