Help using Base SAS procedures

Proc Report (Customizing output report)

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 11
Accepted Solution

Proc Report (Customizing output report)

Hi all,

I need help in customizing my report generated by using proc report.

 

code I tried is:


proc means data=olympics_digi_cleaned sum descending ;
class _probability___;
var Total_Media_value;
run;

 

Output is attached in attachments.

 

 

What I want is :

(1)   To display Prob_Digi in place of _probablity___  as my column name

(2)    to display all the data in reverse order i.e _probablity 100 will be my first observation and 0 will be my last observation

(3)   To display sum o all observation in sum column at last

(4)   At last I also want to add a column that contain the product of _probablity___ and sum.

 


output.PNG

Accepted Solutions
Solution
‎07-04-2017 03:18 AM
Trusted Advisor
Posts: 1,615

Re: Proc Report (Customizing output report)

[ Edited ]

All of this should be easy to do if you output the results of PROC MEANS to a SAS data set, and then perform the modificaitons you want on the PROC MEANS output using a SAS data step or another PROC, then do a PROC PRINT or PROC REPORT.

 

To output the data from PROC MEANS to a SAS data set named _results_, use this code as the last command of PROC MEANS (just above the run; command)

 

output out=_results_ sum=;

 

View solution in original post


All Replies
Solution
‎07-04-2017 03:18 AM
Trusted Advisor
Posts: 1,615

Re: Proc Report (Customizing output report)

[ Edited ]

All of this should be easy to do if you output the results of PROC MEANS to a SAS data set, and then perform the modificaitons you want on the PROC MEANS output using a SAS data step or another PROC, then do a PROC PRINT or PROC REPORT.

 

To output the data from PROC MEANS to a SAS data set named _results_, use this code as the last command of PROC MEANS (just above the run; command)

 

output out=_results_ sum=;

 

Occasional Contributor
Posts: 11

Re: Proc Report (Customizing output report)

hi there by inserting this line:

output out= _result_ sum=;

eveything is done 

But how to display my table in reverse order

i.e. 100 will be my first observation and 10 will be my last observation??

Trusted Advisor
Posts: 1,615

Re: Proc Report (Customizing output report)

PROC SORT

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 161 views
  • 0 likes
  • 2 in conversation