Is there a way to format date in the abbreviated month-year format that will work in English and French? I am creating a bilingual English-French report with tables and graphs. I have to show the date in mmmyy format. I can get this using the format monyy. This works in English, so for French I used the fr-CA locale. I specified the NLDATEYM format which is equivalent to monyy according to the SAS manual. I need to keep the date field as numeric so it displays properly on a graph axis. However, NLDATEYM does not give the abbreviated month name (as shown in the second table). Therefore I created a new variable (newdate) using the NLDATE function as in the dataset new in the code attached. Unfortunately it creates a character value that does not really work in the graph. I am using SAS 9.4 (release 3) option missing='-' locale='en_US';
data stocks;
set sashelp.stocks (where=(year(date)=2005));
run;
proc sort;
by descending stock date;
run;
proc report nowd;
Title "locale='en_US'";
format date monyy.;
column stock close,date;
define stock/group order=data;
define close/analysis ' ' ;
define date/across ' ' order=data;
run;
option locale='fr_CA';
proc report nowd;
Title "locale='fr_CA'";
format date NLDATEYM.;
column stock close,date;
define stock/group order=data;
define close/analysis ' ' ;
define date/across ' ' order=data;
run;
data new;
set stocks;
newdate=nldate(date,'%b%y');
run;
proc report nowd;
Title "locale='fr_CA' with newdate=nldate(date,'%b%y')";
column stock close,newdate;
define stock/group order=data;
define close/analysis ' ' ;
define newdate/across ' ' order=data;
run;
title '';
proc sgplot data=new(where=(stock='IBM')) noborder;
vbar newdate / response=close
group=stock;
xaxis display=(nolabel noline noticks);
yaxis display=(noline noticks) grid;
run;
Any help to solve this issue will be greatly appreciated. Thanks
... View more