Sure thing, glad you're up and running!
Can you change your accepted answer to the correct one, just so if others search on this they don't go down the wrong path?
I appreciate it! (I can't change it)
Thanks!,
Tom
I GOT THIS ERROR
--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) <ipython-input-15-82631ef24263> in <module> 4 5 import saspy ----> 6 from CONFIG.sasconfig import username, password ModuleNotFoundError: No module named 'CONFIG'
Hey, yes, you can simply put your credentials in an authinfo file and then specify the key for that in your config. See the doc here:
https://sassoftware.github.io/saspy/install.html#iom-using-java
and scroll down to the authinfo part. Well, I'll cut-n-paste that next. You use the 'authkey' in your configuration definition to specify which credentials to use. You can have different credentials for different connections.
The IOM access method now has support for getting the required user/password from an authinfo file in the user’s home directory instead of prompting for it. On linux, the file is named .authinfo and on windows, it’s _authinfo. The format of the line in the authinfo file is as follows. The first value is the authkey value you specify for authkey. Next is the ‘user’ key followed by the value (the user id) and then ‘password’ key followed by its value (the user’s password). Note that there are permission rules for this file. On linux the file must have permissions of 600, only the user can read or write the file. On Windows, the file should be equally locked down to where only the owner can read and write it.
authkey user omr_user_id password omr_user_password
So, for a Configuration Definition that specifies the following authkey:
'authkey' : 'IOM_Prod_Grid1',
The authinfo file in the home directory for user Bob, with a password of BobsPW1 would have a line in it as follows:
IOM_Prod_Grid1 user Bob password BobsPW1
Thanks,
Tom
I have another follow up question. I recently had to update my password, and now I can no longer establish a connection to SAS. It says that my user name or password may be incorrect. However, I updated my password in the files you advised me to create. Any idea what the issue might be? I've even tried uninstalling and reinstalling SASPy.
Was the password you had to update your SAS Metadata password, or a password for some other account?
The user/password in the authinfo file are the credentials you use to authenticate to OMR. I don't know if those
credentials are the same as the one you had to change.
1 - try putting the pw back as it was in the authinfo file.
2 - try removing the authkey and see if you get prompted for credentials, and see if either pw works.
uninstalling/reinstalling saspy wouldn't have any effect on any of this. I'm guessing you didn't change your OMR pw, but rather some other account, so changing it in the authinfo file is the problem. But I don't have any information to really know wither way.
Tom
Good deal. Yes, on windows, the file starts with an underscore, while on linux it starts with a dot:
win - _authinfo (no file extension!)
linux - .authinfo (permissions 600)
Glad you'r back up!
Tom
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.