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.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.