BookmarkSubscribeRSS Feed
ssas
Calcite | Level 5
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
1 REPLY 1
stateworker
Fluorite | Level 6
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;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 638 views
  • 0 likes
  • 2 in conversation