Returns a SAS date value from month, day, and year values
Category: Date and Time
MDY ( month,day,year )
month
specifies a numeric expression that represents an integer from 1 through 12.
day
specifies a numeric expression that represents an integer from 1 through 31.
year
specifies a two-digit or four-digit integer that represents the year. The YEARCUTOFF= system option defines the year value for two-digit dates.
SAS Statements | Results |
---|---|
birthday=mdy(8,27,90); | |
put birthday; | 11196 |
put birthday= worddate.; | birthday=August 27, 1990 |
anniversary=mdy(7,11,2001); | |
put anniversary; | 15167 |
put anniversary=date9.; | anniversary=11JUL2001 |
Functions:
'DAY Function' on page 483
'MONTH Function' on page 655
'YEAR Function' on page 914