2013年2月1日

【SAS NOTES】kindex判断字符串中是否含某子字符串& 用where在data步中选择部分数据

摘要: Syntax KINDEX(source, excerpt)Argumentssource specifies the character expression to search.excerpt specifies the string of characters to search for in the character expression.Tip: Enclose a literal string of characters in quotation marks.------------------------------------------------------------- 阅读全文

posted @ 2013-02-01 16:18 colipso 阅读(6584) 评论(0) 推荐(0) 编辑

【SAS NOTES】proc sql

摘要: 1 proc sql;2 select pay_month,count(distinct(serv_number)) from guanhui.buedetail_same group by pay_month;3 quit;在sas中直接写sql语句并用ods进行输出是一个做分析处理的好方法。 阅读全文

posted @ 2013-02-01 15:30 colipso 阅读(406) 评论(0) 推荐(0) 编辑

【SAS NOTES】字符串处理函数

摘要: 1.Missing(),如果变量有缺失值,则返回真。如data test_miss; set learn.blood; if missing(Gender) then MissGender + 1; if missing(WBC) then MissWBC + 1; if missing(RBC) then MissWBC + 1; if Chol lt 200 and not missing(Chol) then Level = 'Low '; else if Chol ge 200 then Level = 'High';run;当变量名形如x1-x5... 阅读全文

posted @ 2013-02-01 11:40 colipso 阅读(6549) 评论(0) 推荐(0) 编辑

【SAS NOTES】proc tabulate遇到的问题

摘要: 仍然是由于脏数据引起的问题。在日期字段上正常值为2012-01-01 01:54:58 但某个月的某部分值却为40909.0149537037这种形式,于是在处理的时候这部分的日期就会有问题。但另有年月字段,所以单以该字段统计月就没有问题,如果和天,小时放到一起统计,那么对时间不正常的观测值就会忽略。1 proc tabulate data=a;2 class pay_month weekday hour;3 var fee;4 table pay_month,(n max min mean sum median)*fee;5 table weekday,(n ... 阅读全文

posted @ 2013-02-01 11:38 colipso 阅读(996) 评论(0) 推荐(0) 编辑

【SAS NOTES】将文本转化为数据格式 input()

摘要: fee=input(fee_a,best.) 阅读全文

posted @ 2013-02-01 09:56 colipso 阅读(755) 评论(0) 推荐(0) 编辑

导航