BookmarkSubscribeRSS Feed
lbarwick
Quartz | Level 8

I am producing a PDF via ODS LAYOUT and I'm trying to left-justify a footnote following a proc report. I am using in-line formatting to control a URL and text color/underline for the hyperlink. Tried using just=l in my in-line formatting but the footnote is still centered. To add, there is blank space between the end of my regular text and start of the colored/underlined text for the hyperlink.

	options linesize=256;
	ods region x = 0.50 in
		   	   y = 1.75 in
		       width = 8.49 in; 

	proc report data=grpnntceither nowd style={just=l} style(header)=header{background=white};
	column group ptccase1 ptchivstat ptcage1 ptcgen1 ptcndx1;

		define group / display 'Group'
		style(column)={cellwidth=0.75in};

		define ptccase1 / display '# Cases'
		style(column)={cellwidth=0.75in};

		define ptchivstat / display 'HIV status'
		style(column)={cellwidth=1.15in};

		define ptcage1 / display 'Age'
		style(column)={cellwidth=0.55in};

		define ptcgen1 / display 'Gender'
		style(column)={cellwidth=0.65in};

		define ptcndx1 / display 'Neurocognitive Strata'
		style(column)={cellwidth=1.75in};


	column reqnum;
	define reqnum / display noprint;

	compute reqnum;
	      count+1;
	      if mod(count,2) then do;
	         call define(_row_, "style", "style=[background=bwh]");
	      end;
	   endcomp;

	footnote "^{style [justify=l url=&url]Pathology requirements for each group are reported on the request page ^{style [color=blue textdecoration=underline]here}.}";
	run;

lbarwick_0-1600946150584.png

 

4 REPLIES 4
Cynthia_sas
SAS Super FREQ

Hi:
You didn't show your ODS PDF statements. And, your LINESIZE is completely ignored by ODS PDF. But have you tried the simple j=l with the FOOTNOTE statement? Since I didn't have your data, I ran this test with SASHELP.CLASS and the j=l approach worked for me, as shown below:

Cynthia_sas_0-1600968435491.png

Cynthia

lbarwick
Quartz | Level 8

Sorry about that - here is the ods pdf statements. I have tried all various permutations of justify and no matter what the footnote is still centered on the page.

/* Set up PDF output */

options orientation = portrait
papersize = letter
nodate
nonumber
topmargin = .001in
bottommargin = .001in
leftmargin = .001in
rightmargin = .001in
pdfpageview=fitpage;
ods noproctitle; 
ods escapechar = "^"; 
title;
footnote;

%let headerx=0.50;
%let elementx=1.50;
%put _user_;

proc template;
   define style styles.mystyle;
      parent=styles.printer;
      style body from document /
            linkcolor=_undef_;
   end;
run;

options printerpath=PDF;
 
ods _ALL_ close; 

ods pdf file = "&reqdir\NNTC_&reqapp._Request_&reqnum._&invlname..pdf" bookmarkgen=no 
style = styles.mystyle;

*set margins;
ods layout start width=8.49in
height=10.99in;


*header;
ods region height=1in style={background=VLIGB };
 ods text = " ";

ods region y = 0.35 in;
 ods text = "^{style[background=VLIGB foreground=white font_size=16pt font_face='arial' just=c textdecoration=underline font_weight=bold]Investigator Request for Materials}";

ods region x = 0.15 in
		   y = 0.035 in;
 ods text = '^{style[preimage="&preimage"]}';
*end header;

*footer;
ods region x = 0.50 in
		   y = 10.50 in; 
ods text = "^{style[font_face='arial' fontsize=9pt just=left fontstyle=italic]&reqfooter}"; 

ods region x = 0.50 in
		   y = 10.50 in; 
ods text = "^{style[font_face='arial' fontsize=9pt just=center fontstyle=italic]Page  ^{thispage}}"; 
*end footer;

ods region x = 0.50 in
		   y = 1.25 in;
ods text = "^{style[font_face='arial' fontsize=12pt textdecoration=underline font_weight=bold]Group Information}"; 

*Group info table;

