Hello,
I want the date in the title to be bold. It works using ^S{} but when I open the Excel file there is a missing space between "by" and the date. I tried different things but I can't make it work. Any ideas?
Thanks!
ods excel file="C:\test.xlsx" options(embedded_titles="Yes");
TITLE1 J=L font='Helvetica' height=14pt "Please submit a completed and update your data, by ^S={font_weight=bold} &sysdate." ;
ods escapechar="^";
proc print data=sashelp.bmt;run;
ods excel close;
Hi: Using NBSPACE (both old form and new form) worked for me. I switched the style override for bold to the new form of ESCAPECHAR:
Hope this helps,
Cynthia
What version of SAS are you using?
I'm on 9.4 TS1M5 and when I run your code it mostly works fine.
There's an error opening the excel file because it has the wrong extension - it should be XLSX.
If you're version is earlier than SAS 9.4TS1M3 then ODS EXCEL was still experimental then.
@Jen579 wrote:
Hello,
I want the date in the title to be bold. It works using ^S{} but when I open the Excel file there is a missing space between "by" and the date. I tried different things but I can't make it work. Any ideas?
Thanks!
ods excel file="C:\test.xls" options(embedded_titles="Yes");
TITLE1 J=L font='Helvetica' height=14pt "Please submit a completed and update your data, by ^S={font_weight=bold} &sysdate." ;
ods escapechar="^";
proc print data=sashelp.bmt;run;
ods excel close;
Thanks Reeza. I'm using SAS Enterprise Guide 7.13 HF6.
Do you know if there is any way I can insert a blank space to fix it?
I changed the extension to the file, thanks!
That doesn't tell us your SAS version.
Run the following to see your version.
proc product_status;run;
For Base SAS Software ...
Custom version information: 9.4_M3
Image version information: 9.04.01M3P062415
For SAS/STAT ...
Custom version information: 14.1
For SAS/GRAPH ...
Custom version information: 9.4_M3
For SAS Integration Technologies ...
Custom version information: 9.4_M3
For High Performance Suite ...
Custom version information: 2.2_M4
For SAS/ACCESS Interface to PC Files ...
Custom version information: 9.4_M3
For SAS/ACCESS Interface to ODBC ...
Custom version information: 9.4_M3
For SAS/ACCESS Interface to MySQL ...
Custom version information: 9.4_M3
So you're on an older version that likely has some bugs still.
Maybe try adding an '09'x -> tab or '0A'x which is a line feed and see if you get spaces or returns?
Thank you. I will try that
It's not working. I guess I will give up on changing the style. Thank you
Hi: Using NBSPACE (both old form and new form) worked for me. I switched the style override for bold to the new form of ESCAPECHAR:
Hope this helps,
Cynthia
Thank you Cynthia!
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.