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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.