<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Sas Authkey in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Sas-Authkey/m-p/697667#M213248</link>
    <description>&lt;P&gt;Hey, you are getting a system error trying to open that file. It either doesn't exist or you don't have permission. That's what the error:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;[Errno 2] No such file or directory: 'C:\\Users\\uxxx421\\_authinfo'&lt;/PRE&gt;
&lt;P&gt;would be. Are you sure you have that file, named correctly, in that path?&lt;/P&gt;</description>
    <pubDate>Mon, 09 Nov 2020 16:49:42 GMT</pubDate>
    <dc:creator>sastpw</dc:creator>
    <dc:date>2020-11-09T16:49:42Z</dc:date>
    <item>
      <title>Sas Authkey</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sas-Authkey/m-p/581062#M165112</link>
      <description>I have a Python algorithm using the saspy library. I want to make it automatic through Task Scheduler. To do this, I need the login and password for saspy.SASsession to be entered automatically. How can I do that? I found only authkey, but I don’t understand how to work with it.</description>
      <pubDate>Wed, 14 Aug 2019 11:41:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sas-Authkey/m-p/581062#M165112</guid>
      <dc:creator>krmnv</dc:creator>
      <dc:date>2019-08-14T11:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: Sas Authkey</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sas-Authkey/m-p/581251#M165182</link>
      <description>&lt;P&gt;Hey, yes, that's what authkey is for. You store your credentials in a secured file in your home directory. First, I assume you're using an IOM access method? or HTTP? The file is named _authinfo on windows and .authinfo on linux (underscore or dot).&lt;/P&gt;
&lt;P&gt;In the file, the format for your information is:&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN class="n"&gt;authkey&lt;/SPAN&gt; &lt;SPAN class="n"&gt;user&lt;/SPAN&gt; &lt;SPAN class="n"&gt;omr_user_id&lt;/SPAN&gt; &lt;SPAN class="n"&gt;password&lt;/SPAN&gt; &lt;SPAN class="n"&gt;omr_user_password&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;So, for instance if your id was Bob and your password was Bobspassword, then you just need to make up a name (key) to use, let's use 'Bobs_key', and you would put a line like this in that file:&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN class="n"&gt;Bobs_key&lt;/SPAN&gt; &lt;SPAN class="n"&gt;user&lt;/SPAN&gt; &lt;SPAN class="n"&gt;Bob&lt;/SPAN&gt; &lt;SPAN class="n"&gt;password&lt;/SPAN&gt; &lt;SPAN class="n"&gt;Bobspassword&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Then in your saspy configuration you would code the authley paramter as follows:&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN class="s1"&gt;'authkey'&lt;/SPAN&gt; &lt;SPAN class="p"&gt;:&lt;/SPAN&gt; &lt;SPAN class="s1"&gt;'Bobs_key'&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have different credentials for different systems you connect to (or even the same), you would create a line in that file for each set of credentials and specify a different key for each.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should set the permissions on the authinfo file to read/write only, for yourself and no access for anyone else.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Give it a try, it's simple and you never have to enter your credentials anymore &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 19:01:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sas-Authkey/m-p/581251#M165182</guid>
      <dc:creator>sastpw</dc:creator>
      <dc:date>2019-08-14T19:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: Sas Authkey</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sas-Authkey/m-p/581359#M165226</link>
      <description>&lt;P&gt;Tom, thanks for the response. I suppose that I am doing everything as you described, but I am facing a problem. My code looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;winiomwin = {'authkey' : 'SASPY'}&lt;/P&gt;&lt;P&gt;import saspy&lt;/P&gt;&lt;P&gt;sas = saspy.SASsession(cfgname='winiomwin', validvarname=any, authkey='SASPY')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error trying to read authinfo file:C:\Users\akarmanov\_authinfo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[Errno 2] No such file or directory: 'C:\\Users\\akarmanov\\_authinfo'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did not find key SASPY in authinfo file:C:\Users\akarmanov\_authinfo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the reason and how to eliminate it?&lt;BR /&gt;I also have a few questions. What type of file should _authinfo have? The home directory is the path specified in the output, as I understand it. Could there be problems with this if the code runs from the server?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2019 09:37:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sas-Authkey/m-p/581359#M165226</guid>
      <dc:creator>krmnv</dc:creator>
      <dc:date>2019-08-15T09:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: Sas Authkey</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sas-Authkey/m-p/581407#M165243</link>
      <description>&lt;P&gt;Hmm, I'm sorry, it sounded like you had a working configuration and just needed to have the credentials supplied automatically.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;winiomwin = {'authkey' : 'SASPY'}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;is not a valid configuration definition. The authkey is only 1 parameter which is used to find the credentials. There are none of the required parameters in that definition to be able to know how or where to connect to your SAS system. Have you looked at the documentation that explains how to configure this: &lt;A href="https://sassoftware.github.io/saspy/install.html#configuration" target="_blank"&gt;https://sassoftware.github.io/saspy/install.html#configuration&lt;/A&gt;?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;As for the _authinfo file, there is no file extension. So I have to imagine you created _authinfo.txt, which isn't the correct filename. The error below,&amp;nbsp;[Errno 2] No such file or directory: 'C:\\Users\\akarmanov\\_authinfo', shows that the correct file isn't there, or isn't accessible by you - it's probably the filename I would guess.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;validvarname is not a parameter on the SASsession method.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Where is the SAS system you are trying to connect to? Is it a local install? Is it a workspace server somewhere? Depending upon where it is and how you need to connect to it, the configuration definition will need different parameters; that's all in the documentation, but I can help you with that if I had more information.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Tom&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2019 13:40:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sas-Authkey/m-p/581407#M165243</guid>
      <dc:creator>sastpw</dc:creator>
      <dc:date>2019-08-15T13:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: Sas Authkey</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sas-Authkey/m-p/581967#M165459</link>
      <description>Tom, thank you for the advice.&lt;BR /&gt;&lt;BR /&gt;I was able to achieve what I wanted by removing the .txt extension from the _authinfo file. I also removed the validvarname parameter from SASsession, as you recommended. Very grateful to you.</description>
      <pubDate>Sat, 17 Aug 2019 19:56:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sas-Authkey/m-p/581967#M165459</guid>
      <dc:creator>krmnv</dc:creator>
      <dc:date>2019-08-17T19:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Sas Authkey</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sas-Authkey/m-p/582096#M165508</link>
      <description>&lt;P&gt;Great, I'm glad that's all it was. BTW, there's another configuration definition key you can add to your configuration definition to has the validvarname option set every time you connect (if that's what you want). There's an 'autoexec':'string of SAS code;' which will be automatically executed for you when a session is established. So if you want validvarname=any every time you connect using a given configuration definition you can add&lt;/P&gt;
