BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ts3
Fluorite | Level 6 ts3
Fluorite | Level 6

When I connect using

sas = saspy.SASsession(cfgname='winlocal')

I get

Did not find key AKEY in authinfo file:C:\Users\myuser\_authinfo

The format of _authinfo is correct, followed docs and is exactly this:

AKEY user <myuser> password <mypassword> 

If I log in when prompted everything works, I am connected and can run queries, access tables etc. The only thing not working is the authkey. Permissions on _authinfo allow access as well.

1 ACCEPTED SOLUTION

Accepted Solutions
jimbarbour
Meteorite | Level 14

Can you try just saving it as ASCII?  Grasping at straws here, but let's eliminate all possibilities that it's some odd ball encoding issue.  I think you could just cut and paste into a Notepad, taking care to delete the .txt extension afterwards (or saving as type *.*).

 

Jim

View solution in original post

11 REPLIES 11
jimbarbour
Meteorite | Level 14

This may not be the issue, but let's eliminate one possible cause of this problem.  Open a Windows Explorer session and navigate to

C:\Users\myuser

Click on "View", "Options", and then "Change Folder and Search Options".

 

The below pop-up should appear.  Make sure that the indicated check box is NOT checked.  If it is checked, un-check it, and click "OK".

jimbarbour_0-1627499238644.png

 

Now look for the file _authinfo with no file extension in your Windows Explorer session.  This is the file that is being used.  Now look for _authinfo.txt.  This possibly is the file you saved if you used something like Notepad.exe to add your ID and password to the file.  Windows automatically adds .txt if you use Notepad.  You won't see this unless the check box in the options shown above is un-checked.  

 

If there is a _authinfo.txt that has the correct ID and password, rename _authinfo (with no file extension) to _authinfo.bak and rename _authinfo.txt to just _authinfo.  Try running again.

 

Jim

ts3
Fluorite | Level 6 ts3
Fluorite | Level 6
Nope no extension, and type is just plain `File` not txt or anything. I made it with a different text editor so I wouldn't have to deal with notepad adding extensions and it'd just save as normal plaintext.
jimbarbour
Meteorite | Level 14

OK, worth a shot, and certainly one to eliminate up front.

 

And

  1. Does it contain any special characters?
  2. What is the encoding?  Is it ASCII, Unicode, or ?

 

Jim

jimbarbour
Meteorite | Level 14

If that's not the issue (again, just eliminating possibilities), then check this out and see if it sheds any light:

https://communities.sas.com/t5/SAS-Programming/Sas-Authkey/m-p/581062#M165112

 

Jim

ts3
Fluorite | Level 6 ts3
Fluorite | Level 6

Yeah I've seen that post. My format is the one quoted from the docs there, and my _authinfo file *is* being found, so I do not believe it applies here.

jimbarbour
Meteorite | Level 14

Well, crap.  OK, see my response (will post in a few minutes) to my encoding response.

 

Jim

ts3
Fluorite | Level 6 ts3
Fluorite | Level 6
no special characters notepad++ encoding indicates UTF-8 LE BOM
jimbarbour
Meteorite | Level 14

Can you try just saving it as ASCII?  Grasping at straws here, but let's eliminate all possibilities that it's some odd ball encoding issue.  I think you could just cut and paste into a Notepad, taking care to delete the .txt extension afterwards (or saving as type *.*).

 

Jim

ts3
Fluorite | Level 6 ts3
Fluorite | Level 6

That did it, well I guess its good to know that it requires ASCII.. Thanks! This is actually taking place on 1 of 2 computers I have this set up on, and on the first I believe I did use (regular) notepad and saved it w/o extension, and got the same result.

 

 

To clearly state what I did, I used the encoding drop-down menu in notepad++ to switch the encoding to ANSI.

jimbarbour
Meteorite | Level 14

OK, cool.  (about time, lol)

 

Everything you were doing sounded right to me, so I started looking for oddball stuff like file extensions and encodings that would keep correctly coded parameters from working.  Glad I finally got it right.  I was running out of hunches.  🙂

 

Jim

 

 

ts3
Fluorite | Level 6 ts3
Fluorite | Level 6
It seems to work with plain UTF-8 as well, but not other variants. Yeah I was really at a loss because everything else worked haha.

SAS Innovate 2025: Call for Content

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 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 11 replies
  • 2467 views
  • 2 likes
  • 2 in conversation