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
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.
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.
Use ODS EXCEL to direct the output from MEANS to the spreadsheet.
Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.
Explore Now →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.