<?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: Is there an advantage or reason to clear libname statements? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Is-there-an-advantage-or-reason-to-clear-libname-statements/m-p/794331#M32837</link>
    <description>&lt;P&gt;Whether you clear or don't clear SAS libraries in your SAS programs depends on a variety of factors. If these programs are using SAS libraries that are shared across many SAS users, then normally these would be set up automatically when you start SAS and there would be no need to clear them once you have finished with them. On the other hand if the SAS library is specific to the program then it does make sense to clear it after use.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd also make the point that if you are running SAS programs on a regular basis like once a day or week or month then you should be scheduling these using a scheduling tool and running the programs in batch mode. In this case clearing LIBNAMEs doesn't make a lot of sense as they will be lost when the program finishes anyway.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 03 Feb 2022 19:22:03 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2022-02-03T19:22:03Z</dc:date>
    <item>
      <title>Is there an advantage or reason to clear libname statements?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Is-there-an-advantage-or-reason-to-clear-libname-statements/m-p/794286#M32818</link>
      <description>&lt;P&gt;Hoping everyone is well today.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Due to a recent job change, I have inherited code that has passed through a number of prior colleagues, and I'm currently trying to clean it up as time permits.&amp;nbsp; I found today code that actually clears librefs, and it started me wondering why that would be done and if there's an advantage or a reason I should either continue in certain scenarios or not worry about it.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code in which I found the libname clear statement does create a temporary custom library, so it seems to be logical (in my mind, anyway).&amp;nbsp; Most of the code I write creates libraries directly out of system databases (read only access), so I wasn't sure if clearing libnames is necessary or advisable.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance!&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Matt D&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 17:09:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Is-there-an-advantage-or-reason-to-clear-libname-statements/m-p/794286#M32818</guid>
      <dc:creator>hnb_matt_d</dc:creator>
      <dc:date>2022-02-03T17:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an advantage or reason to clear libname statements?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Is-there-an-advantage-or-reason-to-clear-libname-statements/m-p/794293#M32824</link>
      <description>&lt;P&gt;Sometimes programmers use the same name to reference a library but it's a different location. For example, we have a specific folder structure for our projects so I often have a 'results' library in programs to output final results as well as a 'raw' library to store inputs. For each project these are actually different folders in the file structure. But the library names are the same in many programs so in this case it's definitely good to clear them in case something goes awry!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/306354"&gt;@hnb_matt_d&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hoping everyone is well today.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Due to a recent job change, I have inherited code that has passed through a number of prior colleagues, and I'm currently trying to clean it up as time permits.&amp;nbsp; I found today code that actually clears librefs, and it started me wondering why that would be done and if there's an advantage or a reason I should either continue in certain scenarios or not worry about it.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code in which I found the libname clear statement does create a temporary custom library, so it seems to be logical (in my mind, anyway).&amp;nbsp; Most of the code I write creates libraries directly out of system databases (read only access), so I wasn't sure if clearing libnames is necessary or advisable.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance!&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Matt D&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 17:24:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Is-there-an-advantage-or-reason-to-clear-libname-statements/m-p/794293#M32824</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-02-03T17:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an advantage or reason to clear libname statements?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Is-there-an-advantage-or-reason-to-clear-libname-statements/m-p/794295#M32826</link>
      <description>Thanks, Reeza!  Makes sense now!</description>
      <pubDate>Thu, 03 Feb 2022 17:26:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Is-there-an-advantage-or-reason-to-clear-libname-statements/m-p/794295#M32826</guid>
      <dc:creator>hnb_matt_d</dc:creator>
      <dc:date>2022-02-03T17:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an advantage or reason to clear libname statements?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Is-there-an-advantage-or-reason-to-clear-libname-statements/m-p/794331#M32837</link>
      <description>&lt;P&gt;Whether you clear or don't clear SAS libraries in your SAS programs depends on a variety of factors. If these programs are using SAS libraries that are shared across many SAS users, then normally these would be set up automatically when you start SAS and there would be no need to clear them once you have finished with them. On the other hand if the SAS library is specific to the program then it does make sense to clear it after use.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd also make the point that if you are running SAS programs on a regular basis like once a day or week or month then you should be scheduling these using a scheduling tool and running the programs in batch mode. In this case clearing LIBNAMEs doesn't make a lot of sense as they will be lost when the program finishes anyway.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 19:22:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Is-there-an-advantage-or-reason-to-clear-libname-statements/m-p/794331#M32837</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-02-03T19:22:03Z</dc:date>
    </item>
  </channel>
</rss>

