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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 2544 views
  • 0 likes
  • 3 in conversation