Hello Experts,
I'm getting the month name applying the function monname : put(datepart(mon_jour),monname.) .
Do you know, please, how to display the month in French ?
Thank you for your help !
options LOCALE=fr_FR;
data _null_;
mon_jour=datetime();
x = put(datepart(mon_jour),NLDATEMN.);
put x=;
run;
options LOCALE=en_US;
options LOCALE=fr_FR;
data _null_;
mon_jour=datetime();
x = put(datepart(mon_jour),NLDATEMN.);
put x=;
run;
options LOCALE=en_US;
options locale=fr_FR;
data fake;
today=today();
want=put(today,NLDATEMN.) ;
run;
Good to know. And NLDATENM does not have MONNAME's nasty habit of right aligning the text.
data months;
do mofy=1 to 12;
date=mdy(mofy,1,2024);
month=put(date,monname.);
month2=put(date,nldatemn.);
output;
end;
format date yymmdd10.;
run;
proc print ;
format _character_ $quote.;
run;
Obs mofy date month month2 1 1 2024-01-01 " January" "January" 2 2 2024-02-01 " February" "February" 3 3 2024-03-01 " March" "March" 4 4 2024-04-01 " April" "April" 5 5 2024-05-01 " May" "May" 6 6 2024-06-01 " June" "June" 7 7 2024-07-01 " July" "July" 8 8 2024-08-01 " August" "August" 9 9 2024-09-01 "September" "September" 10 10 2024-10-01 " October" "October" 11 11 2024-11-01 " November" "November" 12 12 2024-12-01 " December" "December"
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.