sas

How to extract words between 2 parentheses in Unix/ Linux?

我是研究僧i 提交于 2020-01-16 04:43:09
问题 I have a SAS dataset with the list of queries as one of the variable. Below is one of the variable value: SELECT * FROM ( SELECT Table1 file2.txt file.txt QUEUES QDefinitions Parameters TRAP-Deposit-DSTran.dat.2016-08-07 FROM CS_CASE WHERE ANT_CD='FI_BASE_TENANT')t1 LEFT OUTER JOIN Table2 t2 ON t2.CASE_ID=t1.CASE_ID LEFT OUTER JOIN Table3 t3 ON t3.SERVICE_XID=t1.SERVICE_XID LEFT OUTER JOIN Table4 t4 ON t4.SERVICE_ID=t1.SERVICE_ID WHERE ( t1.CASESTATUs_CD = (NEW) OR t1.CASE_STATUS_CD = (OPEN)

SAS: creating multiples files from multiple data sets

落花浮王杯 提交于 2020-01-16 00:54:08
问题 I have 24 datasets that are structured in the same way. By that I mean the same column headers (time, date, price, stock symbol), data set structure etc. I don't wish to append all 24 files since one data set is to big to handle. I named all my data sets with the name "file1 file2 file3 file4....up to file24". What I want to do is the following: For example change the date format in all of my 24 files at once; Be able to extract from each file# a specific stock symbol like 'Dell' and append

SAS: iterate from beginning to end date in a macro

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-16 00:46:33
问题 I have a dataset like this: DATA tmp; INPUT identifier $ d0101 d0102 d0103 d0104 d0105 d0106 d0107 d0108 d0109 d0110 d0111 d0112 ; DATALINES; a 1 2 3 4 5 6 7 8 9 10 11 12 b 4 5 7 4 5 6 7 6 9 10 3 12 c 5 2 3 5 5 4 7 8 3 1 1 2 ; RUN; And I'm trying to create a dataset like this: DATA tmp; INPUT identifier $ day value ; DATALINES; a '01JAN2018'd 1 a '02JAN2018'd 2 a '03JAN2018'd 3 a '04JAN2018'd 4 a '05JAN2018'd 5 a '06JAN2018'd 6 a '07JAN2018'd 7 a '08JAN2018'd 8 a '09JAN2018'd 9 a '10JAN2018'd

SAS creating a dynamic interval

孤者浪人 提交于 2020-01-15 11:05:38
问题 This is somewhat complex (well to me at least). Here is what I have to do: Say that I have the following dataset: date price volume 02-Sep 40 100 03-Sep 45 200 04-Sep 46 150 05-Sep 43 300 Say that I have a breakpoint where I wish to create an interval in my dataset. For instance, let my breakpoint = 200 volume transaction. What I want is to create an ID column and record an ID variable =1,2,3,... for every breakpoint = 200. When you sum all the volume per ID, the value must be constant across

SAS creating a dynamic interval

天涯浪子 提交于 2020-01-15 11:04:29
问题 This is somewhat complex (well to me at least). Here is what I have to do: Say that I have the following dataset: date price volume 02-Sep 40 100 03-Sep 45 200 04-Sep 46 150 05-Sep 43 300 Say that I have a breakpoint where I wish to create an interval in my dataset. For instance, let my breakpoint = 200 volume transaction. What I want is to create an ID column and record an ID variable =1,2,3,... for every breakpoint = 200. When you sum all the volume per ID, the value must be constant across

SAS Conditional row highlighting with ODS and Proc Print

£可爱£侵袭症+ 提交于 2020-01-15 10:11:22
问题 I want to turn the entire row red for people whose names begin with 'J'. Is this possible using proc print ? ods html file=odsout style=htmlblue ; proc print data=sashelp.class noobs label; var name age; run; ods html close; 回答1: I don't believe it's possible with PROC PRINT. PROC REPORT can generate the identical output but with the rows red, however. Identical: proc report data=sashelp.class nowd; columns name age; run; With red: proc report data=sashelp.class nowd; columns name age;

Note 4 -- sas中数据步常用语句

天大地大妈咪最大 提交于 2020-01-15 09:45:59
《SAS统计分析实用宝典》学习摘要 一、赋值语句 在sas系统中,赋值语句用于将表达式计算的值赋予指定的变量,其调用的基本格式为: 变量 = 表达式 其中,变量可以是一个sas系统中已经存在的变量而对其原值进行覆盖,也可以是用户在此新建的一个变量;但需要注意的是右边表达式中所有涉及的变量均要是已经存在的且已经被赋值的变量。 如在Note3中的语句: avg = ( math + chinese + english + physics + chemistry ) / 5 ; 二、input 语句 input 语句用于向sas中读入数据的模式限制,有列表模式和列模式两种。 1、列表模式 列表模式的Input语句基本格式: input 变量名 [ $ ] [ 选项 ] [ @ / @@ ] 变量名:为人为设定的数据各列的名称。 [$]:表示如果该列(字段)是字符串类型的则要在变量名后加上美元号。 [选项]:可用于设置输入数据的格式。 input语句由于是在代码界面输入数据的,故其默认的变量分隔符为空格(因为输入时可以人为输入),对于其他分隔符(逗号,制表符等),需要通过infile语句进行设置,设置的方式为“ infile 文件路径 dlm = ‘分隔符’ ”或“ infile cards dlm = ‘分隔符’ ”。 读取的字符型数据的默认长度为8个字符,如果超过

R 语言 简介

隐身守侯 提交于 2020-01-15 07:46:50
一.统计分析软件说明 统计分析软件有:SPSS, SAS、R语言,Matlab,S-PLUS,S-Miner。 SPSS: 最简单的,都是菜单操作,不过不利于二次程序开发。 SAS: 需要购买,该软件录入语言要非常精确,不能出错,难操作。 R语言:免费软件,可以菜单操作,不过一般要编程的,二次程序开发。 Matlab:基本是程序操作,和R语言差不多,不过功能比较强大。 S-PLUS: 需要购买,基本也是菜单操作,和SPSS差不多。 R与SPSS、SAS相比较,拥有非常突出的优势: 1)产品线齐全。在功能与产品线齐全上已经远远超出SPSS,而与SAS不相上下。有些R的包,比如基因分析常用的Bioconductor在在线基因数据库连接等众多功能上甚至已经远远超出商业软件。 2)免费。请注意,标记为TM或者®符号的软件均需要在SPSS、SAS的基础模块基础之上另行购买,费用往往在千元美元以上。而R的一切功能均是免费。 3)开放。由于R本身是一个统计语言环境,再新的统计模型也很快能实现,所以在结构方程模型、项目反应理论、认知诊断等众多心理测量所使用的功能上,没有现成的统计软件包,使用R则完全可以自己编写算法。同样,由于R是完全开源,我们可以很快地基于研究者已经开发出的算法编写更适合自己情况的算法。 表:R与SAS、SPSS之比较 主题 SAS产品线 SPSS产品线 R语言相关包 高级模块

