/*只会列出有不良事件的人的例次*/
proc sql;
create table b as select distinct subjid,count(subjid) as n1 from a where aeterm ne "" group by subjid ;
quit;
/*列出所有人的不良事件的例次*/
proc sql;
create table b as select distinct subjid,count(case when aeterm ne "" then subjid else "" end) as n1 from a group by subjid;
quit;