Date: Thu, 16 Jul 2009 10:49:43 -0700
Reply-To: "Nordlund, Dan (DSHS/RDA)" <NordlDJ@DSHS.WA.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Nordlund, Dan (DSHS/RDA)" <NordlDJ@DSHS.WA.GOV>
Subject: Re: matching observations of two datasets
In-Reply-To: <200907161740.n6GAowSA007635@malibu.cc.uga.edu>
Content-Type: text/plain; charset=windows-1252
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
> Randall Powers
> Sent: Thursday, July 16, 2009 10:41 AM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: matching observations of two datasets
>
> Hello All,
>
> I have two datasets, dataset A and dataset B. Dataset B is a subset of
> dataset A. The each have variables z1, z2, z3, and delta1 (though dataset B
> also has some addtional variables). Dataset A has 1000 observations,
> dataset B has 100 observations.
>
> I wish to create a dataset C containing all observations from A which are
> not contained in B.
>
> How would I program this?
How about something like
Data c;
Merge a(in=in_a) b(in=in_b keep= <your matching variables>) ;
By <your matching variables> ;
If in_a and not in_b;
Run;
Hope this is helpful,
Dan
Daniel J. Nordlund
Washington State Department of Social and Health Services
Planning, Performance, and Accountability
Research and Data Analysis Division
Olympia, WA 98504-5204
|