data test;
input ssn $9. ee_id$ EE_pyin $10. payamt;
cards;
093443789 322189 2018-06-01 1200
093443789 322189 2018-06-15 1200
093443789 322189 2018-06-29 1200
093443789 322189 2018-07-01 1300
094646665 112782 2018-03-09 2807
094646665 112782 2018-09-21 0054
;run;
in the above program there are 2 different ssn(social secuirty number), i want to count how many times he has paid.Till here it is working fine .But i dont want to include the last payment or you can say exclude the latest date for every ssn and then output all others as you can see below.
Pls help!!
proc sort data=test;by ssn;run;
data a c1 c2 c3;
set test;
by ssn;
if first.ssn then c=0;
c+1;
if c=1 then output c1;
if c=2 then output c2;
if c=3 then output c3;
run;