2013年2月18日

【sas sql proc】case end

摘要: 在sql中增加case可以增加数据处理的灵活性,注意结尾的end 1 proc sql outobs=10; 2 title 'this is an example of sql and case'; 3 select wangnei,date, 4 case 5 when 200901<=date<=200903 then 'first' 6 when 200904<=date<=200906 then 'second' 7 else 'else' 8 en... 阅读全文

posted @ 2013-02-18 22:14 colipso 阅读(2061) 评论(0) 推荐(0) 编辑

【sas proc sql】引用计算产生的列

摘要: 在proc sql中引用计算产生的列,前面必须加上calculated例如1 proc sql outobs=5;2 title 'this is an example of sql and outobs';3 select wangnei,date,'test','测试',wangnei+1 as wang,wangnei+10 as wanga,(calculated wang+calculated wanga) as wangb4 from mysas.mmsone5 where date<2009056 order by wangn 阅读全文

posted @ 2013-02-18 22:02 colipso 阅读(679) 评论(0) 推荐(0) 编辑

【sas sql proc】proc sql; quit;

摘要: proc sql 是以quit结束,而非run 1 proc print data=mysas.mmsone (obs=10); 2 run; 3 proc sql; 4 title 'this is an example of proc sql'; 5 select sum(wangnei) as a,date 6 from mysas.mmsone 7 where date<200904 8 group by date 9 having date in(200901,200902)10 order by a desc;11 quit;... 阅读全文

posted @ 2013-02-18 21:22 colipso 阅读(1305) 评论(0) 推荐(0) 编辑

【SAS NOTE】实践

摘要: 1 proc format; 2 value numgroup 3 low-10='1~10' 4 11-50='10~50' 5 51-100='50~100' 6 101-500='100-500' 7 500-high='>500'; 8 run; 9 ods html file="E:\11月统计.xls";10 proc means data=guanhui.visit_ip_num (where=(month=11)) n;11 var number;12 class numb 阅读全文

posted @ 2013-02-18 11:43 colipso 阅读(236) 评论(0) 推荐(0) 编辑

导航