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

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;

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
Diamond | Level 26

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:

use_nbspace.png

 

Hope this helps,

Cynthia

View solution in original post

9 REPLIES 9
Reeza
Super User

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;


 

Jen579
Fluorite | Level 6

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!

Reeza
Super User

That doesn't tell us your SAS version.

 

Run the following to see your version. 

 

proc product_status;run;
Jen579
Fluorite | Level 6

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

Reeza
Super User

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?

Jen579
Fluorite | Level 6

It's not working. I guess I will give up on changing the style. Thank you

Cynthia_sas
Diamond | Level 26

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:

use_nbspace.png

 

Hope this helps,

Cynthia

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
  • 9 replies
  • 2744 views
  • 4 likes
  • 3 in conversation