Help using Base SAS procedures

finding missing observations

Reply
Contributor
Posts: 43

finding missing observations

Hi,
I have a table A with 10 variables and 3200 observations, i run the proc summary nway to find the frequency of records with consideration of 5 variables ( in my class statement) and i am using the missing option in my summary nway.
In my output i am getting only 2825 observations.
1). i would like to know how to find the missing observations in table B from Table A ( i.e observations that are in table A not in table B).
2). Why some of the observations are missing

I will be thankful if anyone could help me.

Thanks in advance,
sams
Contributor
Posts: 33

Re: finding missing observations

Here is what I do when I want to see what is in one table that is not in the other. Hope it makes sense and/or helps.

proc sort data=TableA; by keyvariable; run;
proc sort data=TableB; by keyvariable; run;

data Aonly Bonly Both;
merge TableA (in=A)
TableB (in=B);
by keyvariable;
if A and B then output Both; else
if A and not B then output Aonly; else
if B and not A then output Bonly;
run;

proc print data=Aonly; run;
Ask a Question
Discussion stats
  • 1 reply
  • 120 views
  • 0 likes
  • 2 in conversation