&lt;P&gt;'autoexec' : 'options validvarname=any;'&lt;/P&gt;
&lt;P&gt;and it will automatically be set for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From the doc:&lt;/P&gt;
&lt;P&gt;autoexec -This is a string of SAS code that will be submitted upon establishing a connection. You can use this to preassign libraries you always want available, or whatever you want. Don’t confuse this with the autoexec option of SAS which specifies a sas program file to be run. That is different. This is a string of SAS code saspy will submit after the session is created, which would be after SAS already included any autoexec file if there was one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2019 13:05:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sas-Authkey/m-p/582096#M165508</guid>
      <dc:creator>sastpw</dc:creator>
      <dc:date>2019-08-19T13:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: Sas Authkey</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sas-Authkey/m-p/695997#M212487</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the same issue as krmnv. I already removed the extension on my _authinfo but it still gives me error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV class="container"&gt;&lt;DIV class="cell code_cell rendered selected"&gt;&lt;DIV class="output_wrapper"&gt;&lt;DIV class="output"&gt;&lt;DIV class="output_area"&gt;&lt;DIV class="output_subarea output_text output_stream output_stdout"&gt;&lt;PRE&gt;Error trying to read authinfo file:C:\Users\uxxx421\_authinfo
[Errno 2] No such file or directory: 'C:\\Users\\uxxx421\\_authinfo'
Did not find key saspykey in authinfo file:C:\Users\uxxx421\_authinfo&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is my sasfgc_personal.py -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;SAS_config_names=['winiomwin']

winiomwin = {'java' : 'java',
'iomhost' : 'hostname',
'iomport' : 8561,
'encoding' : 'windows-1252',
'authkey' : 'saspykey'
}

&lt;/PRE&gt;&lt;P&gt;Can you help me solve this thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 02 Nov 2020 16:59:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sas-Authkey/m-p/695997#M212487</guid>
      <dc:creator>jcheng311</dc:creator>
      <dc:date>2020-11-02T16:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: Sas Authkey</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sas-Authkey/m-p/697667#M213248</link>
      <description>&lt;P&gt;Hey, you are getting a system error trying to open that file. It either doesn't exist or you don't have permission. That's what the error:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;[Errno 2] No such file or directory: 'C:\\Users\\uxxx421\\_authinfo'&lt;/PRE&gt;
&lt;P&gt;would be. Are you sure you have that file, named correctly, in that path?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2020 16:49:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sas-Authkey/m-p/697667#M213248</guid>
      <dc:creator>sastpw</dc:creator>
      <dc:date>2020-11-09T16:49:42Z</dc:date>
    </item>
  </channel>
</rss>

