Date: Thu, 6 May 2010 10:07:29 -0700
Reply-To: "Choate, Paul@DDS" <Paul.Choate@DDS.CA.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Choate, Paul@DDS" <Paul.Choate@DDS.CA.GOV>
Subject: Re: Looking for SAS best practices
Content-Type: text/plain; charset="us-ascii"
Best practices are dependent on type of use SAS is put to use for - statistical analysis, reporting, production programming, adhoc analysis, etc. I've spent some time at each and how SAS is applied varies directly with the task.
For parsing text files and doing data transformation I think SAS is just about the best Swiss Army data-knife out there. Extremely powerful and very simple to use once you grasp it.
DDS Data Extraction
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Matthew Wilson
Sent: Wednesday, May 05, 2010 1:42 PM
Subject: Looking for SAS best practices
I'm writing SAS code again after a break for about three years.
Here's a few things that bug me in particular about the SAS code I'm
1. Macros, options, and misc statements are all littered all over the
place, so I can't easily reorganize code into smaller units.
2. It would be nice to tell SAS to run everything required to build
some particular data set. If all the prerequisites exist and are as
recent as they need to be, then just build the last step. This is
something that other programmers do all the time with makefiles. They
describe all the dependencies for building a system, and then the make
utility is smart enough to just rebuild the pieces that are necessary.
When a SAS job crashes at the 90% mark, I shouldn't have to sit while
it builds all the original stuff again.
3. SAS treats garbage data a little too politely. If I have code
that tries to convert a string to a date and it fails, I want a lot
more of a sign than a subtle entry in a 10,000-line long file.
4. In the same vein as garbage input, I find it really difficult to
add constraints to datasets. I mean stuff like foreign key
constraints, or comparisons between columns (excuse me, variables) or
things like that.
I'm beginning to wonder if I should rethink the role of SAS. Instead
of using SAS for parsing text files, doing data transformation, and
then building reports, maybe I should just use SAS for reporting, and
doing the first two steps in a scripting language and a relational
Don't get me wrong. I love SAS. Stuff like proc summary is NOT easy
to replicate in SQL. I don't mean to rant. I want to learn how to
set up culture of awesome at this SAS shop.
W. Matthew Wilson