BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
kmin87
Fluorite | Level 6
ods excel file="\\desktop\sample.xlsx"
style=meadow options(embedded_titles="yes" sheet_interval="none" frozen_headers = '3' sheet_name="Data" EMBEDDED_FOOTNOTES='ON' ABSOLUTE_ROW_HEIGHT=",,,30,30,");
options nobyline;

			proc print data=work.comparison  noobs label;
			var asc /  style(column)={tagattr='format:@' just=c}; 
			var diff1 diff2 diff3  / style={just=c};
			var;

			TITLE1 color=green BOLD "Title";
			FOOTNOTE1 color=black height=1.5 "Prepared by John Smith on &sysdate9.";
			FOOTNOTE2 color=black height=1.5 "Controlled by: Organization";
			FOOTNOTE3 color=black height=1.5 "POC: john.smith@yah.com";
			FOOTNOTE4 color=green BOLD "Title";
			run;
			ods excel close;

There are additional code above to create the work.comparison data but the focus is in the code above to generate the data table in the excel file, sample.xlsx. Sometimes there may be more rows of data rather than one but for this caser there is one row, row 4 in excel file. For the footnotes, how do I create a space between the table from proc print and footnote. and how do I remove the border lines from the footnotes of rows 5-7. And how do I make the font smaller than the table font size or make the table font size bigger?

1 ACCEPTED SOLUTION

Accepted Solutions
SASJedi
SAS Super FREQ

1. Make your FOOTNOTE1 a blank line to give space between the table and footnotes.

2. Control the point size of the FOOTNOTE fonts with HIEGHT=xxPT.

3. Use JOURNAL style first, so the TITTLE and FOOTNOTE lines get created without borders.

4. Apply your MEADOWS style just before printing the table. 

 

I used this code:

options nobyline;
ods excel file="C:\temp\sample3.xlsx" 
      style=journal
      options(embedded_titles="yes" sheet_interval="none" 
      frozen_headers = '3' sheet_name="Data" EMBEDDED_FOOTNOTES='ON' 
      ABSOLUTE_ROW_HEIGHT=",,,30,30,");
TITLE1 color=green BOLD "Title";
FOOTNOTE1 "  ";
FOOTNOTE2 color=black height=8pt "Prepared by John Smith on &sysdate9.";
FOOTNOTE3 color=black height=8pt "Controlled by: Organization";
FOOTNOTE4 color=black height=8pt "POC: john.smith@yah.com";
FOOTNOTE5 color=green BOLD "Title";

ods excel style=meadow;
proc print data=sashelp.class(obs=1) noobs label;
   var Name /  style(column)={tagattr='format:@' just=c}; 
   var Age Height Weight / style={just=c};
   var;
run;
ods excel close;

And the Excel file, when printed, looks like this:

SASJedi_0-1645105878501.png

 

 

Check out my Jedi SAS Tricks for SAS Users

View solution in original post

1 REPLY 1
SASJedi
SAS Super FREQ

1. Make your FOOTNOTE1 a blank line to give space between the table and footnotes.

2. Control the point size of the FOOTNOTE fonts with HIEGHT=xxPT.

3. Use JOURNAL style first, so the TITTLE and FOOTNOTE lines get created without borders.

4. Apply your MEADOWS style just before printing the table. 

 

I used this code:

options nobyline;
ods excel file="C:\temp\sample3.xlsx" 
      style=journal
      options(embedded_titles="yes" sheet_interval="none" 
      frozen_headers = '3' sheet_name="Data" EMBEDDED_FOOTNOTES='ON' 
      ABSOLUTE_ROW_HEIGHT=",,,30,30,");
TITLE1 color=green BOLD "Title";
FOOTNOTE1 "  ";
FOOTNOTE2 color=black height=8pt "Prepared by John Smith on &sysdate9.";
FOOTNOTE3 color=black height=8pt "Controlled by: Organization";
FOOTNOTE4 color=black height=8pt "POC: john.smith@yah.com";
FOOTNOTE5 color=green BOLD "Title";

ods excel style=meadow;
proc print data=sashelp.class(obs=1) noobs label;
   var Name /  style(column)={tagattr='format:@' just=c}; 
   var Age Height Weight / style={just=c};
   var;
run;
ods excel close;

And the Excel file, when printed, looks like this:

SASJedi_0-1645105878501.png

 

 

Check out my Jedi SAS Tricks for SAS Users

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
  • 1 reply
  • 1012 views
  • 1 like
  • 2 in conversation