楼主: crazygoing
1312 5

[原创博文] 帮我看看这段程序错在什么地方 [推广有奖]

  • 0关注
  • 47粉丝

教授

29%

还不是VIP/贵宾

-

威望
1
论坛币
4821 个
通用积分
21.8270
学术水平
165 点
热心指数
203 点
信用等级
146 点
经验
48691 点
帖子
441
精华
1
在线时间
1325 小时
注册时间
2007-11-9
最后登录
2024-4-11

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
复制代码
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” ,依次类推……
谢谢!
二维码

扫码加我 拉你入群

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

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

关键词:array Total sas代码 list drop 程序

沙发
maidenhan 发表于 2012-8-2 16:27:00 |只看作者 |坛友微信交流群
What about changing the code into " if tt(i)=1 then dis=scan("&list.",i); "?

使用道具

藤椅
crazygoing 发表于 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); "?
对啊,我怎么没想到。唉,郁闷死了。 谢谢啊!

使用道具

板凳
maidenhan 发表于 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.

使用道具

报纸
Imasasor 发表于 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?
欢迎加入亚太地区第一R&Python数据挖掘群: 251548215;

使用道具

地板
maidenhan 发表于 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.

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-5-14 17:21