Hello all,
I would like to create subset of observations based on a variable limiting the count to 2 or 1 depending on the value in that variable.
data want;
infile want_file;
input
@ 001 ln_no 9.
@ 010 ln_status $1.
@ 011 ln_excep_stat $1
;
ln_status can have values of '1', 2', '3', '4' or '5' ;
ln_excep_stat can have values of '1', '2', '3' or '4';
If ln_excep_stat is '2', '3' or '4' and ln_stat is '2', '3' or '4', need to limit the observations to 2 obs if there are more than 2 per ln_no.
If ln_excep_stat is '1' or '5' and ln_stat is '1' or '5', need to limit to 1 if there are more than 2.
I really appreciate your time and effort on this.
thank you in advance,
Neal.
... View more