%macro grpprint / mindelimiter=',';

	%*if cohort is NNTC or Either, print grpnntceither;
	%if &reqcoh in (NNTC,Either) %then %do;
	options linesize=256;
	ods region x = 0.50 in
		   	   y = 1.75 in
		       width = 8.49 in; 

	proc report data=grpnntceither nowd style={just=l} style(header)=header{background=white};
	column group ptccase1 ptchivstat ptcage1 ptcgen1 ptcndx1;

		define group / display 'Group'
		style(column)={cellwidth=0.75in};

		define ptccase1 / display '# Cases'
		style(column)={cellwidth=0.75in};

		define ptchivstat / display 'HIV status'
		style(column)={cellwidth=1.15in};

		define ptcage1 / display 'Age'
		style(column)={cellwidth=0.55in};

		define ptcgen1 / display 'Gender'
		style(column)={cellwidth=0.65in};

		define ptcndx1 / display 'Neurocognitive Strata'
		style(column)={cellwidth=1.75in};


	column reqnum;
	define reqnum / display noprint;

	compute reqnum;
	      count+1;
	      if mod(count,2) then do;
	         call define(_row_, "style", "style=[background=bwh]");
	      end;
	   endcomp;

	footnote justify=left "^{style [url=&url color=blue textdecoration=underline]Pathology requirements for each group are reported on the request page}";
	run;

	%end;

	%*otherwise if CHARTER, print grpcharter;
	%else %if &reqcoh = CHARTER %then %do;
	options linesize=256;
	ods region x = 0.50 in
		   	   y = 1.75 in
		       width = 8.49 in; 

	proc report data=grpcharter nowd style={just=l} style(header)=header{background=white};
	column group ptccase2 ptcndx2 ptcage2 ptcgen2;

		define group / display 'Group'
		style(column)={cellwidth=0.75in};

		define ptccase2 / display '# Cases'
		style(column)={cellwidth=0.75in};

		define ptcndx2 / display 'Neurocognitive Strata'
		style(column)={cellwidth=1.75in};

		define ptcage2 / display 'Age'
		style(column)={cellwidth=0.75in};

		define ptcgen2 / display 'Gender'
		style(column)={cellwidth=0.75in};

	column reqnum;
	define reqnum / display noprint;

	compute reqnum;
	      count+1;
	      if mod(count,2) then do;
	         call define(_row_, "style", "style=[background=bwh]");
	      end;
	   endcomp;

	run;

	proc report data=grpcharter nowd style={just=l} style(header)=header{background=white};
	column group ptcin2 ptcex2;

		define group / display 'Group'
		style(column)={cellwidth=0.75in};

		define ptcin2 / display 'Inclusion criteria'
		style(column)={cellwidth=3.50in};

		define ptcex2 / display 'Exclusion criteria'
		style(column)={cellwidth=3.50in};

	column reqnum;
	define reqnum / display noprint;

	compute reqnum;
	      count+1;
	      if mod(count,2) then do;
	         call define(_row_, "style", "style=[background=bwh]");
	      end;
	   endcomp;

	run;

	proc report data=grpcharter nowd style={just=l} style(header)=header{background=white};
	column group ptccom2;

		define group / display 'Group'
		style(column)={cellwidth=0.75in};

		define ptccom2 / display 'Comments'
		style(column)={cellwidth=7.00in};

	column reqnum;
	define reqnum / display noprint;

	compute reqnum;
	      count+1;
	      if mod(count,2) then do;
	         call define(_row_, "style", "style=[background=bwh]");
	      end;
	   endcomp;

	run;
	%end;

%mend grpprint;
%grpprint;
ods layout end;
ods pdf close;
Cynthia_sas
SAS Super FREQ

Hi:

  I recommend you start simply and run my test code:

options nodate nonumber;
ods pdf file='c:\temp\testfoot.pdf';
ods region x = 0.50 in
		   	   y = 1.75 in
		       width = 8.49 in; 

proc report data=sashelp.class;
title j=r 'My Title';
title2 j=c 'Centered';
footnote j=l 'My footnote should be left justified';
run;

ods pdf close;

This is what produced my left justified footnote as shown in my screen shot. The above code should also produce a left justified footnote for you.

 

If the footnote is centered when you run my code, then you have a problem and need to open a track with Tech Support. If the footnote is left justified when you run my code, then there's something in your code that is breaking the justification. I would recommend stripping your code down to the bare minimum and introducing steps/statements options gradually to see whether there's ever a point at which you do get a left justified footnote. The first thing I would do is "unmacroize" and "unlayout" your code to make sure that you start from something that has a left justified footnote.

 

For questions about ODS LAYOUT and ODS PDF, you may want to open a track with Tech Support because they can look at ALL of your code and ALL of your data (and at your custom style template) and make some suggestions about how to do what you want. Without data and full code, including the style, nobody can test your code. But with my code, you should be able to produce a left-justified footnote, so it IS possible.

 

Cynthia

ballardw
Super User

Something you might want to consider  Since FOOTNOTE persists as a system option until reset and you have that Footnote appearing conditionally based on your &reqcoh macro variable value you may be seeing a foot from a previous run because I do not see any place you clean up the footnote. 

 

The code you posted does not show the value set for &reqcoh.  So you might be showing a footnote not even related to the code you have shown us.

 

If you only want a footnote to persist for a single procedure call make sure to follow the procedure with a Footnote;

statement to clear the definition.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 4 replies
  • 1619 views
  • 0 likes
  • 3 in conversation