BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Kirito1
Quartz | Level 8

I was working on a data where I want to have a summary of the data using proc summary. The sample data as below.

Kirito1_0-1673335134975.png

Now what I want is how many email ids that emp_code has...Something like below

Kirito1_1-1673335345820.png

Can someone help how can I achieve this...........Thank you in advance for all the contributors.

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

Counting is done in PROC FREQ:

proc freq data=have;
tables emp_code;
run;

or, in SQL:

select emp_code, count(*) as freq_email
from have
group by emp_code;

View solution in original post

2 REPLIES 2
Kirito1
Quartz | Level 8

Because when I try to use proc summary for this.........An error pops up........stating
ERROR: Variable EMAIL_ID in list does not match type prescribed for this list. I know this could be done using proc freq but I have to use proc summary cuz I have some omre functions to apply on the dataset I am working on.

Kurt_Bremser
Super User

Counting is done in PROC FREQ:

proc freq data=have;
tables emp_code;
run;

or, in SQL:

select emp_code, count(*) as freq_email
from have
group by emp_code;

SAS Innovate 2025: Register Now

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!

Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 2 replies
  • 516 views
  • 0 likes
  • 2 in conversation