I want to export/save results from SAS report to a SAS dataset to further manipulate it. Please help!
Please post your code as text, pain to type it out and make sure the variables are correct, so generic code is below.
In general, just use proc means and a proc transpose to get what you need.
proc means data=have noprint nway;
class var1 var2 var3;
var amount;
output out=summary sum=;
run;
proc transpose data=summary;
by var1 var2;
id var3;
var amount;
run;
proc tabulate has an OUT= option that will pipe the data/calculations to a data set. It will not be in the format shown though.
@yp2609 wrote:
I want to export/save results from SAS report to a SAS dataset to further manipulate it. Please help!
Reeza, thank you! I know there is OUT= option, but I really want to keep the same formatting here. Anyway, I will try to figure a way out.
Please post your code as text, pain to type it out and make sure the variables are correct, so generic code is below.
In general, just use proc means and a proc transpose to get what you need.
proc means data=have noprint nway;
class var1 var2 var3;
var amount;
output out=summary sum=;
run;
proc transpose data=summary;
by var1 var2;
id var3;
var amount;
run;
Can you provide an example of the sort of manipulation you may want?
The limits of a SAS data set means that the layout appearance can't be stored. SAS data set variables hold a value. Columns of a report, depending on the syntax of a table, can contain the statistics from multiple variables. Which doesn't go well with the tabular view of a data set.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.