I'm sure that there are more technically correct ways to do this, but one really easy solution is to append an invisible character onto the date. You can type invisible characters into the program editor by turning on Num Lock, holding down the Alt key, typing the number 255, then releasing the Alt key. Try running the following program. Note that you will need to recreate the invisible character in your SAS session before you submit the program. Both dates look the same the first time Excel is opened. If you make a change, save, and reopen excel, however, the value for date1 changes and the value for date2 does not. Hope this helps.
[pre]
data temp;
date1 = '01may2009'd;
date2 = cats(substr(propcase(put(date1, monyy5.)), 1, 3),'-',substr(put(date1, monyy5.),4,2), ' '); /*The last argument is an invisible character created with Alt+255*/
format date1 monyy7.;
run;
ods listing close;
ods html file='C:\temp.xls';
proc print data=temp;
run;
ods html close;
[/pre]
... View more