LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (June 2011, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 30 Jun 2011 11:37:13 -0500
Reply-To:   Joe Matise <snoopy369@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Joe Matise <snoopy369@GMAIL.COM>
Subject:   Re: OT: Chance to Make SAS-L History: Did You Know That...
Comments:   To: "DUELL, BOB (ATTCINW)" <bd9439@att.com>
In-Reply-To:   <AC5F423B9AB19C43BE62C86BAF8113CC0AD7D5@WABOTH9MSGUSR8C.ITServices.sbc.com>
Content-Type:   text/plain; charset=ISO-8859-1

However, you could use keepme1 keepme2 ... and then use if nmiss(keepme:)=0;

-Joe

On Thu, Jun 30, 2011 at 11:34 AM, DUELL, BOB (ATTCINW) <bd9439@att.com>wrote:

> You're right of course, this will not work for me (duh). > > Oh well, the brain seems to have started the holiday weekend a bit early. > > Thanks Chang! > > -----Original Message----- > From: Chang Chung [mailto:chang_y_chung@HOTMAIL.COM] > Sent: Thursday, June 30, 2011 9:17 AM > To: DUELL, BOB (ATTCINW) > Subject: Re: OT: Chance to Make SAS-L History: Did You Know That... > > On Thu, 30 Jun 2011 15:43:12 +0000, DUELL, BOB (ATTCINW) <bd9439@ATT.COM> > wrote: > > >Although I have never used this tip, I can think of at least one example > where it might be useful. I have a complex data step that merges several > other data sets on a common BY variable (user_id). I need to guarantee > that the record exists in some data sets, but not all. For example, my > current code looks similar to this: > > > >data permdata; > > merge ds1(in=a) > > ds2(in=b) > > ds3 > > ds4 > > ds5(in=c) > > ds6(in=d); > > by user_id; > > if a and b and c and d; > >run; > > > >Every once in a while I need to add or remove data sets from this > structure. Using this tip, I might be able to simplify this as follows: > > > >data permdata; > > merge ds1(in=keepme) > > ds2(in=keepme) > > ds3 > > ds4 > > ds5(in=keepme) > > ds6(in=keepme); > > by user_id; > > if keepme; > >run; > > you might not! since "if keepme;" above does *not* seem to be equivalent to > "if a and b and c and d" above; it is rather equivalent to "if a or b or c > or d"! > cheers, > chang >


Back to: Top of message | Previous page | Main SAS-L page