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;