全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
11091 5
2013-06-03
悬赏 50 个论坛币 已解决
复制代码
变量permno是股票的代码。运行到“data fin;   set fin; if permno ne lag1(permno);   curdat = 100*&yyy + &mmm;  iter = &j;” 时会提示:ERROR: 变量 permno 已定义为字符型和数值型。这是什么原因呢?恳请高人解答啊!





最佳答案

yongyitian 查看完整内容

原因: 两个数据集参加运算时,相同变量有不同的类形。 /* run the following code and look at the results */ /* to see if there is any difference in the last column */ proc sql; select memname, name, type from dictionary.columns where libname='WORK' and name='permno'; quit;
二维码

扫码加我 拉你入群

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

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

全部回复
2013-6-3 22:29:08
原因: 两个数据集参加运算时,相同变量有不同的类形。

/* run the following code and look at the results */
/* to see if there is any difference in the last column */

proc sql;
   select memname, name, type
   from dictionary.columns
   where libname='WORK' and name='permno';
quit;
二维码

扫码加我 拉你入群

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

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

2013-6-3 22:35:30
检查你数据集two bob bar中的permno是不是即有数值型又有字符型
二维码

扫码加我 拉你入群

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

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

2013-6-4 08:22:58
这个错误应该不是“data fin;   set fin; if permno ne lag1(permno);   curdat = 100*&yyy + &mmm;  iter = &j;” 这一步产生的。
二维码

扫码加我 拉你入群

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

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

2013-6-4 09:24:41
Agree with them.
Just guessing: if proc means automatically picks up the format of permno, is it possible for its output giving a different type of permno with the original one?  Of course, it is possible only if permno is numeric in data two that actually originates from data one.
jingju
二维码

扫码加我 拉你入群

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

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

2013-6-4 14:05:41
谢谢各位的答案,我先试试看
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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