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 阅读(571) 评论(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 阅读(767) 评论(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 阅读(1147) 评论(0) 推荐(0) 编辑

导航