BookmarkSubscribeRSS Feed
Patrick
Opal | Level 21

"However, when I run my summary based on the 4,002 records in table 1F, the summary seems to be using the records from table 1A with the 4,055 records instead of the 1F with 4,002."

I can't see this summary code in the SAS log you've posted.

There are a lot of data steps with data selections until you get to your 1F table so if you don't execute your summary code against table F1 then you've got likely a mismatch in the data selection for the table you're using for your summary.

wheddingsjr
Pyrite | Level 9

Patrick, the summary code is below and as you can see it does execute against 1F:

data den_final;
set data_1f;
by mrn;
gap = dif(admit_dt); 
if first.mrn then gap =.;
IF ADMIT_DT NE .  AND gap LE 0 THEN do;
Logic_dt = FIRST_SRV_dt;
ID = cats(mrn, logic_dt); /* as encounter */

end ;
run;
proc sql;
create table den as select
count(distinct member_id) as pt_inpt
, count(distinct int_clm_num) as clm_inpt
from den_final
;quit;
wheddingsjr
Pyrite | Level 9

Thanks everyone for your assistance. I found the issue. The problem was even though the exclusions were happening, because a member_id could have more than 1 disch_stat_cd, the distinct member_id was still being counted in the tally. Once again I want to thank everyone for their important input.

wheddingsjr
Pyrite | Level 9
By the way, how do I mark this post as closed?

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 18 replies
  • 1787 views
  • 0 likes
  • 3 in conversation