I have a proc tab that does a count as the default statistic
proc tabulate data=WORK.HRIR99991 missing contents = ' ' S=[foreground=highlight.];
class BUSINESS_UNIT_DESC GENDER_CODE DEPARTMENT_DESC;
var fte;
keylabel Sum = " ";
table BUSINESS_UNIT_DESC='Business Unit' * N='Record Count'/
contents = ' ' misstext=' ' box={label="&boxlabel"};
RUN;
this gives ne a count of the number of records in the data set however each record has an employees HR ID number in it (called HRID)
what I would like to do is just count each unique HRID once to get a head count is tehre a way to do that in proc tab?
If your HRID varialbe is actually numeric you could make it a VAR variable and ask for the N statistic. That gives a count. When it is a CLASS variable then you get the individual values. But VAR must be numeric not a character variable containing digits.
If your HRID varialbe is actually numeric you could make it a VAR variable and ask for the N statistic. That gives a count. When it is a CLASS variable then you get the individual values. But VAR must be numeric not a character variable containing digits.
I wonder why and incorrect answer is marked as a solution. N gives a count, but not a unique count.
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!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.