BookmarkSubscribeRSS Feed
bikash10
Calcite | Level 5

I am trying to connect the SAS EG with python to get the server data using this code, but I do not have any luck to connect it. We have window client and with IWA.

 

import pandas
import saspy
winiomIWA = {'java' : 'java',
'iomhost' : 'server name', --I put my server name in the iomhost
'iomport' : 8591,
'sspi' : True
}

sas=saspy.SASsession(cfgname='winiomIWA)

 But I got this error like this "The SAS Config name specified was not found. Please enter the SAS Config you wish to use."

 

I am a new user for python and just want to connect between the two sources so that I can directly import the data from python to SAS EG.

 

Thank you,

Bikash

2 REPLIES 2
AhmedAl_Attar
Ammonite | Level 13

Have a look at the documentation here https://sassoftware.github.io/saspy/install.html 

 

Hope this helps,

Ahmed

sastpw
SAS Employee

the cfgname= parameter references a configuration definition name in your config file. Your config name you're specifying is a local variable in your python environment, which is why you're getting that error. The instructions here (https://sassoftware.github.io/saspy/install.html#configuration) explain to create a config file, sascfg_personal.py, with that config definition you've put together so that it will be used to connect.

The example config file, in the repo (sascfg.py) contains examples of many various configuration definitions anyone might need, depending upon what type of SAS deployment they are trying to connect to. 

 

For your config below, you can create your config file with it, and you would then need this line in there too:

SAS_config_names=['winiomIWA']

 

So, your sascfg_persional.py config file could simply be:

 

SAS_config_names=['winiomIWA']

winiomIWA = {'java' : 'java',
'iomhost' : 'server name', # Do put your server name in the iomhost
'iomport' : 8591,
'sspi' : True
}

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 2636 views
  • 1 like
  • 3 in conversation