全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学
3015 3
2008-03-25
<p>174  data jjj;<br/>175  set hhh;<br/>176  where date>'01mar07'd & date<'01mar08'd;<br/>ERROR: Where clause operator requires compatible variables.<br/>177  run;</p><p>NOTE: The SAS System stopped processing this step because of errors.<br/>WARNING: The data set WORK.JJJ may be incomplete.  When this step was stopped there were 0<br/>         observations and 3 variables.<br/>WARNING: Data set WORK.JJJ was not replaced because this step was stopped.<br/>NOTE: DATA statement used:<br/>      real time           0.04 seconds<br/>      cpu time            0.04 seconds</p><p><br/>178  proc transpose data=jjj out=trans;<br/>179    var xssl;<br/>180    by date;<br/>181  where date>'01mar07'd & date<'01mar08'd;<br/>ERROR: Where clause operator requires compatible variables.<br/>182  run;</p><p>NOTE: The SAS System stopped processing this step because of errors.<br/>WARNING: The data set WORK.TRANS may be incomplete.  When this step was stopped there were 0<br/>         observations and 0 variables.<br/>WARNING: Data set WORK.TRANS was not replaced because this step was stopped.<br/>NOTE: PROCEDURE TRANSPOSE used:<br/>      real time           0.03 seconds<br/>      cpu time            0.03 seconds</p><p>183  title"变换数据集";</p><p><br/>184  proc print data=trans;<br/>185  run;</p><p>NOTE: Writing HTML Body file: sashtm2.htm<br/>NOTE: There were 1 observations read from the data set WORK.TRANS.<br/>NOTE: PROCEDURE PRINT used:<br/>      real time           0.12 seconds<br/>      cpu time            0.01 seconds</p><p>附加我选用导入的数据的EXCEL格式<br/><br/></p>
200660.rar
大小:(174.22 KB)

 马上下载

本附件包括:

  • yum.csv

<br/>
二维码

扫码加我 拉你入群

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

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

全部回复
2008-3-25 17:52:00
<p>data jjj;<br/>set hhh;<br/>where <u>date&gt;'01mar07'd</u> &amp; <u>date&lt;'01mar08'd</u>;<br/>run;</p><p>我想错误应该在划线部分:date&gt;'01mar07',这里用&gt;的话说明date是数值型变量,但是后面的取值01mar07不是数值型,是datetime型变量。需要将其转化成数值型变量才能使用此语句。</p><p></p>
二维码

扫码加我 拉你入群

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

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

2008-3-28 17:11:00
<font size="3">给你写了一个参考程序:<br/>data b ;<br/>    set a ;<br/>    b = input(a, yymmdd10.) ;<br/>    if b &gt;= input('2007/10/01', yymmdd10.)  and b &lt;=  input('2007/10/31', yymmdd10.)  then c = 1;<br/>run ;<br/><br/>这么做才能达到目的~~~<br/></font>
二维码

扫码加我 拉你入群

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

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

2008-3-30 16:51:00
<p>我觉得是你EXCEL文件里的日期格式错了。</p><p>如果都改为01mar07这样的格式,估计就没有问题了。<br/></p>
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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