Let me start from the first query that might help /*****************************get tin level counts for re and nored*********************************/ proc sql; create table tin as (select distinct prov_tin, count(noreadm) as noreadm, count(yesreadm) as yesreadm from claims group by prov_tin); run; the out put is 4796 rows of distinct tins and in the noreadm column there is not 1 value that is 0. it takes and counts all noreadms for that tin from another table. then the yesreadm column does the same by tin and of those I have 4641 rows that have 0 and 155 that have a count that varies from 1 to 9. It will not let me do 2 counts in one query from what I have tried based on my output table above of tin. If I try it and say in a where yesreadm >0 both counts will turn up 155. If i do not put where statement both columns will return 4796. i need it to return noreadm yesreadm 4796 155 The only way I have gotten this to work now is by doing it like this proc sql; create table tin2 as (select distinct prov_tin count(noreadm) as noreadm from tin group by prov_tin; run; proc sql create table tin3 as (select distinct prov_tin count(yesreadm) as yesreadm from tin where yesreadm >0 group by prov_tin; run; Then I end up with 2 tables. 1 with list of distinct tins that have 4796 rows that are no readms and another table with a list of distinct tins that are 155 rows for yesreadms. but to put together to have a final output of noreadms = 4796 and yesreadms = 155 and i do not need the tins at this point does not work. this is to get me to my final phase of being able to do a chisquare
... View more