Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- finding missing observations

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-25-2009 09:05 AM

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

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

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-25-2009 09:09 AM

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;

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;