Hi Guys, can someone please kindly highlight the errors in the following codes? Thank you so much %macro ecl_scen(ss); data cms_crb_calc; set cms_crb_calc; array EAD_ {20} EAD_0-EAD_19; array DF_ {20} DF_1-DF_20; array &ss._Gross_ECL_ {20} &ss._Gross_ECL_0-&ss._Gross_ECL_20; array &ss._cpd_yr {20} &ss._cpd_yr1-&ss._cpd_yr20; array &ss._mpd_yr {20} &ss._mpd_yr1-&ss._mpd_yr20; do t=1 to 20; j=t-1; if tenor>t then m=1; else if tenor>t-1 then m=tenor-floor(tenor); else m=0; if t=1 then do; /*for rr=8,9,10 mpd for year 1 is 0, assume cpd/mpd for year 1 is half that of year 2. i.e. PD uniformly distributed*/ if &ss._mpd_yr{1}=0 then do; &ss._mpd_yr{1}=&ss._cpd_yr{2}/2; &ss._cpd_yr{1}=&ss._cpd_yr{2}/2; &ss._Gross_ECL_{t}=EAD_{t}*DF_1*LGD*&ss._mpd_yr{t}*m; end; else do; &ss._Gross_ECL_{t}=(1-&ss._cpd_yr{j})*EAD_{t}*DF_{t}*LGD*&ss._mpd_yr{t}*m; end; end; format &ss._gross_ecl_1-&ss._gross_ecl_20 18.2 DEFAULT=18.2; run; proc data cms_crb_calc; set cms_crb_calc; &ss._ECL_12M_local=&ss._Gross_ECL_1; /*RL - Remaining Lifetime*/ &ss._ECL_RL_local=sum(&ss._Gross_ECL_1, &ss._Gross_ECL_2, &ss._Gross_ECL_3, &ss._Gross_ECL_4, &ss._Gross_ECL_5, &ss._Gross_ECL_6, &ss._Gross_ECL_7, &ss._Gross_ECL_8, &ss._Gross_ECL_9, &ss._Gross_ECL_10, &ss._Gross_ECL_11, &ss._Gross_ECL_12, &ss._Gross_ECL_13, &ss._Gross_ECL_14, &ss._Gross_ECL_15, &ss._Gross_ECL_16, &ss._Gross_ECL_17, &ss._Gross_ECL_18, &ss._Gross_ECL_19, &ss._Gross_ECL_20); format &ss._ECL_12M_local &ss._ECL_RL_local $18; run; %mend; &ecl_scen(base);
... View more