由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - 求救简单的SAS array 出错
相关主题
请教一个关于有效sample size的问题Ask a SAS question
[合集] SAS array problem紧急求救:calculate analogous figures for
syntax errorsSAS问题请教, keep/drop
SAS程序一问SAS code help!! thanks
SAS 问题求助,有包子When will I finally know SAS
在SAS里面如何进行数组操作?how to transfer a SAS dataset into a 2-dimention array
sas一问觉得SAS array超难用
R问题求救,在线等ask SAS code
相关话题的讨论汇总
话题: convcurr话题: curcd话题: eur话题: array话题: itl
进入Statistics版参与讨论
1 (共1页)
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 :)
1 (共1页)
进入Statistics版参与讨论
相关主题
ask SAS codeSAS 问题求助,有包子
SAS Base 123题中47和112题疑问在SAS里面如何进行数组操作?
one quick question in SAS, thank you!!sas一问
工作中的SAS 编程请教R问题求救,在线等
请教一个关于有效sample size的问题Ask a SAS question
[合集] SAS array problem紧急求救:calculate analogous figures for
syntax errorsSAS问题请教, keep/drop
SAS程序一问SAS code help!! thanks
相关话题的讨论汇总
话题: convcurr话题: curcd话题: eur话题: array话题: itl