sas实例合集
2015-07-06 13:34
621 查看
输出数据集的最后一条观测值
输出by组的第一条或最后一条观测值到新的数据集
*使用nobs+point选项,这个更划算,第二个必须把整个数据集全部读入; data b; set sashelp.class nobs=last point=last; output; stop; run; *使用end选项; data a; set sashelp.class end=last; if last then output; run;
输出by组的第一条或最后一条观测值到新的数据集
*获得最后一条用last,也可以在排序的时候就用降序排序; data a; input x y @@; cards; 1 20 1 10 1 30 2 40 2 50 ; run; /*proc sort data=b nodupkey out=c;by x;run;*/ proc sort data=a out=b;by x y;run; data b_if; set b; by x; if first.x then output; run;
/*效率高于and?我觉得这个效率一样*/ if status1 = 1 then if status2 = 5 then if status4 = 9 then output; if status1=1 and status2=5 and status4=9 then output; /*效率高于or,or需要判断所有的*/ if status in (1 2 3) then x=1; if status=1 or status=2 or status=3 then x=1;
相关文章推荐
- Linux常用命令记录
- 实战Memcached缓存系统(4)Memcached的CAS协议
- Jquery+highchart+ajax
- android控制文件:ViewPager+Fragment+GridView使用(与AndroidQuery框架结合)
- 请把你的时间精力用于创造价值
- Farseer.net轻量级ORM开源框架 V1.x 入门篇:视图实体类映射
- 获取其他进程listctrl的内容
- Navigationbar 右侧按钮
- 通过使用浏览器对象模型,输出当前浏览器窗口中打开的文档的URL信息,并将显示在窗口中。
- android开发:把指定的日志输出到指定的文件
- 实战Memcached缓存系统(3)Memcached配置参数初解
- win8 远程桌面时提示凭证不工作问题的终极解决办法
- [LeetCode][JavaScript]Power of Two
- 资源调处理 (10000变成1W 和 值是100 1.2.3. 到100)
- 小兔的棋盘 2067
- TOMCAT 独立用户启动配置 安全部署
- linux 退出vi
- rhel启用xdmcp
- android数据储存
- session过期后自动跳转到登陆页