When I run the following code, it works fine:
However, when I format the month using MONNAME like so, it thinks that all of the dates are in January, which is incorrect:
What am I misunderstanding?
Code:
libname learn 'C:\books\learning';
data frequency;
set learn.hosp;
DayOfTheWeek = weekday(AdmitDate);
monthOfTheYear = month(AdmitDate) ;
year = year(AdmitDate);
run;
proc freq data=frequency;
tables DayOfTheWeek monthOfTheYear year;
format DayOfTheWeek DOWNAME9. ;
run;
Code:
libname learn 'C:\books\learning';
data frequency;
set learn.hosp;
DayOfTheWeek = weekday(AdmitDate);
monthOfTheYear = month(AdmitDate) ;
year = year(AdmitDate);
run;
proc freq data=frequency;
tables DayOfTheWeek monthOfTheYear year;
format DayOfTheWeek DOWNAME9. [COLOR=red]monthOfTheYear MONNAME9.[/color];
run;
What am I misunderstanding?