first. and last.

http://www.albany.edu/~msz03/epi514/notes/first_last.pdf

 

data indiv4;
set indiv3;
if N_entry > 9;
run;
proc sort;by subgroup;
run;

data indiv5;
set indiv4;
by subgroup;

first_id=first.subgroup;
last_id=last.subgroup;

run;

Quit SAS without really quitting

when a SAS syntax generates errors involving macro's, SAS stops doing anything even if you submit a new command.  You can submit the following to clean-quit without shutting down SAS.

;*%mend;*);*';*";**/;