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

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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