BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
yangx
Obsidian | Level 7

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

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;
It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.

View solution in original post

9 REPLIES 9
Reeza
Super User

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.

yangx
Obsidian | Level 7

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

 

 

Reeza
Super User

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.

ChrisHemedinger
Community Manager

+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.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
yangx
Obsidian | Level 7

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

 

yangx
Obsidian | Level 7

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

 

ChrisHemedinger
Community Manager

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.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
ChrisHemedinger
Community Manager

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;
It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
yangx
Obsidian | Level 7

Thanks for your answer. Yes, after I moved the footnote before the proc procedures, the footnote display correctly. Thanks again.

 

Xiumei

 

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
  • 9 replies
  • 2176 views
  • 3 likes
  • 3 in conversation