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
Rhodochrosite | Level 12

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
}

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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