Hi all, If we run proc means on sashelp.cars , we get an output as mentioned below. SAS Output but am trying to get same summary output with help of SQL, here's my code: %macro summary;
%global name_list;
proc sql noprint;
select name, count(name)
into :name_list separated by " " ,
:n
from dictionary.columns
where memname = "CARS" & type = "num";
create table sumry as
%do i = 1 %to &n;
%let name = %scan(&name_list, &i);
select
"&name" as variable,
count(&name) as n,
min(&name) as minimum,
max(&name) as maximum,
mean(&name) as average,
std(&name) as standard_dev
from sashelp.cars
group by variable;
%end;
quit;
%mend summary;
option symbolgen mlogic;
%summary; when I run this code am getting output with only one row and not able to get summary results for all other variables, can someone help me with this code to get the same output as proc means(label column not required). Thank you in advance.
... View more