<?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: Reading libname paths from a different SAS program in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-libname-paths-from-a-different-SAS-program/m-p/537393#M147803</link>
    <description>&lt;P&gt;There are a lot of things you can do to make the startup process dynamic. I have a piece of code in the autoexec_usermods.sas file of our workspace server that looks for a file called egauto.sas in the current user's home directory and includes it if found. This allows users to store personalizations centrally, and not lose settings when they get a new desktop computer.&lt;/P&gt;</description>
    <pubDate>Thu, 21 Feb 2019 13:53:53 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-02-21T13:53:53Z</dc:date>
    <item>
      <title>Reading libname paths from a different SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-libname-paths-from-a-different-SAS-program/m-p/536876#M147590</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Suppose in my desktop&amp;nbsp;I have a SAS 9.3&amp;nbsp;program called "step1.sas".&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step1.sas uses the following libpath:&lt;/P&gt;&lt;P&gt;libname LOCATION1 "C:\Users\Desktop\year2014\";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In another SAS program called "step2.sas", is it possible for me to read the libname path from step1.sas? This script definitely isn't right, but essentially this is&amp;nbsp;the&amp;nbsp;libpath I want in step2.sas:&lt;/P&gt;&lt;P&gt;libname LOCATION1 "C:\Users\Desktop\step1.sas where libname='LOCATION1' ";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ultimately, I'm trying to get step2.sas location1 = step1.sas location1 = "C:\Users\Desktop\year2014\"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thoughts?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 19:37:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-libname-paths-from-a-different-SAS-program/m-p/536876#M147590</guid>
      <dc:creator>LFern</dc:creator>
      <dc:date>2019-02-19T19:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: Reading libname paths from a different SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-libname-paths-from-a-different-SAS-program/m-p/536880#M147592</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you tried using a sas Zip filename instead.?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 19:48:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-libname-paths-from-a-different-SAS-program/m-p/536880#M147592</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2019-02-19T19:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: Reading libname paths from a different SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-libname-paths-from-a-different-SAS-program/m-p/536883#M147594</link>
      <description>&lt;P&gt;If you need library references across multiple programs, put the libnames into the autoexec or into an include.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 19:53:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-libname-paths-from-a-different-SAS-program/m-p/536883#M147594</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-02-19T19:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: Reading libname paths from a different SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-libname-paths-from-a-different-SAS-program/m-p/536884#M147595</link>
      <description>&lt;P&gt;No I haven't. I thought the zip filenames were for ".sas7bdat" files with data&amp;nbsp;rather than ".sas" programs with code.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 19:53:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-libname-paths-from-a-different-SAS-program/m-p/536884#M147595</guid>
      <dc:creator>LFern</dc:creator>
      <dc:date>2019-02-19T19:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: Reading libname paths from a different SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-libname-paths-from-a-different-SAS-program/m-p/536886#M147596</link>
      <description>&lt;P&gt;Are you asking how to read a SAS program and figure out if it defined a libref?&lt;/P&gt;
