SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.

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 !

1 ACCEPTED SOLUTION

Accepted Solutions
yabwon
Onyx | Level 15
options LOCALE=fr_FR;
data _null_;
mon_jour=datetime();
x = put(datepart(mon_jour),NLDATEMN.);
put x=;
run;
options LOCALE=en_US;
_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



View solution in original post

4 REPLIES 4
yabwon
Onyx | Level 15
options LOCALE=fr_FR;
data _null_;
mon_jour=datetime();
x = put(datepart(mon_jour),NLDATEMN.);
put x=;
run;
options LOCALE=en_US;
_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



SASdevAnneMarie
Barite | Level 11
Thank you, Yabwon!
PaigeMiller
Diamond | Level 26
options locale=fr_FR;
data fake;
   today=today();
   want=put(today,NLDATEMN.) ;
run;
--
Paige Miller
Tom
Super User Tom
Super User

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"

sas-innovate-white.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Early bird rate extended! Save $200 when you sign up by March 31.

Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 912 views
  • 7 likes
  • 4 in conversation