变量permno是股票的代码。运行到“data fin; set fin; if permno ne lag1(permno); curdat = 100*&yyy + &mmm; iter = &j;” 时会提示:ERROR: 变量 permno 已定义为字符型和数值型。这是什么原因呢?恳请高人解答啊!
原因: 两个数据集参加运算时,相同变量有不同的类形。
/* 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;
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