Dear All,
In the below code, my intention is very simple that I want to report the output table which got generated by PROC APPEND. Its working fine when using proc print but when we are using proc report tool , its generating the sum of the all the values(all are numeric in existing data set) as a single observation. I am not sure the reason behind this weird behavior of PROC REPORT.
Below attached code and sample output, Please share your thought ....??
%macro report;
%do I=1 %to 2;
proc append base=GDW data=dummy.count&I ;
run;
%end;
%mend;
%report;
proc print data=GDW;
run;
proc report data=GDW;
column _all_;
run;
In case you want to mimic the PROC PRINT output in PROC REPORT you can do this:
proc report data=GDW;
column _all_;
define _all_ / display;
run;
This prevents the use of the numeric columns as analysis so there will be no statistic applied, just rows with values will be displayed.
Regards,-- Jan.
Hi,
What you deem weird is the default behaviour of proc report. Numeric variables are analysis variables and the default statistic is SUM.
If you need different output, read the docs and add statements for grouping and displaying values, subtotalling and/or
statistics. Keep in mind that REPORT is a very powerful procedure but takes some effort to get the output you desire.
Hope this helps,
-- Jan.
In case you want to mimic the PROC PRINT output in PROC REPORT you can do this:
proc report data=GDW;
column _all_;
define _all_ / display;
run;
This prevents the use of the numeric columns as analysis so there will be no statistic applied, just rows with values will be displayed.
Regards,-- Jan.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.