Hi Community,
I am using proc freq and proc means imbedded inside ods to generate reports with tables, I am encountered a few issues which I cannot find answers quickly on internet.
1. The table generated from proc freq and proc means are always "Left" aligned on the page, how can I make the table aligned to the center
2. I use the titles to generate the title for the report,
title2 bold h=12pt f='Calibri' color=black justify=c "- Statistical Review -";
title3 bold h=12pt f='Calibri' color=black justify=c " - Demographics -";
but I need to have each page (or each table generated by proc freq and proc means) has its own title, I don't know if there is a way to create a sub-title for each table or page of the report.
3. How can I format the decimal created by proc means
Analysis Variable : age | ||||||
N | Median | Minimum | Maximum | Lower Quartile | Upper Quartile | Range |
608 | 70.0000000 | 18.0000000 | 103.0000000 | 60.0000000 | 79.0000000 | 85.0000000 |
Thank you very much as always
Try the CENTER option to center the tables on the page.
options center nodate;
ods noptitle;
ODS RTF FILE='/folders/myfolders/RTF/FREQ and MEANS output.rtf'
STYLE=Pearl;
ODS PDF FILE='/folders/myfolders/RTF/FREQ and MEANS output.pdf';
proc freq data=sashelp.class;
tables _all_ / list missing;
title j=c "- Statistical Review -";
title2 j=c "- Demographics -";
run;
proc means data=sashelp.class n median min max p25 p75 range maxdec=1;
var age;
run;
ODS RTF CLOSE;
ODS PDF CLOSE;
@Reeza Thank you for your help as always!
@SuzanneDorinski Thank you very much
The decimal and centered the table works now.
Below is what I want for the subtitle, since each proc function ended on each page, I want the title for the page (or for the specific table generated by the proc function, as illustrated in italic below)
options center nodate;
options orientation=landscape nonumber topmargin=".2in" bottommargin=".2in" leftmargin=".2in" rightmargin=".2in";
ods pdf file="C:\Documents\Statistical.pdf" style=Styles.Minimal;
title1 bold h=12pt f='Calibri' color=black justify=c " - Statistical Review -";
proc means data = dm1 n median min max q1 q3 Range maxdec=2;
var age;
* I want a subtitle for the table generated by this proc means function, like "- Age -";
* I also want to add a footnote to " *Note: patient's age was calculated using the mid of the month as their birthday";
run;
proc freq data = dm1;
tables sex race Stroke_on_awakening/nocum;
* I want a subtitle for report generated by this proc freq, like "- Subject Baseline Characteristics -";
run;
proc means data = ec1 n mean std min max q1 q3 Range maxdec=2;
var Administered_Drug_Volume;
* I want a subtitle for report generated by this proc freq, like "- Drug Administered -";
run;
proc freq data = evt1;
tables Type_of_anesthesia/nocum;
* I want a subtitle for report generated by this proc freq;
run;
footnote1 j=l "XXX Inc.";
footnote2 j=l "Data cutoff date: 15-Nov-2018";
footnote3 c=l "--- Confidential ---";
run;
ods _all_ close;
quit;
Please see the example above.
I have imbedded a few proc freq and proc means in ods, since each proc freq and proc means ends having the result table showing as one page, I want to have a subtitle for each of proc freq and proc means, and also on a few pages, I also need to make a footnote,
Can anyone help me with the questions above?
Thank you so much
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.