top of page

About M2SLink

Connecting Mathematica® and SAS®

Now available in our store: M2SLink v3.0, Add-On for Mathematica®

 Also available here in the Wolfram store.

Access the power of SAS® from your Wolfram® notebook.

M2SLink is an add-on for Mathematica® that enables you to access the functionality of SAS® from your Mathematica® notebook.  With M2SLink, your Mathematica notebook becomes your interface to SAS, allowing you to leverage the computational power of SAS while working within the Wolfram notebook environment.


With M2SLink, you can:

  • Import any SAS data set (v7 or later) directly into your Mathematica notebook without having to use SAS transport files.

Imported data is contained in a Mathematica list with a special structure,

   which can be manipulated just like any other list in Mathematica.

Built-in SAS formats as well as user-defined formats are fully supported.

Date, time, and date-time values are automatically converted for you as

   you transfer your data back and forth between Mathematica and SAS.

Works with SAS Viya® Windows client.

 Import JMP® data tables.

  • Export data from your Mathematica notebook to a SAS data set.

Passwords and encryption are supported.

 Export to JMP® data tables.

  • Run any SAS program from Mathematica and automatically retrieve the results that are ordinarily displayed in the output and log windows in SAS.

  • Explore your data using M2SLink's unique Interactive Scatter Plot and Data Set Viewer.


M2SLink provides extra Wolfram notebooks which show you how to use Mathematica to create the most popular plots and charts for descriptive statistics using data imported from your SAS data sets.  For examples, visit our Data Visualization page.

System Requirements

  • Windows® 64-bit operating system.

  • 64-bit version of Mathematica® for Windows (e.g. v11).

  • 64-bit version of SAS® for Windows (e.g., v9).

M2SLink requires the Windows® 64-bit operating system. There is no support for the Macintosh or Linux operating systems.  It requires a 64-bit version of Mathematica® for Windows (e.g. v12) and a 64-bit version of SAS® for Windows (e.g., v9).  M2SLink is compatible with Mathematica 12.2.

You must have access to the SAS executable and the proper permissions to run SAS.  This is because M2SLink creates a non-interactive SAS session to service the requests you issue from your Mathematica notebook to import and export data as well as to submit SAS programs.  M2SLink uses the Wolfram Symbolic Transfer Protocol (WSTP) and the SAS Component Language (SCL) to connect Mathematica to SAS.

M2SLink will create a subdirectory named M2SLink in your Users Documents directory (C:\Users\<Your User Name>\Documents\M2SLink) which it will use for any temp files it needs and to preserve information between sessions.  In order to run M2SLink, you must have create/read/write permissions enabled for your Users Documents directory (which is normally the case).

M2SLink uses the Windows Registry to preserve certain preferences you set.  These preferences are stored in the Windows registry separately from any SAS or Mathematica registry data.  In order to run M2SLink, you must have the proper permissions to modify the Windows Registry. 


For more information, visit our Downloads page, where you can find the complete M2SLink User Guide in PDF form.

If you would like to try M2SLink, visit our Demo page, where you can download a demo version of the product.

To purchase a copy of M2SLink, visit our Shop page.  Discounted pricing is available when you purchase multiple copies of M2SLink and for site licenses.  Please contact us if you are interested:



What's New in Version 3.0?

  • The M2SImport function has been redesigned to return a Mathematica Dataset object by default.  This allows you to leverage Mathematica's powerful Dataset functionality to view and analyze your imported SAS data.

  • New functions and examples have been added to support the use of Mathematica Datasets in M2SLink.



What's New in Version 2.0?

  • Totally redesigned data set viewer.  The data set viewer in v2.0 has been completely rewritten as a Mathematica function.  Thus, the data set viewer now runs inside your notebook rather than in a separate window.  The data set viewer still supports dynamic interaction with the scatter plot.  But now you can view the scatter plot and the data set viewer side-by-side in your Wolfram notebook.

  • New functions have been added to support accessing SAS library content.



SAS® and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries.  ® indicates USA registration.


Mathematica® is a registered trademark of Wolfram Research.

bottom of page