BookmarkSubscribeRSS Feed
sasban
Obsidian | Level 7

I'm new is SAS, trying to open proc means output in proc report to beautify it. However, it didn't open as it was in proc mean. I would appreciate any suggestions, tips and tricks.

7 REPLIES 7
error_prone
Barite | Level 11
You could use output statement in proc means to create a dataset and use that in proc report. But proc report can aggregate data, so maybe proc means is not necessary at all. You have to show your proc means code to help you further.
sasban
Obsidian | Level 7

@error_prone,

 

I'm looking for output like in proc report (below), Can I get that output through proc means (below)? 

 

Proc import datafile="/folders/myshortcuts/Myfolders/SAS Exercise/EFF_Exercise.xls"
    Out=AE
    Dbms=XLS replace;
run;
 
 
data AEsmall;
set AE (keep=avisitn avisitn_1 trt01p aval);
run;
 
Proc sort data=AEsmall out=AEready;
by avisitn;
run; 
 
Proc means data=AEready N mean stderr maxdec=3;
var aval;
class avisitn avisitn_1 trt01p;
ods output summary=AE1;
run;
 
data viral_load;
set AE1;
format aval_mean_se $50.;
drop NObs aval_mean aval_stderr;
aval_mean_se=put(aval_mean, 5.3)!!' ('!!put(aval_stderr, 5.3)!!')';
run;
 
Proc report data=viral_load out=TableQ7;
title1 'Table 1:';
title2 'Summary of Viral Load Over Time';
title3 'ITT Population';
column avisitn trt01p aval_N aval_mean_se;
define avisitn/group 'Test day (Week)';
define trt01p/group 'Treatment';
define aval_N/group 'N';
define aval_mean_se/display 'Unadjusted Mean (SE)';
run;
Reeza
Super User

Not by default, you need to use a process similar to what's shown which involves customizing the output to what you need.

Reeza
Super User

Don't. Learn to use ODS first and control the output directly from PROC MEANS. 

sasban
Obsidian | Level 7

I need to get an output as attached from a data set. I tried using Proc means and Proc report, but didn't help. Any suggestions please?

Reeza
Super User

Yeah, that's not standard output. Look for a paper called 'Creating Complex Reports' from Cynthia Zender that will detail how to create these reports.

sasban
Obsidian | Level 7

Thank you Reeza!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 1918 views
  • 4 likes
  • 3 in conversation