What is an appropriate procedure that I can use in SAS to count the number of people in each department? I've provided a snippet of the dataset.
Thanks!
proc freq data= emp noprint;
tables dept / missing out=temp(drop=percent);
run;
proc freq/sql/summary. take a look
proc sql;
create table want as
select dept, n(emp) as num_of_people
from have
group by dept;
quit;
Is there one that doesn't use SQL statements? I tried using the proc freq but for some reason it just output the dataset I already had.
proc freq data= emp noprint;
tables dept / missing out=temp(drop=percent);
run;
How could I use a procedure to calculate the average salary and also the number of ppl in each department. The code I have below gives the following message: Statement is not valid or it is used out of proper order. Not sure what the problem is. I was trying to use proc means.
proc means data = hw9.combo;
class dept;
mean = salary;
run;
Please post usable sample data in the form of a data step if you want tested, usable code answers 🙂
Do something like this
proc freq data=have;
tables dept;
run;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.