我是试用从WRDS 上下载的SAS code做的动量策略,例子里的数据是从CRSP 上下载的美国股市1965-1989的数据(sas格式),用这个的时候,这组code运行的很好,结果也和例子一样,可是当我换了一组变量名称一样的excel格式的数据时,系统出现了好多错误,这是怎么回事啊?我在换数据的时候,名称都对应和例子里的一样!而且我sas9.1和8.2两个版本都试了,都是一样的结果!请教高手这是为什么?下面是错误的地方:
178 proc sql;
179 create table umd
180 as select distinct a.permno, a.date, exp(sum(log(1+b.ret))) - 1 as cum_return
181 from msex2 (keep=permno date) as a, msex2 as b
182 where a.permno=b.permno and 0<=intck('month', b.date, a.date)<&J
183 group by a.permno, a.date
184 having count(b.ret)=&J;
ERROR: Expression using addition (+) requires numeric types.
ERROR: Function INTCK requires a numeric expression as argument 2.
ERROR: Function INTCK requires a numeric expression as argument 3.
ERROR: Expression using less than or equal (<=) has components that are of different data types.
ERROR: Function INTCK requires a numeric expression as argument 2.
ERROR: Function INTCK requires a numeric expression as argument 3.
ERROR: Expression using less than (<) has components that are of different data types.
185 quit;