views:

147

answers:

5

I am confronted with a 4-page SAS thing - macro? procedure? it has procedures within it, DATA blocks and PROC blocks, one PROC SQL block for importing from Oracle.

Is there a tool that could translate SAS to something readable? Ideal would be SQL or PL/SQL (both seem applicable here), but almost anything procedural would be an improvement. I don't need something runnable, just something human-readable.

I know 2 dead languages already (TAL and TACL) - someone please save me from having to learn SAS.

+3  A: 

SAS is more than a data access tool. You would lose functionality if you converted SAS to SQL.

If you're just looking for an explanation, post a link to the SAS code. Some of us know this "dead" language.

Gilbert Le Blanc
Thanks for the offer. Don't want to make other people do my work for me, but if I find something I just can't figure out, I will.
orbfish
@orbfish: Your attitude is a nice change of pace from the usual attitude among questioners. SAS has its uses. Good luck,
Gilbert Le Blanc
+3  A: 

The short answer to your question is no. Short of learning the language there is no way to do this.

Rob Penridge
+5  A: 

SAS->SQL converters exist. You can't buy them, but you can hire them.

emory
+1  A: 

I am a SAS programmer.

I am also a SAS converter. I have converted SAS to Java, RDBMS (Sybase, SQL server or Oracle), JavaFreeCharts, AJAX.

I am also a SAS reducer - for projects that still want to retain SAS statistical backend but AJAX frontend.

There isn't a complete way to convert SAS to SQL because

  • SAS already has SAS/SQL and SQL in conjunction with SAS/Access SAS/Connect
  • Whatever that is not coded in SAS SQL may be convertible to stored procedures
  • Otherwise, they have to be converted to Java, a .NET language, or a web friendly language like python or Perl.
  • Charts have to be converted to a Java or .NET charting package.
  • You need familiarity with statistical analysis methods to convert SAS procedure calls to a language like Java, C++.

So, yes - there is a way to convert SAS to JEE or .NET and SQL or Perl. As Emory so succinctly puts it - you've got to hire someone to do it.

Blessed Geek
A: 

If you just want to know what the code is doing generally, post it and I can tell you. If you want it converted perfectly to another language or set of languages, then you would need to hire someone like Blessed Geek to do it for you.

It can be a non-trivial exercise, particularly if the procedure blocks are for statistical algorithms (such as multivariate regression) and not just for basic data manipulation or calculating metrics such as the mean or standard deviation.

At my last company, we had a large chunk of production SAS code (thousands of lines) that performed econometric modeling of grocery sales data. When SAS decided to deny us further licensing of the software citing a competitive product they were developing, we spent 9 months converting it to a combination of Java, a data flow product called Rapids, and some proprietary analytic libraries we purchased from a small company. It was a full time job for 8 developers during that time. 4 of them understood SAS really well, and the other 4 Java really well. Translating between the two worlds was a constant challenge.

At any rate, I think you see my point.

jgunnink