Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Maybe I am not 'getting' it - SAS vs SQL

Status
Not open for further replies.

jymm

Programmer
Apr 11, 2002
707
US
First - I am a SAS programmer with about 10-12 years of experience with SAS. I am also a SQL programmer (sql 2k, 7, Oracle...) and we have Crystal in house.

When SAS sent us the bill last fall for about $14k I got to wondering what it would take to convert all of those programs from SAS to SQL/Crystal. Answer was not very long since alot of it had Proc SQL statements in it.

This experience has been VERY interesting to me. The SQL Stored procedures/Functions/Triggers/DTS/T-SQL/OSQL that I wrote run MUCH faster than their SAS counterparts ever did plus non-sas programmers can read them just fine (ok, so I may have worked my way out of a job). And the Crystal reports that I now have worked into my asp or .net pages allow me more flexibility than I ever had with ODS or any of it's flavours. Plus I saved the company some pretty big annual bucks.

So the question is --- why do people keep going with SAS when they are writing most of their code with a Proc SQL steps anyway??? I will always be a SAS programmer at heart, but I do not understand anymore.
 
Jymm,
I had the same conversation with my MGR yesterday. The main reason you use SAS is for the statistics, not for the reports! In a clinical environment (drug company or anyone that submits study data to the FDA), SAS statistical procedures are the accepted ones. Not that there aren't others that can get the job done right. There are a few (win-non lin, spss) out there. Its the tried and tested statistical algorithms that the government (FDA, CPI, US Dept of Treasury etc..) uses to make vital decisions.

An example of this, a Proc GLM uses about 400 years of mathematics if you start the cound from Descartes and the start of the Open intergral (basis for Calculus). The power of that proc alone would bounce SQL. This proc is tried and debugged for almost 35 years. You can't get that from SQL. Yes, you can write a nice SQL report tool that will mine data and fill out your screen/report with nice little numbers all in order. Management loves those types of reports. And yes, SAS should really needs work in that department. Perhaps they should even use the Crystal Reporting toolset like the VS.NET from MS uses. If you are just dumping data onto a report, and that is all you need to do you should use the SQL alternatives. But, if you need to run some statistical analysis on you projects SAS is the only way to go.
In short, the reason most use SAS is for the Stats dept. If you do not need that stats than reason number two is prestiege. (You get to brag how much you spent on SAS at parties. Oh, and govt. agencies now look to you as a someone.)

I hope that I added something to the reason for using SAS.
Klaz
 
Thanks Klaz --- use to work for a large hospital and the statistics of SAS were great. In my conversion I was able to feed the SQL queries as db commands into Crystal and get what I needed.

I guess my point was not 100% clear.

Look at most of the more recent posts and you will not find discussions on how to use any of the complex stat procs --- but rather there are discussions/questions on pushing data here or there --- pulling data here or there -- ODS (which is neither here nor there)... all of which are faster on the (Oracle/MS Sql) DB or Crystal side. All of the 'normal' stat procs are QED (Anova, Corr, Freq, Means, Plot, Tabulate...) in something that you probably have in house anyway.

Worked for a government agency for years too --- still wish I could be back there and get in my afternoon naps --

So maybe the question really is --- are you only using SAS for Statistics??? Sigh --- I can go either way.
 
From my own perspective as someone who openly confesses to being lazy (in a job interview no less, and I still got the job!) SAS is alot easier to use to manipulate data than SQL. The syntax is easier to understand and remember, and it's procedural which makes it alot more of a programming language than SQL. I can do stuff in SAS that I wouldn't know where to begin with in SQL. That said, as I get better at SQL, and now learning PL/SQL as well, there's some things that SQL does so much better than SAS (as you said above). Joining multiple tables on different columns for instance, Cartesian Joins (why oh why does SAS make such a pigs ear of this and not flag it with at least a warning?). I hardly do any statistical work using SAS, in fact, if it was requested I'd probably have alot of difficulty.
I would say that the attraction of SAS is the ease of use, it's alot easier to pick up SAS and start pushing out numbers and reports than it is using SQL. For me anyway.
 
Programmers are all basically excitable, proud and lazy.

You are about 2 years behind me on the knowing what SQL can do and swearing that SAS can do it all. Stored Procedures, Functions, Triggers, DTS, ODS, T-Sql, PL/SQL... so many facets and my mind keeps going back to how I too thought it was so simple in SAS...

How quickly I went from being a poster child for SAS (helping them sell around here & still consulting for the locals) to having it all replaced in weeks/months.

wowie - come back here in a year and let us know if you still think SAS is easier than SQL --- some of that is the tool set you might be using and some of that is experience.

 
Personally, SAS is used to get the Statistical Process Control charting capability. No high power statistics but just the basics. The ODS capability combined with the SAS Internet tool provides a very capable tool. SQL is a powerful tool as well, but I dont think you get any graphing capability there.....
 
DJE,
You have not seen the latest SQL server 2000 report tool from Microsoft. (Its free if you have a license for SQL 2000) I think you would change the above statement if you had.
Klaz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top