SAS中文论坛

标题: WHERE是否使用不当? [打印本页]

作者: shiyiming    时间: 2004-5-10 03:19
标题: WHERE是否使用不当?
Proc iml;
Use sashelp.class;   
Show datasets;
Show contents;
List all;
list point 5;
list point {2 3 4} var{age height weight} where(sex='M')
where(name=*{"JON","JAN"})
where (name=:"J")
where (name?"AL")
read all var _num_ into x;

提交上述语句后不能正常执行,加入;后也不行,请问是什么原因?谢谢了
作者: shiyiming    时间: 2004-5-10 13:08
标题: 是不是这样?
Proc iml;
Use sashelp.class;
Show datasets;
Show contents;
List all;
list point 5;
list point {2 3 4} var{age height weight} where(sex='M')
where(name=*{"JON","JAN"})
where (name=:"J")
where (name?"AL") ;
read all var _num_ into x;
run;
作者: shiyiming    时间: 2004-5-10 16:37
楼上的好像什么也没做啊!

我试了一下,不是输不出来,是观察2,3,4一个也不满足你的where条件,

所以不会输出观测!

试试下面的:
Proc iml;
Use sashelp.class;
Show datasets;
Show contents;
List all;
list point 5;
list point {2 3 4} var{age height weight}
where(sex='F')
where(name=*{"JON","JAN"})
where (name=:"J")
where (name?"Al") ;
read all var _num_ into x;
run;
quit;




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