BookmarkSubscribeRSS Feed
sthomasw44
Calcite | Level 5

I am using base SAS 9.3 and have a dataset that I need to export to excel (xlsx extension because rows are > 65k).  I want to include a footer on the exel output.  Please advise how to add a footer to a xlsx file. 

 

4 REPLIES 4
PBsas
Obsidian | Level 7

I don't believe you would be able to add footnote with proc export.

I recommend using ODS with footnote.

sthomasw44
Calcite | Level 5

I am pretty new to SAS ods so could you walk me through it so I can add footer to my final xlsx output? 

PBsas
Obsidian | Level 7

Hi,

Since you are using 9.3 version of the SAS, you won't be able to use ODS excel to create .xlsx file. You can create .xls file using ODS tagsets.excelXP with a footnote.

ods _all_ close;
ods tagsets.excelxp path = "path_here"  file = "file_name.xls" style = XLsansPrinter 


	options(embedded_footnotes = "yes");
footnote "Your footnote here";

proc print data=dataset_name noobs;
run;

ods tagsets.excelxp close;
RW9
Diamond | Level 26 RW9
Diamond | Level 26

You can put footnotes in, using footnote statement, however they will only appear in print preview in Excel - that is Excel functionality not SAS!  If you want it in the grid - which is not Excel method - then add another row or two to your dataset, with the footnote you want, e.g.

data want;

  set have;

  col1=" ";

  col2="A footnote";

run;

 

(Col2 being the first variable in your dataset - assumed its called this, and that it is character).

It will then get printed per the data.  Excel itself doesn't have titles/footnotes in the same way as RTF or PDF.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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