From: Yaw on
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
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);