From: Yaw on 3 May 2010 11:59 Dear All: I am trying to select a number of cases in my data set with non sequential IDs. I know I can use the 'WHERE ID EQ ( LT /LE or GE / GT) something' to select a single case or a number of cases(sequential IDs). I want an expedient way to do this so that I don't have to go through the route on making many data steps and appending them to get my desired cases. Here is the code I am working with. Data selectIDs; set allIDs; where ID eq 20;*** I want to select IDs like 2, 7, 18 20, 59 80 etc; run; Any ideas? Thanks, Yaw
From: Ya on 3 May 2010 12:48 On May 3, 8:59 am, Yaw <link...(a)gmail.com> wrote: > Dear All: > > I am trying to select a number of cases in my data set with non > sequential IDs. > > I know I can use the 'WHERE ID EQ ( LT /LE or GE / GT) something' > to select a single case or a number of cases(sequential IDs). > > I want an expedient way to do this so that I don't have to go through > the route on making many data steps and appending them to get my > desired cases. > > Here is the code I am working with. > > Data selectIDs; > set allIDs; > where ID eq 20;*** I want to select IDs like 2, 7, 18 20, 59 80 > etc; > run; > > Any ideas? > > Thanks, > Yaw where id in (2,7,18,20,59,80);
|
Pages: 1 Prev: Pre-written SAS code to read & label Census datasets? Next: format and match based on wildcard |