sas

What's your best trick to break out of an unbalanced quote condition in BASE SAS?

As a base SAS programmer, you know the drill: You submit your SAS code, which contains an unbalanced quote, so now you've got not only and unclosed quote, but also unclosed comments, macro function definitions, and a missing run; or quit; statement. What's your best trick for not having those unbalanced quotes bother you? ...

Storing SAS data (including table structure) in a single flat file

I need to convert SAS data tables into flat files (or "ASCII files" as they were called once, as opposed to binary files). And only 1 flat file for each original SAS table. The challenging thing is that I want the flat file to contain some structural information of the original SAS table also, specifically: Variable/Column name Variabl...

Setting data type when reading XML data in SAS

I need to control the data type when reading XML data in SAS. The XML data are written and accessed using the XML libname engine in SAS. SAS seems to guess the data type based on the contents of a column: If I write "20081002" to my XML data in a character column, it will be read back in as a numerical variable. An example: filename m...

Defining a calculated member in MDX - filtering a measure's value

Hi, I need to define a calculated member in MDX (this is SAS OLAP, but I'd appreciate answers from people who work with different OLAP implementations anyway). The new measure's value should be calculated from an existing measure by applying an additional filter condition. I suppose it will be clearer with an example: Existing measur...

sas one-liner

Is there a way to run a one-liner in sas, or do I have to create a file? I'm looking for something like the -e flag in perl. ...

SAS Career Guidance

hi, I've 3+ years experience working as a SAS Programmer in a pharmaceutical industry. But I feel my professional growth is limited because of non-statistical background. Are there any other areas in SAS (Business Intelligence, data modelling etc.) where statistics background is not required and which can lead me to senior level positio...

Resources for learning SAS if you already familiar with R

I would like to learn some SAS because I am interested in a few industries that tend to use it exclusively. However, I don't want to get stuck with a resource that assumes I know nothing about statistical programming. Is there a good guide for programmers with statistics experience in R? Thanks, Steven ...

In SAS, outside of a data step, what is the best way to replace a character in a macro variable with a blank?

It seems that TRANSLATE would be a good function to use. However when using %SYSFUNC with this function, the parameters are not surrounded with quotes. How do you indicate a blank should be used as replacement? ...

Efficient way to merge/join 2 large datasets in SAS 8.2

I have tried the following options with unacceptable response times - creating index 'key' did not help either(NOTE:duplicate'keys'in both datasets): data a; merge b c; by key if b; run; === OR === proc sql; create a as select * from b left outer join c on b.key; quit; ...

What benefits have you gained from being SAS certified?

I get the whole argument for being certified. However, what are the real work benefits YOU have received from being SAS certified? Additionally, how has it helped you market yourself (as an employee or independent contractor)? What benefits have you gotten from SAS once you were certified? Etc... ...

SAS: Calling one macro from another...Order of Macro Definitions

In my code I have several macros. Macro A is the main macro. Macro A then calls macro B which in turn calls macro C. In SAS, do I have to define them in backwards order? In other words, do I have to define macro C first, then macro B, then macro A last? Or does it matter since SAS reads all the code in before it actually hits the ...

SAS: timing of autoexec file/applying formats to datasets for viewing

Here's the background. I'm sorry it's so long: I do SAS programming for 3 different projects. Each project has its own main project folder. Each main project folder contains a formats folder (which contains the format catalog), and then several other folders, each of which contains programs and datasets. I do most of my work in batch mod...

Programming fundas

Would some one suggest me the best method to start learning the fundas of programming. I would be involved in SQL and SAS related technologies involving databases. Please advice ...

Opening SAS datasets for viewing from within a .sas program

Is there a way to open a SAS dataset for viewing (i.e., in the "ViewTable" window) from within a .sas file? ...

How can we do conditional iteration in a sas dataset

How can we do iteration in a sas dataset. For example I have chosen the first. of a variable. And want to find the occurence of a particular condition and set a value when it satisfy ...

SAS invalid 'leap year' date issue yymmdd8.

I am reading in some raw data that has a couple of bad dates. Specifically, someone has keyed in "29th Feb" on a NON leap year. For example: data _null_; input test :yymmdd8.; format test date9.; cards; 20270229 run; The customer would like this to revert to the 28th Feb. Is there a quick / efficient method of doing this? eg an eq...

Avoiding a SAS error message: "NOTE: Invalid argument to function INPUT"

Is there a way to test if a variable will fail the INPUT conversion process in SAS ? Or alternatively, if the resulting "NOTE: Invalid argument" message can be avoided? data null; format test2 date9.; input test ; test2=INPUT(PUT(test,8.),yymmdd8.); if error =1 then do; error=0; test2=INPUT(PUT(test-1,8.),yymmdd8.); end; put te...

Consuming a REST Service with SAS

This is sort of an odd question. I know that SAS has a PROC SOAP for consuming web services. I wonder if anyone has any experience consuming XML from a REST resource using SAS? ...

For a SAS dataset, what is the best way to prevent locking for multiple user access

Thanks for reading this. I am using a shared service (server=sharedLib) when setting up my libref, to allow users of my SAS/IntrNet application to modify and update (add new) records of a single dataset. The application will also be used to query my dataset. To minimize locking, I am only using a data step to modify and update rather th...

Statistics based marketing campaign measurement tools

Currently using SAS as measurement engine and Business Objects as display layer. Looking to develop a new, faster, slicker solution. Has anyone developed or purchased a campaign measurement reporting system? This solution should measure everything from email stats, web stats, customer activity, lift, ROI, etc. Ok.. I'm researching and ...