SAS中文论坛

标题: 请问高手:这是什么错误,如何修改呢? [打印本页]

作者: shiyiming    时间: 2003-10-14 10:36
标题: 请问高手:这是什么错误,如何修改呢?
<!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarassed" /><!-- s:oops: -->
data stacey.laydown1;
set stacey.laydown1;
format
        xjoin date7.
;
xjoin=.;
if _n_le 13 then xjoin=intnx('day','08dec00'd,_n_);
if _n_gt 13 then xjoin=intnx('day','02jan01'd,_n_-13);
run;

LOG窗口:
56   data stacey.laydown1;
57   set stacey.laydown1;
58   format
59       xjoin date7.
60   ;
61   xjoin=.;
NOTE: SCL source line.
62   if _n_le 13 then xjoin=intnx('day','08dec00'd,_n_);
              --
              388
                 ----
                 202
NOTE: SCL source line.
63   if _n_gt 13 then xjoin=intnx('day','02jan01'd,_n_-13);
              --
              388
                 ----
                 202
ERROR 388-185: Expecting an arithmetic operator.

ERROR 202-322: The option or parameter is not recognized and will be ignored.

64   run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set STACEY.LAYDOWN1 may be incomplete.  When this step was stopped there
         were 0 observations and 16 variables.
WARNING: Data set STACEY.LAYDOWN1 was not replaced because this step was stopped.
NOTE: DATA statement used:
      real time           0.01 seconds
      cpu time            0.01 seconds
作者: shiyiming    时间: 2003-10-14 12:22
标题: Re: 请问高手:这是什么错误,如何修改呢?
[quote=&quot;bluecrystal&quot;:797f7]:oops:
if _n_le 13 then xjoin=intnx('day','08dec00'd,_n_);
if _n_gt 13 then xjoin=intnx('day','02jan01'd,_n_-13);
[/quote:797f7]

改为:

if _n_ le 13 then xjoin=intnx('day','08dec00'd,_n_);
if _n_ gt 13 then xjoin=intnx('day','02jan01'd,_n_-13);

建议不要再用这么晦涩的语句:lt/gt,直接用“&lt;”和“&gt;”好了! <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: -->




欢迎光临 SAS中文论坛 (http://mysas.net/forum/) Powered by Discuz! X3.2