&lt;P&gt;Or perhaps read as SAS log and figure out if it defined a libref?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why not just run them both together in the same SAS session?&amp;nbsp; Then when STEP2 runs LOCATION will already be defined and there is no need to try to deduce what it should be.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 19:56:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-libname-paths-from-a-different-SAS-program/m-p/536886#M147596</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-02-19T19:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: Reading libname paths from a different SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-libname-paths-from-a-different-SAS-program/m-p/536887#M147597</link>
      <description>&lt;P&gt;As long as programs step1 and step2 run in the same SAS session when you only need to assign your LOCATION LIBNAME once in step1 then just refer to it in step2.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 19:56:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-libname-paths-from-a-different-SAS-program/m-p/536887#M147597</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-02-19T19:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: Reading libname paths from a different SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-libname-paths-from-a-different-SAS-program/m-p/536892#M147598</link>
      <description>Please excuse me. By mistake I answered a wrong question.</description>
      <pubDate>Tue, 19 Feb 2019 20:04:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-libname-paths-from-a-different-SAS-program/m-p/536892#M147598</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2019-02-19T20:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: Reading libname paths from a different SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-libname-paths-from-a-different-SAS-program/m-p/537340#M147778</link>
      <description>&lt;P&gt;You can read the&amp;nbsp;&lt;SPAN&gt;step1.sas using infile in a data step statement and issue an if statement where libname statement appears using a findw function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Then You can extract the lib path using a substring / scan function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But It is not a suggested way to go, better follow the method&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;mentioned. (Use AutoExec)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Feb 2019 08:42:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-libname-paths-from-a-different-SAS-program/m-p/537340#M147778</guid>
      <dc:creator>Satish_Parida</dc:creator>
      <dc:date>2019-02-21T08:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: Reading libname paths from a different SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-libname-paths-from-a-different-SAS-program/m-p/537385#M147797</link>
      <description>&lt;P&gt;Thank you for informing me about the autoexec option! It's exactly the kind of premise I'm going for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only problem with it is that it requires a user to change the properties of sas (the target path). Ideally though, I'd like for anyone to open&amp;nbsp;up any sas they have and run a program that is able to read a masterlist of libnames WITHOUT first changing the settings. Do you know of a way to invoke an autoexec file with a line of code instead of changing the target path?&amp;nbsp;For example, at the&amp;nbsp;top of step1.sas, a line of code that says "read in libnames from autoexec.sas"?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again, the autoexec is exactly what I'm going for...I'm using hoping to automate its function without users changing their settings.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate any help I can get.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Feb 2019 13:30:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-libname-paths-from-a-different-SAS-program/m-p/537385#M147797</guid>
      <dc:creator>LFern</dc:creator>
      <dc:date>2019-02-21T13:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: Reading libname paths from a different SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-libname-paths-from-a-different-SAS-program/m-p/537386#M147798</link>
      <description>&lt;P&gt;Hi there!&lt;/P&gt;&lt;P&gt;The autoexec option is similar to what I want to achieve. However, I don't want users to need to change their SAS properties (i.e., the target path).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you know of a way that a user can call up an autoexec file in a line of code?...such as "set&amp;nbsp;\\whateverpath\autoexec.sas"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for any help on this!&lt;/P&gt;</description>
      <pubDate>Thu, 21 Feb 2019 13:36:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-libname-paths-from-a-different-SAS-program/m-p/537386#M147798</guid>
      <dc:creator>LFern</dc:creator>
      <dc:date>2019-02-21T13:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: Reading libname paths from a different SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-libname-paths-from-a-different-SAS-program/m-p/537388#M147799</link>
      <description>&lt;P&gt;You can use %include&amp;nbsp; (already suggested by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; )&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%include "\\path\autoexec.sas";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Feb 2019 13:39:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-libname-paths-from-a-different-SAS-program/m-p/537388#M147799</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-02-21T13:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: Reading libname paths from a different SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-libname-paths-from-a-different-SAS-program/m-p/537390#M147801</link>
      <description>&lt;P&gt;AHHHHH that's perfect!!! Thank you so much!&lt;/P&gt;</description>
      <pubDate>Thu, 21 Feb 2019 13:42:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-libname-paths-from-a-different-SAS-program/m-p/537390#M147801</guid>
      <dc:creator>LFern</dc:creator>
      <dc:date>2019-02-21T13:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: Reading libname paths from a different SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-libname-paths-from-a-different-SAS-program/m-p/537391#M147802</link>
      <description>&lt;P&gt;Another user just informed me what you meant by %include and how that achieves what I want! Thank you again!!&lt;/P&gt;</description>
      <pubDate>Thu, 21 Feb 2019 13:43:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-libname-paths-from-a-different-SAS-program/m-p/537391#M147802</guid>
      <dc:creator>LFern</dc:creator>
      <dc:date>2019-02-21T13:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: Reading libname paths from a different SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-libname-paths-from-a-different-SAS-program/m-p/537393#M147803</link>
      <description>&lt;P&gt;There are a lot of things you can do to make the startup process dynamic. I have a piece of code in the autoexec_usermods.sas file of our workspace server that looks for a file called egauto.sas in the current user's home directory and includes it if found. This allows users to store personalizations centrally, and not lose settings when they get a new desktop computer.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Feb 2019 13:53:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-libname-paths-from-a-different-SAS-program/m-p/537393#M147803</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-02-21T13:53:53Z</dc:date>
    </item>
  </channel>
</rss>

