sas

Quarter as a Count variable in SAS.

Hye Guys, I'm busy working on a time series and am trying to find the commands that allow me to insert a quarter count variable. To keep things simple, the third quarter of 1995 (date my observations start) should be quarter -2, the fourth quarter of 1995 should be -1 etc etc uptill 2006 (should be somewhere around 45 by then). My dates...

Merging datasets based on 2 variables in SAS.

Hye Guys, my question is the following, i'm working with different databases, all contain information about 1000+ companies, a company is defined by its ticker code (the short version of the name( Ford as F) usually seen on stock quotation boards). Aside from the ticker code to merge on I also have to merge on the time, I used month as ...

Calculating moving average/stdev in SAS?

Hye guys, I included a screenshot to help clarify my problem: http://i40.tinypic.com/mcrnmv.jpg. I'm trying to calculate some kind of moving average and moving standard deviation. The thing is I want to calculate the coefficients of variation (stdev/avg) for the actual value. Normally this is done by calculating the stdev and avg for ...

Combining data sets without losing observations in SAS

Hye guys, I know, another post another problem :D :(. I took a screenshot to easily explain my problem. http://i39.tinypic.com/rhms0h.jpg As you can see I want to merge two tables (again), the Base & Analyst table. What I want to achieve is displayed in the right bottom corner table. I’m calculating the number of total analysts and f...

Regressing panel data in SAS.

Hey Guys, thanks to your help I succesfully managed all my databases! I am now looking at a panel data set on which I have to regress. Since I only started my Phd this semester together with the econometrics courses I am still new to many statistic applications and regression methods. I want to do a simple regression as in Y = x1 x2 x3...

SAS tutorial, books

Is there any good tutorial for SAS? Any recommended books? I have seen a lot of materials for R/S-Plus, but so few for SAS. Thanks! ...

SAS: add comment to lst ouput file

In SAS, How do I add comments to my .LST output file. Like adding a comment saying "This is the output for tbl_TestMacro:" right before doing a proc print? So that my output file will read: This is the output for tbl_TestMacro: Obs field1 field2 1 6 8 2 6 9 3 7 0 4 7 ...

Hausman Test, Fixed/random effects in SAS?

Hey guys, I'm trying to do a fixed effecs OLS regression, a random effects OLS Regression and a Hausman test to back up my choice for one of those models. Alas, there does not seem to be a lot of information of what the code looks like when you want to do this. I found for the Hausman test that proc model data=one out=fiml2; en...

SAS on OS X any way to run without working within virtual machine?

I would like to edit and submit SAS code from emacs (aquamacs) on OS X to SAS running on Vista (through Parallels). Any idea how to do this? I like to do everything through one place and it is really annoying to work within the windows emulator. I have run SAS from a linux server through aquamacs but wonder if something similar can ...

Counting variables per observation per month in Sas.

Hey guys, a quick question, I have data of the following sort: Ticker _ Date Fem Analyst (dummy 1 if true) __ Variables of that month like beta AA _ 01/04/2001 1 __ 0.61 AA _ 05/04/2001 1 __ 0.62 AA _ 08/04/2001 1 __ 0.63 AA _ 01/05/2002 1 __ 0.7 AA _ 04/05/2002 1 __ 0.71 AA _ 08/07/2002 0 __ 0.8 AA _ 07/04/2003 1 __ 0....

SAS: rearrange field order in data step

In SAS 9, how can I in a simple data step, rearrange the order the field. Data set2; /*Something probably goes here*/ set set1; run; So if set1 has the following fields: Name Title Salary A Chief 40000 B Chief 45000 Then I can change the field order of set2 to: Title Salary Name Chief 40000 A Chief 4500...

Large character field sizes in SAS

Hi All I am trying to import a large blob field from a MySQL table via SAS ODBC passthrough. The field is larger than the maximum length allowed in SAS. According to SAS 9.2 documentation character type fields can have a maximum length of 32k. Has anyone had experience storing large character fields in SAS? Any suggestions other than...

How do I obtain the machine epsilon in SAS?

How do I obtain the machine epsilon in SAS? ...

How to Direct Output from a SAS Procedure to the Log or Output Window?

How do I send output from a SAS Procedure to the Output or Log window? ...

How do I encode Unicode strings using pyodbc to save to a SAS dataset?

I'm using Python to read and write SAS datasets, using pyodbc and the SAS ODBC drivers. I can load the data perfectly well, but when I save the data, using something like: cursor.execute('insert into dataset.test VALUES (?)', u'testing') ... I get a pyodbc.Error: ('HY004', '[HY004] [Microsoft][ODBC Driver Manager] SQL data type out o...

Categorize data without consolidating?

I have a table with about 1000 records and 2000 columns. What I want to do is categorize each row such that all records with equal column values for all columns except 'ID' are given a category ID. My final answer would look like: ID A B C ..... Category ID 1 1 0 3 1 2 2 1 3 2 3 1 0 3 1 4 2...

Java API for connecting to SAS

Hello, is there a Java API I can use to connect to a SAS metdata server so i can dynamically create information maps through Java? basically, I want to be able to execute "proc infomap" blocks through Java code, is this possible? THanks! ...

How do I programmatically make it so that SAS doesn't print to Results?

I am running some proc and using ods output FitStatistics = fs; etc to create some SAS datasets from the outputs. But since I am running it a large number of times, I want to suppress the printing to Results. What's is the SAS code for doing that? ...

Determine the folder of a SAS source file

When I open a SAS file in enterprise guide and run it, it is executed on the server. The source file itself is located either on the production site or the development site. In both cases, it is executed the same server however. I want to be able to tell my script to store results in a relative folder. But if I write something like lib...

In need of a SaaS solution for semantic thesaurus matching

Hello, I'm currently building a web application. In one of it's key processes the application need to match short phrases to other similar ones available in the DB. The application needs to be able to match the phrase: Looking for a second hand car in good shape To other phrases which basically have the same meaning but use diffe...