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

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.

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

View solution in original post

3 REPLIES 3
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

jklaverstijn
Rhodochrosite | Level 12

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;

 

ballardw
Super User

@jklaverstijn

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.

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
  • 3 replies
  • 4623 views
  • 4 likes
  • 4 in conversation