Hello,
I am using the latest ExcelXP tagset (v1.131, 04/23/2015) to generate a multi-sheet workbook. Each worksheet has multiple proc statements (e.g. proc report).
I would like to have a footnote at the end of each worksheet (i.e. last proc) and not after each proc in the same worksheet.
I have one footnote statement for each worksheet which is defined before the procs.
In SAS 9.1, the footnote appears at the end of each worksheet (i.e. after the last proc statement output) as follows:
title
table for value1
title
table for value 2
footnote
In SAS 9.4, however, the footnote appears multiple times in each worksheet, i.e. after each proc statement and not only at the end of the worksheet as follows:
title
table for value1
footnote
title
table for value 2
footnote
Is there a way to have the footnote at the end of each worksheet (i.e. last proc) in SAS 9.4 as in SAS 9.1?
Thank you
Set the FOOTNOTE when you need it:
%do k = 1 %to &nprocs.;
%let dsoutvar=%scan(&&dsout_vars,&k,,s);
%if &k. = &nprocs. %then footnote "footnotetext";
proc report data = data_&dsoutvar.;
run;
%end;
footnote;
@eleftheria10 wrote:
Hello,
I am using the latest ExcelXP tagset (v1.131, 04/23/2015) to generate a multi-sheet workbook. Each worksheet has multiple proc statements (e.g. proc report).
I would like to have a footnote at the end of each worksheet (i.e. last proc) and not after each proc in the same worksheet.
I have one footnote statement for each worksheet which is defined before the procs.
In SAS 9.1, the footnote appears at the end of each worksheet (i.e. after the last proc statement output) as follows:
title
table for value1
title
table for value 2
footnote
In SAS 9.4, however, the footnote appears multiple times in each worksheet, i.e. after each proc statement and not only at the end of the worksheet as follows:
title
table for value1
footnotetitle
table for value 2
footnote
Is there a way to have the footnote at the end of each worksheet (i.e. last proc) in SAS 9.4 as in SAS 9.1?
Thank you
Without seeing your code is suspect there is a difference between what you ran in SAS 9.1 and 9.4 to get different behavior of Footnote code.
Footnote and Title will create output for each proc until change or canceled. It has been that way for more than 30 years.
You stop a Footnote, or Title, from continuing to output for other procedures by clearing them with a
footnote;
after you no longer want it.
Dummy code:
Title1 "something"; Footnote1 "some footnote"; Proc whatever; run; footnote; Proc otherproc; run;
Will have the title repeat for each procedure because it was not cleared and the footnote will only occur once.
Where the footnote text may be an issue depending on destination options and file format.
Hello,
Thank you for your response.
I am using the same code in 9.1 and 9.4 but the output is different.
With the dummy code you provided, a footnote would appear after the first proc and no footnote in the second proc etc.
I do many procs in the same worksheet which are defined by a macro variable as follows:
For example:
%do k = 1 %to &nprocs.;
%let dsoutvar=%scan(&&dsout_vars,&k,,s);
Proc report data = data_&dsoutvar.;
run;
%end;
I want the footnote to appear only for the last proc.
For example, if nprocs = 10, I would like the footnote to appear only after the 10th proc report ( (i.e. at the end of the worksheet).
Thank you.
Set the FOOTNOTE when you need it:
%do k = 1 %to &nprocs.;
%let dsoutvar=%scan(&&dsout_vars,&k,,s);
%if &k. = &nprocs. %then footnote "footnotetext";
proc report data = data_&dsoutvar.;
run;
%end;
footnote;
The original behavior of the footnotes as you describe it for 9.1 may have been a different view on what constitutes a "page". With ODS, each different procedure creates a "page" (with destinations where there is no defined page size, like HTML).
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.