sas

Invoking SAS 9.2 to edit a program from the command line (windows)

。_饼干妹妹 提交于 2020-01-24 15:15:07
问题 I've been Googling for an hour and can't find what should be the easiest thing. I want to invoke SAS from the command line to edit a SAS program. If I do this: C:\Program Files\SAS\SASFoundation\9.2(32-bit)\sas.exe mysasprogram.sas it simply executes mysasprogram.sas. Help! Thanks! 回答1: Create files: E:\sasedit.bat set _pgm=%1 start "start" "C:\Program Files\SASHome\SASFoundation\9.3\sas.exe" -autoexec "E:\autoexec.sas" E:\autoexec.sas %let _pgm=%sysget(_pgm); dm "whost;include '&_pgm';";

Removing “almost duplicates” using SAS or Excel

橙三吉。 提交于 2020-01-24 05:39:06
问题 I am working in SAS and I have a data-set with 2 columns and I want not only to remove the duplicates, but also the "almost" duplicates. The data looks like this: **Brand Product** Coca Cola Coca Cola Light Coca Cola Coca Cola Lgt Coca Cola Cocacolalight Coca Cola Coca Cola Vanila Pepsi Pepsi Zero Pepsi Pepsi Zro i do not know if it is actually possible, but what I would like the file to look like after removing the "duplicates", is like that: **Brand Product** Coca Cola Coca Cola Light Coca

SAS: Execute SAS code using hotkey

女生的网名这么多〃 提交于 2020-01-24 00:53:07
问题 I want to execute code which is independent of my current program via keyboard shortcuts within the Enhanced Editor in SAS 9.4 for Windows. I've achieved this with limited success being able to execute only macro statements. However, I want to be able to execute non-macro statements, too. How do I do this? Here's what I've figured out so far. General Setup Get to the KEYS menu by either entering "KEYS" into the command prompt or submitting dm 'keys'; For one of the keys, enter the definition

浅谈Azure Storage的安全性

不问归期 提交于 2020-01-24 00:33:33
在今天的博文中我们将讨论Azure Storage的安全性以及如何使用共享访问签名(SAS)和存储的访问策略来控制对容器和Blob的访问。SAS基本上是带有查询参数的URI,该查询参数指定诸如到期时间,权限和签名等选项。我将在本文后面详细介绍这些内容。请注意,共享访问签名也可以与表和队列一起使用,但是我将仅在Blob存储方面进行讨论 什么是共享访问签名(SAS) 共享访问签名(SAS)是URI,它允许使用者在指定时间范围具有访问存储资源(例如blob或容器)所允许的权限。时间跨度和权限可以从存储的访问策略中得出,也可以在URI中指定。 可能有得朋友看到这里会提出我使用存储账户密钥就可以了,为什么要使用此功能?因为这允许客户端在不知道我们存储账户密钥的情况下访问存储帐户中的容器和Blob。从安全的角度考虑,如果将存储帐户密钥放在客户端应用程序中,则它可能会遭到******,并且可能会被他人窃取和使用,甚至会用感染了病毒的文件替换正常的文件。使用存储帐户密钥,对存储帐户的访问没有限制。在企业中的实际环境中,无限访问可能不是我们想看到的权限控制场景。 默认的容器权限 在控制对Blob存储的访问时,首先要使用容器权限。可以将blob存储中每个容器的权限设置为如下权限之一: Private:禁止公众访问Blob或容器 Blob:Blob的公共读取权限 Container

In SQL, is HAVING processed before or after SELECT?

眉间皱痕 提交于 2020-01-23 01:15:14
问题 I was surprised to find that the following works: SELECT name, height * weight as inchpounds FROM sashelp.class HAVING inchpounds > 5000; Since I thought the HAVING clause was processed strictly before the SELECT clause. Is this in fact a false assumption on my part? Or is this peculiar to SAS's implementation of SQL? 回答1: Strictly speaking, and if I remember well, the SQL standard define HAVING clause to be processed before the SELECT clause. So, an alias defined in the SELECT, cannot be

Use SAS proc expand for filling missing values

给你一囗甜甜゛ 提交于 2020-01-17 06:22:30
问题 I have the following problem: I want to fill missing values with proc expand be simply taking the value from the next data row. My data looks like this: date;index; 29.Jun09;-1693 30.Jun09;-1692 01.Jul09;-1691 02.Jul09;-1690 03.Jul09;-1689 04.Jul09;. 05.Jul09;. 06.Jul09;-1688 07.Jul09;-1687 08.Jul09;-1686 09.Jul09;-1685 10.Jul09;-1684 11.Jul09;. 12.Jul09;. 13.Jul09;-1683 As you can see for some dates the index is missing. I want to achieve the following: date;index; 29.Jun09;-1693 30.Jun09;

Import unsorted data from a notepad file(.txt) into SaS

a 夏天 提交于 2020-01-17 06:21:30
问题 I have a big text file and it contains 3 tables. The records in the file are unsorted, the records in the file are in line with the column name separated by space. The tables are repeating themselves until the end. I want to import the data from that notepad file under correct table into SAS. I want to read the records and column names from the text file and put them under correct table In SAS. I tried through INFILE and I was successful in importing the data into SAS, but since Columns are

Determine rates of change for different groups

杀马特。学长 韩版系。学妹 提交于 2020-01-17 02:22:05
问题 I have a SAS issue that I know is probably fairly straightforward for SAS users who are familiar with array programming, but I am new to this aspect. My dataset looks like this: Data have; Input group $ size price; Datalines; A 24 5 A 28 10 A 30 14 A 32 16 B 26 10 B 28 12 B 32 13 C 10 100 C 11 130 C 12 140 ; Run; What I want to do is determine the rate at which price changes for the first two items in the family and apply that rate to every other member in the family. So, I’ll end up with

Generate multiple lags through loops in SAS?

老子叫甜甜 提交于 2020-01-16 09:07:50
问题 I'm trying to generate 20 lags for a variable. To generate the first lag, I use the following statement: data temp.data2; set temp.data1; by gvkey fyear; lag1 = ifn(gvkey=lag(gvkey) and fyear=lag(fyear)+1,lag(mv),.); lag2 = ifn(gvkey=lag(gvkey) and fyear=lag(fyear)+1,lag(lag1),.); etc. run; Don't want to repeat 20 times. Is there a way to do this through a loop? Thanks a lot! 回答1: You would have to maintain your own array of mv values and assign the lag values from that. The array would be

SAS PROC Transpose Data

ぐ巨炮叔叔 提交于 2020-01-16 04:50:13
问题 In SAS, I have a data set similar to the one below. ID TRACT meanFA sdFA medianFA 1 t01 0.56 0.14 0.56 1 t02 0.53 0.07 0.52 1 t03 0.71 0.08 0.71 2 t01 0.72 0.09 0.72 2 t02 0.83 0.10 0.86 2 t03 0.59 0.10 0.62 I am not sure if transpose is the right concept here... but I would want the data to look like the one below. ID t01_meanFA t01_sdFA t01_medianFA t02_meanFA t02_sdFA t02_medianFA t03_meanFA t03_sdFA t03_medianFA 1 0.56 0.14 0.56 0.53 0.07 0.52 0.71 0.08 0.71 2 0.72 0.09 0.72 0.83 0.10 0