全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1549 5
2012-08-02
复制代码
SAS代码
%let list=F15 F16 F17 F18 F19 F20 F21 F22 F23 F24 F25 F26 F27 F28 F29 F30 F31 F32 F34 F35 F36;
data x(drop=i);
set total;
array tt(*) F15-F32 F34-F36;
do i=1 to dim(tt);
if tt(i)=1 then dis=scan(&list,i);
end;
run;



sas提示: 期望算术运算符。 语法错误,语句将被忽略。
请大家帮我看看程序错在什么地方,我的目的就是生成新的变量dis,如果例如F15=1,那么 dis=“F15” ,依次类推……
谢谢!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2012-8-2 16:27:00
What about changing the code into " if tt(i)=1 then dis=scan("&list.",i); "?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-8-2 16:38:29
maidenhan 发表于 2012-8-2 16:27
What about changing the code into " if tt(i)=1 then dis=scan("&list.",i); "?
对啊,我怎么没想到。唉,郁闷死了。 谢谢啊!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-8-2 16:49:37
crazygoing 发表于 2012-8-2 16:38
对啊,我怎么没想到。唉,郁闷死了。 谢谢啊!
Even Newton had made mistakes, u don't have to warry about it.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-8-2 19:45:42
maidenhan 发表于 2012-8-2 16:27
What about changing the code into " if tt(i)=1 then dis=scan("&list.",i); "?
why do you shuo yingyu?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-8-3 08:28:12
Imasasor 发表于 2012-8-2 19:45
why do you shuo yingyu?
I can't type in Chinese on my business desktop, sometimes.
It has annoyed me for a long time, but i don't how to handle it still.

So, if I can say something clearly, I would use English. If not, I have to trans to the mobile phone and try to reply in Chinese.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群