BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Nishant_saxena
Calcite | Level 5

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
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

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=;

 

--
Paige Miller

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

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=;

 

--
Paige Miller
Nishant_saxena
Calcite | Level 5

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??

PaigeMiller
Diamond | Level 26

PROC SORT

--
Paige Miller

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 3 replies
  • 1469 views
  • 0 likes
  • 2 in conversation