Date: Thu, 21 Jan 2010 15:39:30 -0500
Reply-To: saslearn chicago <sasswamy@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: saslearn chicago <sasswamy@GMAIL.COM>
Subject: Re: IN - Option
In-Reply-To: <201001212016.o0LGkbQs027680@malibu.cc.uga.edu>
Content-Type: text/plain; charset=ISO-8859-1
Thanks both of you , great help
- swamy
On Thu, Jan 21, 2010 at 3:16 PM, Gerhard Hellriegel <
gerhard.hellriegel@t-online.de> wrote:
> with that option you can see where the data come from. You know that for
> datasetA and for datasetB, but you normally don't know it for vacdata.
> In your case you can also see it by obs-number. The first obs are from
> datasetA, the rest from datasetB. If you change the order for vacdata or
> you have a BY-processing in the data-step, you can see the origin of each
> obs in src.
> Sometimes important is to be sure that data only come from one of the
> datasets. E.g. you want to merge two datasets, but you don't want to add
> obs from the right side which are not in the left side (by key for sure):
>
> data res;
> merge left (in=inleft) right;
> by key;
> if inleft;
> run;
>
> I use the IN operator very often for that.
>
> Gerhard
>
>
>
>
> On Thu, 21 Jan 2010 14:20:36 -0500, SAS Swamy <sasswamy@GMAIL.COM> wrote:
>
> >All,
> >
> >Can someone please let me know , What exactly would be the use for using
> >IN option in data set
> >
> >For e-g
> >data vacdata;
> > length src $1.;
> > set datasetA (in=in1)
> > datasetB (in=in2);
> > if in1 then src='1'; else src='2';
> > format src $1.;
> >run;
> >
> >I was trying to find the documentation , but somehow I am able to see only
> >for MERGE function, possible please send me the links with details If any
> >
> >- swamy
>
|