I am currently working on a credit card delinquency project. need help from expert to see if this can happen
so I have this code
data mcmc2;
set work.mcmc;
array delq(1:15) $2. delq_1-delq_15;
do i = 1 to 15;
delq(i) = substr(delq_36_rev, (i),2) ;
put @1 delq(i);
end;
run;
this code generate 15 variable from delq_36_rev
delq_36_rev looks like xxxxxxxxxxxxxxx (where 0<=x<=7) so delq_i looks like xx
thing I want to do starts from here.
from delq_1 ~ delq_15 I would give score based on numbers
(eg. 01 = 1 point, 12 = 2 points, 23= 3 points)
but I would also combine scores altogether
so I would like to write a do loop like
do i = 1 to 15
when delq_i ="70" then score_i=-6
when delq_i in ("71","60") then score_i=-5
when delq_i in ("72","61","50") then score_i=-4
when delq_i in ("73","62","51","40") then score_i=-3
when delq_i in ("74","63","52","41","30") then score_i=-2
when delq_i in ("76","65","65","64","54","53","43","42","32","31","20","21","10") then score_i=-1
when delq_i ="00" then score_i=0
when delq_i in ("01","11","22","33","44","55","66","77" then score_i=1
when delq_i ="12" then score_i=2
when delq_i ="23" then score_i=3
when delq_i ="34" then score_i=4
when delq_i ="45" then score_i=5
when delq_i ="56" then score_i=6
when delq_i ="67" then score_i=7
sum(delq_1-delq_15) as delq_score
please help!!