Help using Base SAS procedures

PROC FREQ

Accepted Solution Solved
Reply
Super Contributor
Posts: 1,040
Accepted Solution

PROC FREQ


Hi ,

I have the following;

ID DESCRIPTION

01   Fever

02  Headache

03 sprain

01 Fever

01 Fever

I was using and missing the description in the output.

can someone help me with this

Proc freq data=have;

tables ID/out=freqs;

run;

I get

ID Count

01  3

02  1

03  1

I want  counts by ID and Description

ID DESCRIP COUNT

01 fever 3

02 Headache 1

03 sprain 1

Thanks


Accepted Solutions
Solution
‎10-21-2014 09:56 AM
Super Contributor
Posts: 490

Re: PROC FREQ

proc sql;

select  *,sum(1) as COUNT

from have

group by ID ,DESCRIPTION;

run;

View solution in original post


All Replies
Solution
‎10-21-2014 09:56 AM
Super Contributor
Posts: 490

Re: PROC FREQ

proc sql;

select  *,sum(1) as COUNT

from have

group by ID ,DESCRIPTION;

run;

Trusted Advisor
Posts: 1,204

Re: PROC FREQ

proc freq data=have;

table id*DESCRIPTION/list norow nocol nopercent nocum;

run;

Super User
Posts: 9,691

Re: PROC FREQ

Proc freq data=have;

tables ID*DESCRIPTION/out=freqs   norow nocol nopercent nocum;

run;

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 251 views
  • 6 likes
  • 4 in conversation