R 语言 简介

做~自己de王妃 提交于 2020-01-14 07:03:58
一.统计分析软件说明 统计分析软件有:SPSS, SAS、R语言,Matlab,S-PLUS,S-Miner。 SPSS: 最简单的,都是菜单操作,不过不利于二次程序开发。 SAS: 需要购买,该软件录入语言要非常精确,不能出错,难操作。 R语言:免费软件,可以菜单操作,不过一般要编程的,二次程序开发。 Matlab:基本是程序操作,和R语言差不多,不过功能比较强大。 S-PLUS: 需要购买,基本也是菜单操作,和SPSS差不多。 R与SPSS、SAS相比较,拥有非常突出的优势: 1)产品线齐全。在功能与产品线齐全上已经远远超出SPSS,而与SAS不相上下。有些R的包,比如基因分析常用的Bioconductor在在线基因数据库连接等众多功能上甚至已经远远超出商业软件。 2)免费。请注意,标记为TM或者®符号的软件均需要在SPSS、SAS的基础模块基础之上另行购买,费用往往在千元美元以上。而R的一切功能均是免费。 3)开放。由于R本身是一个统计语言环境,再新的统计模型也很快能实现,所以在结构方程模型、项目反应理论、认知诊断等众多心理测量所使用的功能上,没有现成的统计软件包,使用R则完全可以自己编写算法。同样,由于R是完全开源,我们可以很快地基于研究者已经开发出的算法编写更适合自己情况的算法。 表:R与SAS、SPSS之比较 主题 SAS产品线 SPSS产品线 R语言相关包 高级模块

Convert Date to String in SAS data step monyy5. to yymmn6

雨燕双飞 提交于 2020-01-14 05:23:11
问题 In SAS EG, in a data step, I am trying to convert from a date to a string in the following formats: JUN18 to '201806' I am able to convert the opposite direction using a data step as follows: data date; length b $6; b='201806'; new_b=input(b, yymmn6.); format new_b monyy5.; The result is that new_b = JUN18 . I have tried the opposite direction and something is just off and I can't figure out what I am missing. Does anyone know how to convert these data types? Thanks. 回答1: Use the PUT or PUTN