ich unten sas macro.I haben wollen einen Datensatz erstellen, wo ichNicht gewünschten Ausgang bekommen, während Makro ausgeführt
für jede Variable in den Makrovariablen jedes Jahr mit etwas Gewicht multiplizieren will chk_var.But es nicht geben jedes Ergebnis. Im Protokoll zeigt es
MLOGIC(WEIGHT_AVG): %IF condition year=2015 is FALSE
MLOGIC(WEIGHT_AVG): %IF condition year=2014 is FALSE
MLOGIC(WEIGHT_AVG): %IF condition year=2013 is FALSE
MLOGIC(WEIGHT_AVG): %IF condition year=2012 is FALSE
MLOGIC(WEIGHT_AVG): %IF condition year=2011 is FALSE
MLOGIC(WEIGHT_AVG): %IF condition year=2010 is FALSE
Jede Hilfe wird geschätzt.
Mein Makro -
%let chk_var=Total_Shareholders_Funds Secured_Loans Total_Debt___Loan_Funds
Total_Liabilities Sundry_Debtors Inventories Cash_and_Bank_Balance
Total_Current_Assets Total_Current_Liabilities Sls_Turnover_Operat_Incom
Net_Sales Total_Income Operating_Profit Interest Gross_Profit Profit_Before_Tax Tax
Reported_Net_Profit Adjusted_Net_Profit Debt_Equity_Ratio Interest_Cover_Ratio
ROCE RONW;
%put %sysfunc(countw(&chk_var.));
options mprint mlogic symbolgen;
%macro weight_avg;
Data capital_all_3;
set capital_all_2;
%do i=1 %to %sysfunc(countw(&chk_var.));
%let a=%scan(&chk_var.,&i.);
%if year=2015 %then &a._15=6*&a.;
%if year=2014 %then &a._14=5*&a.;
%if year=2013 %then &a._13=4*&a.;
%if year=2012 %then &a._12=3*&a.;
%if year=2011 %then &a._11=2*&a.;
%if year=2010 %then &a._10=1*&a.;
%end;
run;
%mend weight_avg;
%weight_avg;