Date: Thu, 6 Nov 2008 16:54:45 -0500
Reply-To: Kim Brown <kibrown@LADHS.ORG>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Kim Brown <kibrown@LADHS.ORG>
Subject: Count Variables in different data sets
Hi all,
I have these three codes:
Proc sql;
create table SC1 as
select dx_code1, count(dx_code1) as count from SC
where dx_code1 IN ('V15.82', '305.1', '305.10', '305.11')
Group by dx_code1;
quit;
Proc sql;
create table SC2 as
select dx_code2, count(dx_code2)as count from SC
where dx_code2 IN ('V15.82', '305.1', '305.10', '305.11')
group by dx_code2;
quit;
Proc sql;
create table SC3 as
select dx_code3, count(dx_code3)as count from SC
where dx_code3 IN ('V15.82', '305.1', '305.10', '305.11')
group by dx_code3;
quit;
I would like to merge the datasets to count the four codes into one
dataset/output.
Outputs:
Dx_code1 count
305.1 18
305.1 6
Dx_code3 count
305.1 325
305.1 25
305.11 4
V15.82 77
Dx_code3 count
305.1 188
305.1 18
305.11 4
V15.82 11
I would like to have this:
Dx_codes count
305.1 531
305.1 49
305.11 8
V15.82 88
Any suggestions?
Thanks,
Kim