Help using Base SAS procedures

Credit card interest calculation

Reply
Frequent Contributor
Frequent Contributor
Posts: 83

Credit card interest calculation

Hi SASusers

I have need to do a credit card interest calculation for the number of months the offer is valid.

Thanks

Here is the input data

card offer max mnthsrate opening_balancedays min_pct_due
A2.9% for 12 months120.00007911000300.025
B

1.9% for 6 months

60.0000525000300.025

Here is the output data

card offer rate min_pct_dueMonthDaysOpening BalanceInterestClosing BalanceMinimum Due
A2.9% for 12 months0.0000790.02513011,0002711,027277
A2.9% for 12 months0.0000790.02523010,7502610,776270
A2.9% for 12 months0.0000790.02533010,5062510,531264
A2.9% for 12 months0.0000790.02543010,2672510,291258
A2.9% for 12 months0.0000790.02553010,0332410,057252
A2.9% for 12 months0.0000790.0256309,805249,829247
A2.9% for 12 months0.0000790.0257309,582239,605241
A2.9% for 12 months0.0000790.0258309,364239,387236
A2.9% for 12 months0.0000790.0259309,151229,173230
A2.9% for 12 months0.0000790.02510308,943228,964225
A2.9% for 12 months0.0000790.02511308,739218,760220
A2.9% for 12 months0.0000790.02512308,540218,561215
A2.9% for 12 months0.0000790.02513308,346208,366210
A2.9% for 12 months0.0000790.02514308,156208,176205
A2.9% for 12 months0.0000790.02515307,970197,990201
B1.9% for 6 months0.0000520.025130500085,008126
B1.9% for 6 months0.0000520.025230488284889123
B1.9% for 6 months0.0000520.025330476674773120
B1.9% for 6 months0.0000520.025430465374660118
B1.9% for 6 months0.0000520.025530454374550115
B1.9% for 6 months0.0000520.025630443574442112
Attachment
Attachment
Frequent Contributor
Frequent Contributor
Posts: 83

Re: Credit card interest calculation

Hi SASusers

I have sort of figured it out.

proc sort data=have;
by card offer;

data want;
set have
by  card Offer;
count=0;
do i=1 to 15 until (count=max_months);
  interest_promo='Opening Balance'n*Rate*days;

  'Closing Balance'n='Opening Balance'n + interest_promo;
  min_due='Closing Balance'n*min_pct_due;
'Opening Balance'n='Closing Balance'n-min_due;
count+1;
output;
end;
run;


But there is a small problem...

my output starts from the value  of Opening balance=10,750 instead of the starting value of 11000

Ask a Question
Discussion stats
  • 1 reply
  • 176 views
  • 0 likes
  • 1 in conversation