BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
SASdevAnneMarie
Barite | Level 11

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
Amethyst | Level 16
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
Amethyst | Level 16
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"

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1395 views
  • 7 likes
  • 4 in conversation