Hello All,
I found the below code online. It is used to correct issues with the contribution amounts from the Federal Election Committee database (FEC.gov). I do not understand what exactly this code suppose to do. I would appreciate it if you could please explain the purpose of doing this to the amount column in the data.
***Correcting issues with contribution amount in the data;
data _null_;
amt='008900]';
b=input(compress(amt,"jklmnopqr]","i"),8.)*(-10)-(find(']jklmnopqr',lowcase(substr(amt,notdigit(amt))))-1);;
put b;
run;
%macro amt;
%let yrlist=00 02 04 06 08 80 82 84 86 88 90 92 94 96 98;
%do i=1 %to 15;
%let yr=%scan(&yrlist,&i);
data r.ind&yr;
set r.ind&yr;
if notdigit(amt)=0 then amt_new=input(put(amt,8.),8.);
else
amt_new=input(compress(amt,"jklmnopqr]","i"),8.)*(-10)-(find(']jklmnopqr',lowcase(substr(amt,notdigit(amt))))-1);
run;
%end;
%mend;
%amt;
... View more