top of page

®Linking Mathematica® to SAS

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 dataset (Version 7 or later) directly into your Mathematica notebook without having to use SAS transport files. You can also export data from your Mathematica notebook directly to a SAS dataset. You can also import and export your data as JMP data tables. Using M2SLink, run any SAS program from Mathematica and automatically retrieve the results that are ordinarily displayed in the output and log windows in SAS.

By default, the SAS dataset that you import into your Mathematica notebook is converted into a Mathematica Dataset object. This allows you to leverage Mathematica's powerful dataset functionality to view and analyze your imported SAS data. Built-in SAS formats and user-defined formats are fully supported. Date, time and date-time values are automatically converted for you as you transfer your data between Mathematica and SAS. Passwords and encryption for exported data are also supported.

All the metadata associated with your SAS dataset is also imported into your notebook.

 

Explore your data using M2SLink's unique interactive scatter plot and dataset viewer.

​System Requirements

  • Windows 64-bit operating system

  • 64-bit version of Mathematica for Windows (e.g. Version 11 or greater)

  • 64-bit version of SAS for Windows (e.g. Version 9)

 

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. Version 11 or greater) and a 64-bit version of SAS for Windows (e.g. Version 9).

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 Wolfram Notebook to import and export data as well as to submit SAS programs. M2SLink uses the WSTP (Wolfram Symbolic Transfer Protocol) to connect Mathematica to SAS.

At certain times, M2SLink will create temporary files in a subdirectory of the M2SLink installation directory. Therefore, you must have write (and, of course, execute) permissions turned on for your M2SLink installation directory and its subdirectories.

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

M2SLink uses Wolfram's WSTP to communicate with SAS and to transfer data lists between your Wolfram Notebook and SAS. In Mathematica Version 11, WSTP limits the maximum list length to a number slightly over two billion. For this reason, SAS datasets that contain more than two billion observations cannot be imported into Mathematica using M2SLink.  

M2SLink for Mathematica © 2020 Harper Corditt Software. All rights reserved.

Mathematica® is a registered trademark of Wolfram Research.

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.

bottom of page