全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
6415 1
2012-02-02
悬赏 14 个论坛币 未解决
运行程序,提示
ERROR: 用 等于 (=) 的表达式具有不同数据类型的组件

但是我用proc contents 看了,&d2 和
数据库中的字段F3_1158都是字符8,这是为什么?如何才能正确调用?
另,我用了 like ,还是出错。


%macro WindFetch2(chkDate);
/*Below is Financial indicators 1158*/
data c;
length dd $8;
format dd $8.;
informat dd $8.;
Dyear = substr(&chkDate,1,4);
Dmonth = substr(&chkDate,5,2);
if dmonth in (1 2 3 4 ) then DD= compress(dyear-1||'0630');
else if dmonth in (5 6 7 8 ) then DD= compress(dyear-1||'1231');
else DD= compress(dyear||'0630');
put dyear dmonth dd;
call symput('d2',dd);
run;

proc sql;  
create table a as
select b.F4_1158,b.F5_1158,b.F3_1158,b.F9_1158
from wind.tb_object_1090 as a,wind.tb_object_1158 as b
where a.OB_REVISIONS_1090=b.F1_1158 and a.F4_1090='A'
and a.F16_1090='000002' and b.F3_1158=&d2
order by b.F3_1158;
quit;
%mend;
%WindFetch2('20100331')
二维码

扫码加我 拉你入群

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

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

全部回复
2012-2-3 03:57:35
b.F3_1158="&d2"
jingju
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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