求助日期存贮方式是12OCT2012时,我用了下面红色字体这种方式读取是可以的。
data temp_day&i.;
set or.vp_op_np_pack;
where
cal_date="&&cal_date&i."d;
run;
但现在遇到这种方式存贮的日期20121015,尝试了以下几种方式读取都不行;
cal_date="&&cal_date&i."d;
ERROR: Invalid date/time/datetime constant "20121015"d.
ERROR: Syntax error while parsing WHERE clause.
cal_date="&&cal_date&i.";
ERROR: WHERE clause operator requires compatible variables.
cal_date=&&cal_date&i.
ERROR: Some character data was lost during transcoding in the dataset WORK.TEMP_DAY1. Either the data
contains characters that are not representable in the new encoding or truncation occurred
during transcoding.
然后想把日期换成最开始那种存贮方式,我查到说这种格式叫DATE9. 然后用了format如下,但还是不行。
format cal_date DATE9.;
ERROR: Some character data was lost during transcoding in the dataset WORK.TEMP_DAY2. Either the data
contains characters that are not representable in the new encoding or truncation occurred
during transcoding.
求指教,非常感谢!