File Exchange Pick of the Week

November 14th, 2008

Interfacing MATLAB and SAS

This morning, a customer wrote to ask me about the best way to interface MATLAB with SAS. Now, I've been using MATLAB for about 14 years, but it's been about that long since I last touched SAS. And I've never tried to interface the two.

What to do?

Whenever I'm faced with a challenge of this nature, my first stop is usually Google. (Isn't it everyone's?) So I Googled "MATLAB SAS" and was very pleased to see that the first "hit" was for a white paper by Dimitri Shvorob entitled "The Twain Shall Meet: Facilitating Data Exchange Between SAS and Matlab."

null

We'll forgive Dimitri here for his improper capitalization of "MATLAB"; his paper provides a nice overview of how to use a MySQL database as "conduit" to facilitate the interchange of data, and underscores the power of the File Exchange (and more broadly, of Google, and of the Internet!) to find solutions to commonly faced problems. It's clear from Dimitri's paper that he knows his way around SAS, and I'm pleased that he chose to share his knowledge on MATLAB Central. In fact, accompanying that paper were two additional files of note: Import data from SAS and Export data to SAS. This suite of files is Brett's choice for this week's Pick of the Week.

Let us know here if you've solved "interfacing problems" of this nature--particularly ones you haven't (yet) shared on the File Exchange!


Get the MATLAB code

Published with MATLAB® 7.7

Leave a Reply

Wrap code fragments inside <pre> tags, like this:

<pre class="code">
a = magic(3);
sum(a)
</pre>

If you have a "<" character in your code, either follow it with a space or replace it with "&lt;" (including the semicolon).


Bob, Brett & Jiro share their favorite user-contributed submissions from the File Exchange.

  • Jon: This is a useful tool - but in fairness I have to point out that it is remarkably similar to a routine of the...
  • oleg: The author has implemented skewness, kurtosis and checks answering appropriately to the critic.
  • Ashok: how to store 10 or more random number in a loop a loop for i = 1:n mean(i) = input(’enter the mean value...
  • Ben: Doug, Thanks for the very helpful videos! Uitables seem like a convenient way to make a customized property...
  • oleg: Allstats has no checks, no comments and could also be improved (talking about prctile implementatio). Not to...
  • Todd: Additional information and a link to download free MATLAB and Simulink LEGO MINDSTORMS NXT code can be found at...
  • Doug: @Leo, Here is the “English version” of that code. “vec = []” makes an empty variable...
  • leo: Dear Doug I have a question in your code ‘October 9th, 2009 at 13:53′ vec = []; vec = [vec val]; I...
  • Shanker Keshavdas: You sir, are a gentleman and a scholar… No really, helped me out a lot. As to what is...
  • Quan Zheng: how can I get a copy of stepspecs.m?

These postings are the author's and don't necessarily represent the opinions of The MathWorks.