随笔分类 -  sas

所有sas的相关资料都在这
摘要:data me;put _n_= x=; /*******1******/ input x/*input这里是读入缓冲流的关键步骤变量是从缓冲流中取出数据,根据缓冲流中指针的位置来获取变量信息*/;/*INPUT statement causes SAS to read the first... 阅读全文
posted @ 2015-07-06 13:44 暴走的豆浆 阅读(6153) 评论(0) 推荐(0) 编辑
摘要:append过程proc datasets lib=work nolist; delete null;quit;*程序运行前清空null数据集,防止重复拼接;proc append base=null data=sashelp.class(where=(sex='女'));run;*将class的... 阅读全文
posted @ 2015-07-06 13:36 暴走的豆浆 阅读(2338) 评论(0) 推荐(0) 编辑
摘要:datasets相关选项的运用proc datasets library =sashelp nolist; copy in=sashelp out=work; select air class vslib ac ets; *先于copy执行;quit; proc datasets lib... 阅读全文
posted @ 2015-07-06 13:35 暴走的豆浆 阅读(4950) 评论(0) 推荐(0) 编辑
摘要:输出数据集的最后一条观测值*使用nobs+point选项,这个更划算,第二个必须把整个数据集全部读入;data b; set sashelp.class nobs=last point=last; output; stop;run;*使用end选项;data a; set s... 阅读全文
posted @ 2015-07-06 13:34 暴走的豆浆 阅读(1867) 评论(0) 推荐(0) 编辑
摘要:1:控制sas数据存储空间大小1.1:缩减字符变量存储空间sas怎么存储字符变量?对于赋值情况的字符型变量,变量的长度依据第一个值得长度比如name=yi(那么name的长度即为2),然后再给其赋值name=can,那么只会读入ca对于datalines读入或从外部数据集中读入的数据,sas默认为字... 阅读全文
posted @ 2014-12-01 20:22 暴走的豆浆 阅读(5655) 评论(0) 推荐(0) 编辑
摘要:Understanding Joins1.Joins combine tables horizontally (side by side) by combining rows. The tables being joined are not required to have the same num... 阅读全文
posted @ 2014-12-01 20:20 暴走的豆浆 阅读(27070) 评论(1) 推荐(2) 编辑
摘要:1:防止不必要的排序下面四种方式可以防止排序的进行􀀀1.1:BY-group processing with an index to avoid a sort在以下情况下,by语句不会用索引the BY statement includes theDESCENDING or NOTSORTED o... 阅读全文
posted @ 2014-11-30 19:54 暴走的豆浆 阅读(4703) 评论(0) 推荐(0) 编辑
摘要:1:where和If最本质的区别,以及一些小的区别1.1:The WHERE statement examines what is in the input page buffer and selectsobservations before they are loaded in the progr... 阅读全文
posted @ 2014-11-30 14:21 暴走的豆浆 阅读(5492) 评论(0) 推荐(0) 编辑
摘要:transpose基本语法Note: If output-data-set does not exist, PROC TRANSPOSE creates it by using theDATA n naming convention. 􀀀Note: If you omit the VAR stat... 阅读全文
posted @ 2014-11-28 19:21 暴走的豆浆 阅读(3134) 评论(0) 推荐(0) 编辑
摘要:CPU time:the amount of time the central processing unit (CPU) uses toperform requested tasks such as calculations, reading and writingdata, conditiona... 阅读全文
posted @ 2014-11-27 18:08 暴走的豆浆 阅读(3812) 评论(0) 推荐(0) 编辑
摘要:SAS读取小工具 1:Column-Pointer Controls @n : move the pointer to the n column in the input buffer. +n : move the pointer forward n columns in the i... 阅读全文
posted @ 2014-11-20 22:10 暴走的豆浆 阅读(9509) 评论(0) 推荐(0) 编辑
摘要:1:Proc sql中的选项1.1:INOBS/OUTOBS=这个选项意思在前面的随笔中已说过,就INOBS这里有个例子这里的INOBS=5是针对于两张表分别读入5个,而不是一共读入五个1.2:NUMBER/NONUMBER效果如下1.3:Double/NoDoubleDouble Spacing ... 阅读全文
posted @ 2014-11-18 22:33 暴走的豆浆 阅读(1786) 评论(0) 推荐(0) 编辑
摘要:什么是视图?视图是一系列的查询语句,在使用时被执行,用来从其他的数据集或视图中获取想要的子集(subset)或者超集(superset)。The view contains only the logicfor accessing the data, not the data itself视图能用在哪... 阅读全文
posted @ 2014-11-18 00:01 暴走的豆浆 阅读(3641) 评论(0) 推荐(0) 编辑
摘要:update / insert into后面不需要加table关键字1:三种建表方式建表只会在库中建立好表格并在日志中显示,并不会有输出。1.1:自己定义列来建立一张空表column-specification = column-define + column-constriants + MESSA... 阅读全文
posted @ 2014-11-16 13:55 暴走的豆浆 阅读(12740) 评论(0) 推荐(2) 编辑
摘要:SQL进行纵向操作的基本语法proc sql;select *from table1set-operator select *from table2set-operator select *from table3;1:几种set操作符Except、Intersect、Union、OuterJoi... 阅读全文
posted @ 2014-11-14 23:09 暴走的豆浆 阅读(10636) 评论(0) 推荐(0) 编辑
摘要:1.1:Specifying Column Formats and Labels (SAS enhancements.)proc sql outobs=15; title 'Current Bonus Information'; title2 'Employees with Sa... 阅读全文
posted @ 2014-11-14 19:30 暴走的豆浆 阅读(1299) 评论(0) 推荐(0) 编辑
摘要:index : 字符函数 数值函数 日期含糊 SCL函数 特殊函数/**********************字符函数******************************/Compress();功能:消除或保留指定的字符I or i: ignores the case of the cha... 阅读全文
posted @ 2014-11-13 10:53 暴走的豆浆 阅读(3212) 评论(0) 推荐(0) 编辑
摘要:Sas proc sql与寻常sas语句的的不同之处1:The PROC SQL step does not require a RUN statement. PROC SQL executes each query automatically2:Unlike many other SAS pr... 阅读全文
posted @ 2014-11-11 14:40 暴走的豆浆 阅读(9656) 评论(0) 推荐(0) 编辑
摘要:1:获取数据集前几行观测proc sql outobs=5; *outobs选项只限制显示的行数,并不限制读入的行数. inobs=选项可以限制读入的行数; select * from sashelp.class;quit;data res; set sashelp.cl... 阅读全文
posted @ 2014-11-11 14:40 暴走的豆浆 阅读(3851) 评论(0) 推荐(0) 编辑
摘要:确定文件中一行的长度。LRECL= specifies the physical line length of the file. LINESIZE= tells the INPUT statement how much of the line to read.DropOver以及不用此选项的默认执... 阅读全文
posted @ 2014-08-07 21:08 暴走的豆浆 阅读(1719) 评论(0) 推荐(0) 编辑