程序1:
datacdw_old_mh&year ;
set Cdw_old&year ( where=( MH=1));
by baseid ;
if (first.baseid ne 1or last.baseid ne 1) then output ;
run ; *1931duplicate patients with 1+ MH claim;
** 112, UniqueElderly community-dwellers with 1+ MH claim;
proc sql;
create table old_g1mh as
select &year asyear,count(unique(baseid)) as old_g1MH
from cdw_old_mh&year;
quit;
程序2:
dataold_g1_all&year;
set Cdw_old&year ;
by baseid ;
if (first.baseid ne 1or last.baseid ne 1) then output ;
run ;
proc sql;
create table old_g1_mh as
select &year asyear,count(unique(baseid)) as old_g1_MH
from old_g1_all&year
where mh=1;
quit;