上一页 1 ··· 61 62 63 64 65 66 67 68 69 ··· 71 下一页

2013年1月25日

【SAS NOTE】用file+put实现结果输出

摘要: 1 data mysas.ifthen10;2 infile 'e:\ifthen.txt' firstobs=2;3 input date yymmn6. gtone shen dong all;4 y=year(date);5 m=month(date);6 format date yymmn6.;7 file 'e:\output.txt' print;8 put y '年' m 'm,getong sms users number is' gtone;9 run; put的好处是可以直接根据变量生成文本结果报告。同时需要注 阅读全文

posted @ 2013-01-25 19:01 colipso 阅读(422) 评论(0) 推荐(0) 编辑

【SAS NOTES】print&format

摘要: proc print data=mysas.sort1; sum gtone shen dong all;run; 可以在print中增加sum选项来直接汇总值。【the little sas book】standard fromats in page 131. 1 data mysas.formatone; 2 infile 'e:\fromatesone.txt' firstobs=2; 3 input gender age; 4 proc format ; 5 value gendera 1='male' 6 2='female... 阅读全文

posted @ 2013-01-25 18:40 colipso 阅读(231) 评论(0) 推荐(0) 编辑

【SAS NOTE】where & time

摘要: 1 proc print data=mysas.ifthen8;2 format date yymmn6.;3 where year(date) < 2010 and month(date)<5;4 run;对时间的筛选处理建议使用year month等函数。在sort中用 Nodupkey DUPOUT=extraobs;可以用来删除重复项。 阅读全文

posted @ 2013-01-25 18:13 colipso 阅读(241) 评论(0) 推荐(0) 编辑

【SAS NOTES】$ / #

摘要: 对于data过程,文本类变量一定要加 $ 同一个observation跨行的话用/ 或#来连接。 阅读全文

posted @ 2013-01-25 13:55 colipso 阅读(285) 评论(0) 推荐(0) 编辑

2013年1月24日

【SAS NOTES】proc contents&OF

摘要: proc contents data=mysas.ifthen6 position;run;用来查看变量顺序【使用变量缩写】/*OF*/data mysas.ifthen8; infile 'e:\ifthen.txt' dlm='09'x firstobs=2; input date yymmn6. sms_gtone sms_shen sms_dong sms_all; sum=sum(OF sms:);run;proc print data=mysas.ifthen8;run;SAS的变量缩写功能很赞,注意的是在OF 后的变量加:一些特殊变量缩写_ALL_ 阅读全文

posted @ 2013-01-24 17:15 colipso 阅读(1067) 评论(0) 推荐(0) 编辑

【SAS NOTES】array+do to

摘要: array的好处是可以通过循环来对变量进行操作。do to sas语句中对于循环的控制。data mysas.ifthen7; infile 'e:\ifthen.txt' dlm='09'x firstobs=2; input date yymmn6. gtone shen dong all; array sms(4) gtone shen dong all; do i=1 to 4; if YEAR(date)=2009 then sms(i)=sms(i)*10; end;run;proc print data=mysas.ifthen7;ru... 阅读全文

posted @ 2013-01-24 16:47 colipso 阅读(568) 评论(0) 推荐(0) 编辑

【SAS NOTES】retain

摘要: data mysas.ifthen5; infile 'e:\ifthen.txt' dlm='09'x firstobs=2; input date gtone shen dong all; retain maxgtone; maxgtone=max(maxgtone,gtone); retain minshen; minshen=min(minshen,shen);run;proc print data=mysas.ifthen5;run;resultObs date gtone shen dong all maxgton... 阅读全文

posted @ 2013-01-24 16:15 colipso 阅读(764) 评论(0) 推荐(0) 编辑

【SAS Notes】If then statements

摘要: 【回顾内容】data mysas.ifthen;infile 'E:\ifthen.txt' dlm='09'x firstobs=2;input date gtone shen dong all;run;1.当数据来源于excel dlm的参数为'09'x in ASCII 09 is the hexadecimal equivalen of a tab character,and the notation '09'x means a hexadecimal 092.firstboservation【if then do end 阅读全文

posted @ 2013-01-24 15:32 colipso 阅读(1146) 评论(0) 推荐(0) 编辑

2012年3月5日

【数据库】因为数据文件有 Unicode 签名

摘要: 数据库直接导入txt文件时受到很多隐含格式的限制,今天碰到问题的解决方案:用UE将Unicode格式的文件转成ASCII 阅读全文

posted @ 2012-03-05 17:47 colipso 阅读(247) 评论(0) 推荐(0) 编辑

2012年2月20日

【excel】自动生成工作表目录

摘要: 手头管理着一个excel文件,有百十来张工作表,于是每次找表格就是一个问题,一个一个的建立工作表目录链接相当麻烦,既然是万能的Excel,让我来试试如何自动建立工作表目录、1、定义名称工作表=RIGHT(GET.WORKBOOK(1),LEN(GET.WORKBOOK(1))-FIND("]",GET.WORKBOOK(1)))2、输出不带链接的工作表名称=INDEX(工作表,ROW(1:1))3、输出带链接的工作表名称=HYPERLINK("#"&INDEX(工作表,ROW(1:1))&"!a1",INDEX(工作表 阅读全文

posted @ 2012-02-20 11:28 colipso 阅读(3675) 评论(0) 推荐(1) 编辑

上一页 1 ··· 61 62 63 64 65 66 67 68 69 ··· 71 下一页

导航