Usage Note 64755: How to create a SAS® session to your SAS® server while using SASPy on Windows with Anaconda
If you use Anaconda to program using the SASPy library and you would like to create a SAS session to a SAS server, follow the steps in this note.
Note: These instructions are for connecting from a Microsoft Windows operating system to a SAS server. If you are connecting from a Linux operating system to a SAS server, refer to the Anaconda documentation.
To perform the steps in this note, you need the following:
- Run the following code in a SAS session that is connected to the server that you would like SASPy to connect to:
proc iomoperate;
list types;
run;
- In the log results, look for the section regarding the SAS® Workspace Server.
- In the SAS Workspace Server section, record the class identifier.
- Determine the host name for your workspace server. If you are unsure how to find the host name, ask your SAS administrator.
- When you have the host name and the class identifier, you can now start to build the sascfg.py file.
- The sascfg.py file is found in the site-packages location for your Python installation.
- Save a copy of the sascfg.py file in the same folder. You can name the file as sascfg_connection-type.py (for example, sascfg_IOMCOM.py).
- Open the sascfg.py file that you created in step 7.
- On line 38, alter the value for SAS_config_names from default to iomcom.
- On line 215, the value iomcom should appear.
- Update the following values on line 215:
iomcom = {
'iomhost': 'host-name',
'iomport': 8591,
'class_id': 'your-class-id',
'provider': 'sas.iomprovider'}
- For the host-name value, enter the host name for the workspace server.
- For the iomport value, the port for the workspace server should be 8591, unless your institution has altered the port.
- For the your-class-id value, enter the class identifier that you recorded in step 3.
- Leave the provider portion unchanged.
- Save the file.
- Connect to the server by using SASPy. When you create your session, reference the new sascfg.py file that was created. Here is an example:
sas = saspy.SASsession(cfgfile='C:\Program Files\Python36\Lib\site-packages\saspy\sascfg_iomcom.py',
user='user-name', pw='password')
If you are still having connection issues, contact SAS Technical Support. Ensure that you attach the sascfg.py file that you created as well as the log response.
Operating System and Release Information
SAS System | Base SAS | Windows 7 Professional x64 | 9.4 | | 9.4 TS1M0 | |
Windows 7 Enterprise x64 | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows Server 2012 Std | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows Server 2012 R2 Std | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows Server 2012 R2 Datacenter | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows Server 2012 Datacenter | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows Server 2008 for x64 | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows Server 2008 R2 | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows 10 | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows 8.1 Pro x64 | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows 8.1 Pro 32-bit | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows 8.1 Enterprise x64 | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows 8.1 Enterprise 32-bit | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows 8 Pro x64 | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows 8 Enterprise x64 | 9.4 | | 9.4 TS1M0 | |
Microsoft® Windows® for x64 | 9.4 | | 9.4 TS1M0 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Follow the instructions in this SAS Note if you use Anaconda to program in Python and you would like to connect to a SAS server by using the SASPy library.
Date Modified: | 2019-09-18 10:32:37 |
Date Created: | 2019-09-09 19:21:02 |