|
On Oct 26, 9:35 pm, muthia.kachira...@GMAIL.COM (Muthia Kachirayan)
wrote:
> Try
>
> data sub_d1;
> set d1;
> BY ID;
> if first.id=1 and ... /* what should i do here*/
>
> On Mon, Oct 26, 2009 at 12:17 PM, Jeff <zhuj...@gmail.com> wrote:
> > I have a dataset d1:
> > id x y z w
> > 1 1 3 4 6
> > 1 4 8 9 0
> > 2 22 44 44 8
> > 2 23 34 45 8
> > 2 12 3 4 7
> > ;
>
> > which is sorted by two variables id and x in ascending order.
> > I want to get the first obs after sorting,
> > which is:
> > id x y z w
> > 1 1 3 4 6
> > 2 12 3 4 7
>
> > I tried
> > proc sort data=d1;
> > by id x;
> > run;
>
> > data sub_d1;
> > set d1;
> > if first.id=1 and ... /* what should i do here*/
>
> > Thanks,
> > Jeff
Hi, Jeff,
Your question is not clear, on what basis you are choosing the
observations.
|