<?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: %INCLUDEing URLs? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/INCLUDEing-URLs/m-p/649013#M194518</link>
    <description>&lt;P&gt;Deassign the filename when you're done with it, then you can safely use it again later.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename a;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 19 May 2020 20:24:07 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2020-05-19T20:24:07Z</dc:date>
    <item>
      <title>%INCLUDEing URLs?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INCLUDEing-URLs/m-p/649007#M194516</link>
      <description>&lt;P&gt;One can %INCLUDE a local SAS file as follows.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%include "a.sas";&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If the SAS file is a URL, then it would be&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename a url "https://www.sas.com/a.sas";
%include a;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So it would be troublesome if I reuse the filename "a" somewhere inside the %INCLUDEd code. Is there any way to avoid the FILENAME a to avoid the reuse collision? If impossible, then is there any way to list all the used FILENAME to avoid such collision and manage multiple SAS files smartly?&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2020 20:03:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INCLUDEing-URLs/m-p/649007#M194516</guid>
      <dc:creator>Junyong</dc:creator>
      <dc:date>2020-05-19T20:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: %INCLUDEing URLs?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INCLUDEing-URLs/m-p/649013#M194518</link>
      <description>&lt;P&gt;Deassign the filename when you're done with it, then you can safely use it again later.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename a;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 May 2020 20:24:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INCLUDEing-URLs/m-p/649013#M194518</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-05-19T20:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: %INCLUDEing URLs?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INCLUDEing-URLs/m-p/649015#M194520</link>
      <description>&lt;P&gt;If you are using a single Fileref, such as A, it is best practice to keep it pointing to same place.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can check values of assigned filerefs in your session by checking the contents of SASHELP.Vextfl. The view has the fileref the external file path and other details.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The SAS function FILEREF verifies if a fileref has been assigned for the current SAS session.&lt;/P&gt;
&lt;PRE&gt;Data result;
   assigned = fileref('Someref');
run;&lt;/PRE&gt;
&lt;P&gt;If the value returned is &amp;gt; 0 then not assigned, if &amp;lt;0 then the fileref exists but the physical file associated does not, 0 if the fileref is assigned and the file exists.&lt;/P&gt;
&lt;P&gt;Or the macro equivalent : %sysfunc(fileref(Someref))&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2020 20:29:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INCLUDEing-URLs/m-p/649015#M194520</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-05-19T20:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: %INCLUDEing URLs?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INCLUDEing-URLs/m-p/649039#M194524</link>
      <description>&lt;P&gt;If you don't have any control of what the included code does then you will just need to use a pattern that tries to minimize the risk of re-use of the name.&amp;nbsp; For example if you are using a macro then you might use &amp;amp;SYSINDEX automatic macro variable.&amp;nbsp; It increases every time you call a macro.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or you could ask SAS to just make up a name.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let fileref=;
%let rc=%sysfunc(filename(fileref,https://raw.githubusercontent.com/sasutils/macros/master/ds2post.sas,url));
%put &amp;amp;=rc &amp;amp;=fileref;
%include &amp;amp;fileref ;
filename &amp;amp;fileref;
%let&amp;nbsp;fileref=;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 May 2020 23:03:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INCLUDEing-URLs/m-p/649039#M194524</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-05-19T23:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: %INCLUDEing URLs?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INCLUDEing-URLs/m-p/649084#M194558</link>
      <description>&lt;P&gt;Suppose I %INCLUDE a SAS file b.sas using &lt;EM&gt;a&lt;/EM&gt; as follows.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename a "!userprofile\desktop\b.sas";
%include a;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And suppose I try to reuse the &lt;EM&gt;a&lt;/EM&gt;&amp;nbsp;for another SAS file a.sas inside the b.sas as follows.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename a;
filename a "!userprofile\desktop\a.sas";&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The following errors are produced when I execute the first code.&lt;/P&gt;&lt;PRE&gt;ERROR: At least one file associated with fileref A is still in use.
ERROR: Error in the FILENAME statement.
ERROR: At least one file associated with fileref A is still in use.
ERROR: Error in the FILENAME statement.&lt;/PRE&gt;&lt;P&gt;So I need to remember that the &lt;EM&gt;a&lt;/EM&gt; is now occupied by the first code to prevent any collision.&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 18:51:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INCLUDEing-URLs/m-p/649084#M194558</guid>
      <dc:creator>Junyong</dc:creator>
      <dc:date>2020-05-20T18:51:11Z</dc:date>
    </item>
  </channel>
</rss>

