BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
rhapsody
Calcite | Level 5

I have the following code

 

 

%let date=31MAR2019;

data _null_;
date_var="&date."d;
format date_var date9.;
month_name=put(date_var, monname.);
call symputx('month_name',month_name);
run;
%put &month_name;

 

 

This generates the the month name March. But I want the month name in Swedish, which is Mars

 

Anyone knows how to do this?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

SAS provides NLS-capable format equivalents for the standard formats:

%let date=31MAR2019;
options locale=sv_SE;
data _null_;
date_var="&date."d;
format date_var date9.;
month_name=put(date_var, nldatemn10.);
call symputx('month_name',month_name);
run;
%put &month_name;

Log excerpt:

35         %put &month_name;
mars

Documentation (Maxim 1!) is found at

documentation.sas.com

SAS® 9.4 and SAS® Viya® 3.4 Programming Documentation

National Language Support (NLS)

Formats for NLS

View solution in original post

2 REPLIES 2
SASKiwi
PROC Star

This link for the EURDFMNw. format should help: https://documentation.sas.com/?docsetId=nlsref&docsetTarget=p145pxsliwoaogn146kcyceye2q2.htm&docsetV...

 

The documentation suggests swapping out the first 3 letters for the language you want namely: SWEDFMNw.

 

 

Kurt_Bremser
Super User

SAS provides NLS-capable format equivalents for the standard formats:

%let date=31MAR2019;
options locale=sv_SE;
data _null_;
date_var="&date."d;
format date_var date9.;
month_name=put(date_var, nldatemn10.);
call symputx('month_name',month_name);
run;
%put &month_name;

Log excerpt:

35         %put &month_name;
mars

Documentation (Maxim 1!) is found at

documentation.sas.com

SAS® 9.4 and SAS® Viya® 3.4 Programming Documentation

National Language Support (NLS)

Formats for NLS

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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
  • 2 replies
  • 1081 views
  • 0 likes
  • 3 in conversation