MDY Function

Returns a SAS date value from month, day, and year values.

Category: Date and Time
Returned data type: DOUBLE

Syntax

MDY(month, day, year)

Arguments

month

specifies a numeric expression that represents an integer from 1 through 12.

Data type DOUBLE
See <sql-expression>
FedSQL Expressions

day

specifies a numeric expression that represents an integer from 1 through 31.

Data type DOUBLE
See <sql-expression>
FedSQL Expressions

year

specifies a numeric expression that represents a two-digit or four-digit year. The YEARCUTOFF= system option defines the year value for two-digit dates.

Data type DOUBLE
See <sql-expression>
FedSQL Expressions

Example

The following statements illustrate the MDY function:
Statements
Results
select put(mdy(8,27,12),date7.);
27AUG12
select put(mdy(8,27,90),date7.);
27AUG90
Last updated: February 23, 2017