proc sql;
create table umd
as select distinct a.permno, a.date, exp(sum(log(1+b.ret))) - 1 as cum_return
from p (keep=permno date) as a, p as b
where a.permno=b.permno and 0<=intck('month', b.date, a.date)<&J
group by a.permno, a.date
having count(b.ret)=&J;
quit;
出错部分日志如下:
444 %let j=1;
445 %let k=1;
446
447 proc sql;
448 create table umd
449 as select distinct a.permno, a.date, exp(sum(log(1+b.ret))) - 1 as cum_return
450 from p (keep=permno date) as a, p as b
451 where a.permno=b.permno and 0<=intck('month', b.date, a.date)<&J
452 group by a.permno, a.date
453 having count(b.ret)=&J;
NOTE: Invalid (or missing) arguments to the LOG function have caused the function to return a
missing value.
NOTE: Invalid argument to function INTCK. Missing values may be generated.
NOTE: Table WORK.UMD created, with 0 rows and 3 columns.
454 quit;
NOTE: PROCEDURE SQL used (Total process time):
real time 0.03 seconds
cpu time 0.06 seconds作者: shiyiming 时间: 2013-10-22 11:08 标题: Re: 求教函数无效问题 原因是你在第一个data步里面date变量没有定义informat,所以你用intck函数引用的时候SAS是不会认19900918为日期的,只是数值。
[code:184h5x03]input permno date yymmdd8. closeprice@@;[/code:184h5x03]