Date: Wed, 29 Jun 2011 03:31:21 -0400
Reply-To: Søren Lassen <s.lassen@POST.TELE.DK>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Søren Lassen <s.lassen@POST.TELE.DK>
Subject: Re: OT: Chance to Make SAS-L History: Did You Know That...
Content-Type: text/plain; charset=ISO-8859-1
You can use the same variable name in several IN= dataset options
in the same datastep?
Example:
Data All_years;
set
xx98(in=y1998)
mylib.t1998(in=y1998)
otherdata
;
if y1998 then year=1998;
else year=year(saledate);
run;
The common IN= variable will be set if one or more of the datasets
are present, meaning that
Data out;
merge a b(in=inx) c(in=inx);
by ID;
if inx then...
is equivalent to
Data out;
merge a b(in=inb) c(in=inc);
by ID;
if inb or inc then...
Regards,
Søren
|