Here AGE in SASHELP.CLSSS equal PERSON.
When last is also first what do you want to do? I used last.
proc sort data=sashelp.class out=class;
_n_ = 0;
do _n_ = _n_+1 by 1 until(last.age);
set class(keep=age) end=eof;
point = _n_-(last.age*not first.age);
obs = point;
set class point=point;
call missing(of _all_);
On 2/23/12, Alison <firstname.lastname@example.org> wrote:
> Hi - I think this should be an easy task but can't quite get it. I have
> multiple observations per person (series of births) and want to select the
> next to last observation in the dataset per person. How do I do this??