k**g 发帖数: 1558 | 1 出错在这个array只对convcurr第一个act除以1936.27, 剩下的全部不变。大家知道问
题出在了哪里?谢谢!
%let convcurr=act che at gdwl ppent dpact;
data test;
set annualdata;
array convcurr[*] &convcurr;
do i=1 to dim(convcurr);
if curcd='ITL' then do;convcurr[i]=convcurr[i]/1936.27;curcd='EUR';end;
end;
run; | l****u 发帖数: 529 | 2 The issue appears to be in the "if then do";
if curcd='ITL' then do;convcurr[i]=convcurr[i]/1936.27;curcd='EUR';end;
After the calculation for the first element in your array, you change curcd
to 'EUR' at once, without giving other items chances for calculation.
Solution:
change your code to:
if curcd='ITL' then do;convcurr[i]=convcurr[i]/1936.27; end; end;
curcd='EUR'; | k**g 发帖数: 1558 | 3 太谢谢了!You saved my day :) |
|