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

Hello, 

I am running an analysis and getting some Results after I perform a Proc Means: 

proc means data = dataset_jumps_pa;
var exc_retadj  spread  size annualized_standev;
title All: Return (paper vol);
run;

What I would like to get is to export my results to Excel.

 

I have tried the following: 

proc export	
	data = work.dataset_jumps_pa	
	dbms = xlsx
	outfile = "/c/myfolder/Results/all.xlsx"
	replace;
run; 

which only exports the dataset from which I then perform the PROC MEANS.

 

I was wondering if there is a way to export the Results of the PROC MEANS directly to excel. 

 

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

ODS is the preferred way to get results output to files.

 

Try: (The FILE= should start with a drive or mount point, otherwise the output (location) is subject to interesting results).

Make sure the spelling in the path matches your system as well.

ods excel file="/c/myfolder/Results/all.xlsx";

proc means data = dataset_jumps_pa;
var exc_retadj  spread  size annualized_standev;
title All: Return (paper vol);
run;

ods excel close;

There are a lot of options that may apply  to the output but this should get you started.

 

Alternatively you could send output from Proc Means output to a data set and export that. However that data set may not appear as you want.

View solution in original post

2 REPLIES 2
ballardw
Super User

ODS is the preferred way to get results output to files.

 

Try: (The FILE= should start with a drive or mount point, otherwise the output (location) is subject to interesting results).

Make sure the spelling in the path matches your system as well.

ods excel file="/c/myfolder/Results/all.xlsx";

proc means data = dataset_jumps_pa;
var exc_retadj  spread  size annualized_standev;
title All: Return (paper vol);
run;

ods excel close;

There are a lot of options that may apply  to the output but this should get you started.

 

Alternatively you could send output from Proc Means output to a data set and export that. However that data set may not appear as you want.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

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