程序A:data weather;
input year month day hour temp;
datetime = dhms(mdy(month, day, year), hour, 0, 0);
format datetime datetime10.;
cards;
91 10 16 21 61
91 10 17 0 56
91 10 17 3 53
91 10 17 6 54
91 10 17 9 65
91 10 17 12 72
;
run;
proc gplot data=weather;
symbol i=spline v=star h=2 r=1;
plot temp * datetime;
run;
==============
这个程序没有问题,可以运行。
程序B:
data weather;
input datetime datetime10. temp;
format datetime datetime10.;
hour = hour(datetime);
date = datepart(datetime);
year = year(datetime);
month = month(datetime);
day = day(datetime);
cards;
16oct91:21 61
17oct91:00 56
17oct91:03 53
17oct91:06 54
17oct91:09 65
17oct91:12 72
;
run;
proc print;
var year month day hour temp;
run;
=======
这个程序一定要在A运行后才可以运行,如果我重新打开SAS,直接运行B的话,会出现这个错误提示
这说明B要使用A里面format的定义吗?怎么修改B程序让B可以独立运行啊?