sas

What's the easiest way to use SQLite with SAS?

I want to investigate how to access SQLite DB from SAS. What's the easiest way of doing this? Is there a SAS product that we can license to do that? I don't want to use ODBC drivers as that seems to have been written a long time ago and is not officially part of SQLite. ...

SAS: Reading web pages over HTTPS 9.1.3 versus 9.2

I'm trying to do a simple task of reading a file from a webpage in to SAS. This is something I do regularly over HTTP connections but the first time I've done it with HTTPS. I am getting errors when I attempt this is 9.2 but not with the identical code in 9.1.3 (with SAS/Secure installed). I need to be able to do this directly from SAS...

How do I change the label in a data step header?

In SAS you can do. data a(rename=(a=b) ); a = 1; run; to rename a variable in the data step data statement (or data step header as I call it). What's the syntax to change the label? I tried data a(label=(a='a to b') ); a = 1; run; But it doesn't work. ...

SAS using encrypted (PWENCODE) in EMAILPW= option

My code works fine using plain text code, but fails when I use an encrypted password filename File email emailsys = VIM emailid= "&pa_usr" emailpw= "{sasenc}39AAD23E148A9555508AC84447181DFF" ; Anyone know what I should do? ...

Reading data from a SAS data source in .Net

Hi all I've been asked to read some data from SAS in an ASP.Net application. I've got working code for a Windows Forms app. However the same code doesn't work in ASP.Net however I can try it. A clean project with the same references consistently fails. Here's what I've got for the connection: SASWorkspaceManager.WorkspaceManager ...

SAS stack overflow: PROC SQL reading dictionary.columns

I have a program in which I am reading dictionary.columns. There is a big program with lot of code before and after the program segment in which I read dictionary.column. The program used to work fine however it is giving error now. I have executed program 5 times it gave same error: STACK Overflow However when I am executing same pro...

ODS path is reset by SAS Enterprise Guide

I added an ODS path statement in the autoexec_usermods.sas on the workspace server like this: ods path mylibrary.templat(read) WORK.TEMPLAT(UPDATE) SASUSER.TEMPLAT(READ) SASHELP.TMPLMST(READ); When I run a SAS 9.2 session on the server I can see that the template store from my library is added to the ODS path as expected. Ho...

Configuring WPS Workbench to run an Autoexec on startup

Does anyone have any experience configuring the WPS engine to run, essentially an autoexec.sas on startup? I cannot find any documentation on how to implement this feature for WPS. I see that they have the option available to set, but I cannot find where to put the file or what to name it. http://www.teamwpc.co.uk/docs/WPS-Core-Quick-...

Optimizing suggestions needed for a SQL UPDATE statment. Two ~5 million record tables being used.

Hello, I'm looking for any suggestions to optimize the following PROC SQL statement from a SAS program. The two tables involved contain around 5 million records each and the runtime is about 46 hours. The statement is looking to update a "new" version of the "old" table. Noting a column if the "old" table, for a "PK_ID", was listed ...

Regex to convert a space separated list to a SQL where clause

I'm almost embarassed, but I'm struggling to create a regular expression to change something like cat dog mouse to a SQL where clause: a.cat=b.cat AND a.dog=b.dog AND a.mouse=b.mouse With s/(\w*)\s?/a.$1=b.$1 AND / I get a.cat=b.cat AND a.dog=b.dog AND a.mouse=b.mouse AND a.=b. AND Ouch. Help appreciated. EDIT: I ended up usin...

What R packages are available for binary data that is both correlated and clustered?

I'm working on a project now that's rather unlike anything I've done before. I have two tests with binary results that will be administered to the same sample, which is drawn from a clustered population (i.e., some subjects will be from the same family). I'd like to compare proportions of positive test results, but the clustering makes...

Formatting Titles in SAS ODS PDF

I am trying to but a box around my title in proc report using SAS 9.1. So far, I can only seem to get it around the first title, but not the second. I am currently using a template, but it doesn't seem to format the second title. I know that formatting is easier in SAS/GrAPH, but I need to do this in proc report. Any suggestions? Tips?...

Accessing one SAS data set from another

Hello all, have a rather vexing SAS problem and I would like to ask for your help. Here's the problem: I have two SAS data sets; let's call them setA and setB. Each row in setA has multiple attributes and one attribute is a key value that is unique within the data set. setB consists of two attributes. These attributes are key values fr...

SAS Proc Compare question

First off, I know pretty much nothing about SAS and I am not a programmer but an accountant, but here it goes: I am trying to compare two data sets to identify differences between them, so I am using the 'proc compare' command as follows: proc compare data=table1 compare=table2 criterion=.01; run; This works fine, but it compares lin...

Passing strings to C functions with SAS proc proto

I've been poking my nose in extending SAS string handling with some C functions such as a longest common substring algorithm. The proc FCMP functions get easily pretty inefficient. The embedded C compiler in proc proto doesn't seem to produce the results I expect after writing the algorithm in Visual Studio. One thing I think I have ver...

How can I create an ODBC connection to SAS?

I'm writing a program that needs to access SAS data. I've downloaded the ODBC drivers for SAS and installed them, but I need to be able to create ODBC connections on the fly, programmatically. The following code (in Python) seems like it should work: import ctypes ODBC_ADD_DSN = 1 def add_dsn(name, driver, **kw): nul, at...

SAS V9.1.3 - Error when combining %INC and CALL EXECUTE

Hi, I am getting a resolution error with some SAS v9.1.3 code. Here is some code I want to store in a .txt file (called problem2.txt) and bring into SAS with a %INC %macro email020; %if &email = 1 %then %do; %put THIS RESOLVED AT 1; %end; %else %if &email = 2 %the...

How can I read a SAS dataset?

I have a lot of files in SAS format, and I'd like to be able to read them in programs outside of SAS. I don't have anything except the base SAS system installed. I could manually convert each one, but I'd like a way to do it automatically. ...

in windows SAS, how to read the file loaded recently in particular path.

in windows SAS, how to read the file loaded recently in particular path. as i am accing from a path having lot of files , so it should pick a file having the latest data loaded in that path ...

Scheduling of SAS generated codes in SAS DI studio to IBM TWS

Hi Guys, I`m sure some you might have used both SAS DI studio and IBM TWS. Has anone managed to run codes generated in SAS DI studio in TWS scheduler , What are the kind of issues you have faced? And it would be great if you could suggest possible solutions ...