LEARN / SAS OnDemand
 

SAS® OnDemand for Academics

Working with Python, including Jupyter Notebook

Java version 1.8.0_162 or higher, Python 3.3 or higher, and SASPy 3.3.4 or higher (using the latest version is recommended) are required before proceeding.

For more information on SASPy see SASPy on sassoftware.github and the installation and configuration instructions. Note that this is a Remote IOM using Java configuration.

The following steps can connect you to the SAS servers provided by SAS OnDemand for Academics.

(Note: A SAS OnDemand for Academics account is required. If you have not yet setup your SAS OnDemand for Academics account, you should do so before performing the steps below. See our Frequently Asked Questions for more details.)

In order to integrate with SAS OnDemand for Academics using this method, you must:

  • Create files to configure Python to access SAS OnDemand for Academics
  • Connect to the SAS OnDemand resources using Python
  • Create files to configure Python to access SAS OnDemand for Academics

    These files need to be created and referenced only once.

      Using a text editor, we recommend you create two files:

      "sascfg_personal.py"

      "_authinfo"

      • Create sascfg_personal.py containing the following information based on your SAS OnDemand for Academics Home Region.

        • You can simply copy and paste the entire code block below. Be sure to uncomment only the 'iomhost' key for your home region. You can leave the others commented out or delete them.
          * US Region is uncommented as an example.

          NOTE: You will likely need to change the JAVA location (and if on Linux or MacOS, the path would be more like '/usr/bin/java')

        • SAS_config_names=['oda']
          oda = {'java' : 'C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath\\java.exe',
          #US Home Region 1
          'iomhost' : ['odaws01-usw2.oda.sas.com','odaws02-usw2.oda.sas.com'],
          #US Home Region 2
          #'iomhost' : ['odaws01-usw2-2.oda.sas.com','odaws02-usw2-2.oda.sas.com'],
          #European Home Region 1
          #'iomhost' : ['odaws01-euw1.oda.sas.com','odaws02-euw1.oda.sas.com'],
          #Asia Pacific Home Region 1
          #'iomhost' : ['odaws01-apse1.oda.sas.com','odaws02-apse1.oda.sas.com'],
          #Asia Pacific Home Region 2
          #'iomhost' : ['odaws01-apse1-2.oda.sas.com','odaws02-apse1-2.oda.sas.com'],
          'iomport' : 8591,
          'authkey' : 'oda',
          'encoding' : 'utf-8'
          }

        • Save sascfg_personal.py to your SASPy installation location.
        • Run the following commands in your Python command window to get the full pathname of where to save your sascfg_personal.py file.

          import saspy, os
          print(saspy.__file__.replace('__init__.py', 'sascfg_personal.py'))

      • Create _authinfo using the below as a template (.authinfo if on Linux or MacOS). See the saspy instructions for more information on this topic.
        • You will need to change "ODA_EMAIL" or "ODA_USERNAME" and "ODA_PASSWORD" to your SAS OnDemand for Academics credentials.

          oda user ODA_EMAIL or ODA_USERNAME password ODA_PASSWORD

        • Save _authinfo to your user's home directory C:\Users\'YOUR_USERNAME' on Windows.

    Connect to the SAS OnDemand for Academics Servers from Python

    This step should be performed any time that you want to connect to hosted SAS servers.

      From a Python prompt or from another Python interface, like Jupyter Notebook, use the following commands to confirm a connection to SAS OnDemand for Academics.

      import saspy
      sas_session = saspy.SASsession()
      sas_session

    Note: If you encounter, "None of the requested encryption algorithms are supported by both peers: AES," please confirm you are running the correct version of Java (1.8.0_162 or greater) and Contact Us for additional assistance.

    Need more information or help troubleshooting issues with SASPy?

    The following resources can help to answer many questions. We recommned trying them in the order given below.