Dear Sir or Madam,
I encountered a problem when I used excelXP to create multiple worksheets excel files. I need to have footnote for the first two pages, no footnote for the third page. But no footnote on the first page (I have footnote statement in the first sheet), footnote appeared on the second and third page, even though I removed footnote statement on the third page and removed the options "embedded_footnote=yes". I am not sure why program worked this way.
Thanks a lot.
Xiumei
I saw you did attach a program, and it's as I thought: FOOTNOTE statements came after the PROCs, not before. Here's a fixed version:
ods listing close;
ods excel file="/home/xiumei/SAS_example/firstpage.xlsx" style=printer;
ods excel options(embedded_titles="yes" embedded_footnotes="yes" sheet_name="first page");
title1 "Try footnote";
title2 "as of &sysdate.";
footnote1 justify=left "the first footnote on page 1";
footnote2 justify=left "the second footnote on page 1";
proc report data=sashelp.adsmsg nowd split='%';
run;
ods excel options(embedded_titles="yes" embedded_footnotes="yes" sheet_name="second page");
title1 "Try footnote";
title2 "as of &sysdate.";
footnote1 justify=left "the first footnote on page 2";
footnote2 justify=left "the second footnote on page2 ";
proc report data=sashelp.air nowd split='%';
run;
ods excel options(embedded_titles="yes" sheet_name="third page");
title1 "Try footnote";
title2 "as of &sysdate.";
footnote; /* clear footnote */
proc report data=sashelp.bei nowd split='%';
run;
ods excel close;
1. What version of tagsets are you using? Check log after runnint tagsets to see the version number.
2. Can you post some code so we can replicate your issue, using data from SASHELP so we can run it as well.
Hello,
Thanks for your reply. the version is "This is the Excel XP tagset (Compatible with SAS 9.1.3 and above, v1.127, 09/26/2011)"
Please see the attached program.
Thanks.
Xiumei
The latest version is 1.131
You can download it here and then give it a try again.
https://support.sas.com/rnd/base/ods/odsmarkup/index.html
If you're on SAS 9.4 then you can also consider ODS EXCEL.
+1 for ODS Excel. It's superior to ODS tagsets.excelXP in most respects, especially in that it creates a true native XLSX file. Most excelXP options are supported, so it usually doesn't need a ton of work to modify your code.
Documentation here: ODS EXCEL Statement.
Thanks for your reply. I do use ods excel for my programs, but this didn't resolve the footnote problem. Instead of using ExcelXP, I used ods excel in my program, the probem still exists. thanks.
xiumei
Hello,
That means the footnote problem is not resolved in ods tagsets ExcelXP version 1.127. I don't know how to install the version 1.13.
I tried to use ods excel instead of ods tagsets ExcelXP, but problem is the same. thanks.
xiumei
Be sure to check the positioning of your FOOTNOTE statement. As a global statement it gets processed first, and then the footnote is rendered as part of the next procedure output that you run.
In short, make sure FOOTNOTE appears before the PROC that generates the output you want, not after.
I saw you did attach a program, and it's as I thought: FOOTNOTE statements came after the PROCs, not before. Here's a fixed version:
ods listing close;
ods excel file="/home/xiumei/SAS_example/firstpage.xlsx" style=printer;
ods excel options(embedded_titles="yes" embedded_footnotes="yes" sheet_name="first page");
title1 "Try footnote";
title2 "as of &sysdate.";
footnote1 justify=left "the first footnote on page 1";
footnote2 justify=left "the second footnote on page 1";
proc report data=sashelp.adsmsg nowd split='%';
run;
ods excel options(embedded_titles="yes" embedded_footnotes="yes" sheet_name="second page");
title1 "Try footnote";
title2 "as of &sysdate.";
footnote1 justify=left "the first footnote on page 2";
footnote2 justify=left "the second footnote on page2 ";
proc report data=sashelp.air nowd split='%';
run;
ods excel options(embedded_titles="yes" sheet_name="third page");
title1 "Try footnote";
title2 "as of &sysdate.";
footnote; /* clear footnote */
proc report data=sashelp.bei nowd split='%';
run;
ods excel close;
Thanks for your answer. Yes, after I moved the footnote before the proc procedures, the footnote display correctly. Thanks again.
Xiumei
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: