BookmarkSubscribeRSS Feed
BEANIE_SIGH
Calcite | Level 5

I am very beginner at sas. I made a table in sas using proc sql. 

 

Then I exported to excel with this code which I was told should put a title on the table. However, while it printed onto the excel, theres no title at the top. Not sure what else I can do. 

 

ods excel file="C:\Users\Name\Documents\EPI 612\Lab1Table1Excel.xlsx"

     options (sheet_name="Rates");

     title "Rates for 2025";

     proc print data=final_rates_tab noobs label;

run;

ods excel close;

 

2 REPLIES 2
Quentin
Super User

Check the header of the file.  By default the title is not written to a cell in the spreadsheet, instead it is written to the header.

 

I think in Excel you can still do Page Setup to see the headers.

Kathryn_SAS
SAS Employee

With the ODS EXCEL destination, you need to use the EMBEDDED_TITLES= suboption as shown below:

ods excel file="C:\Users\Name\Documents\EPI 612\Lab1Table1Excel.xlsx"
     options (sheet_name="Rates" embedded_titles='yes');

The documentation shows the other suboptions that are useful:

ODS EXCEL Options 

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