Hi SAS communities,
I want to add a line in the top of footnotes . i test that code but unfortunately give any thing :
ods rtf text = "^S={outputwidth=100% j=l } { \line------------------------\line } ";
Anyone know how to do it ..
Thanks in advance.
Ods text is not the same as footnotes. A simple solution:
footnote1 "-------------------------------------"; footnote2 "..."; ...
So move your footnotes down 1 and add a line (note you could also use "%sysfunc(repeat(-,30))"; to get a line of 30.
If you need to keep 1 as is, then you would need:
ods escapchar="^"; footnote1 "%sysfunc(repeat(-,30))^{newline}The rest of your footnote here";
The ^{newline} is to break the line at that point (its RTF code).
Another way would be to add a style which adds a border to the top only:
footnote1 s={bordertopwidth=1 bordertopcolor=black} "Your footnote here";
Something like that, am just typing from memory haven't tested.
Ods text is not the same as footnotes. A simple solution:
footnote1 "-------------------------------------"; footnote2 "..."; ...
So move your footnotes down 1 and add a line (note you could also use "%sysfunc(repeat(-,30))"; to get a line of 30.
If you need to keep 1 as is, then you would need:
ods escapchar="^"; footnote1 "%sysfunc(repeat(-,30))^{newline}The rest of your footnote here";
The ^{newline} is to break the line at that point (its RTF code).
Another way would be to add a style which adds a border to the top only:
footnote1 s={bordertopwidth=1 bordertopcolor=black} "Your footnote here";
Something like that, am just typing from memory haven't tested.
Due to an extended lunch I give my 2 cents after the fact. But I didn't want to withhold it. it does not do ODS by the way. I figured, since footnotes are stored in dictionary.titles aka sashelp.vtitle, a macro to add a new footnote and push down all the existing ones would be simple.
Here is my code for your entertainment:
options mprint;
title1 'titel 1';
title3 'titel 3';
footnote1 'footnote 1';
footnote2 'footnote 2';
%macro addfnote(newnote);
proc sql;
select text
into :fn1-:fn9
from dictionary.titles
where type='F'
order by number
;
quit;
%let num_notes=&sqlobs;
%put NOTE: There are &num_notes defined footnotes:;
/* Add the new footnote. */
footnote1 &newnote;
/* Push down all the existing footnotes. */
%do i=1 %to &num_notes;
%let next=%eval(&i + 1);
footnote&next &&fn&i;
%end;
%mend;
%addfnote(New footnote goes here);
proc print data=sashelp.class;
run;
Your approach potentially looses the text of the last footnote (footnote10) by only selecting the first 9. If you actually have a tenth footnote you would want to concatenate the text of 9 and 10 and hopefully insert a line break.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.