<?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: Proc Import not closing output file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Import-not-closing-output-file/m-p/959865#M374471</link>
    <description>&lt;P&gt;The OPEN function will indeed create a file lock. The CLOSE function will remove it. It is always a good idea to ensure that you CLOSE OPENed files explicitly in your SAS application and not rely on just closing your SAS session which will also release these file locks.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Feb 2025 23:55:50 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2025-02-20T23:55:50Z</dc:date>
    <item>
      <title>Proc Import not closing output file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Import-not-closing-output-file/m-p/959862#M374469</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;I have a program that imports a large number of spreadsheets into data sets. It runs fine the first time. The second time I run it, I get errors because the output data set is being used. Proc datasets also cannot delete the data sets. The code is like the following (inside a macro loop that generates different &amp;amp;seriesid values.&lt;/P&gt;
&lt;P&gt;I'm using EG 8.5 (8.5.0.203) (32-bit).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename _TSss temp;&lt;BR /&gt;proc http method="get"&lt;BR /&gt;     url="&amp;amp;tableURL"&lt;BR /&gt;     out=_TSss;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc import datafile=_TSss out=_TSss_&amp;amp;seriesid dbms=xlsx replace;
      range=&amp;amp;seriesid._data; 
      getnames=no;
    run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2025 23:10:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Import-not-closing-output-file/m-p/959862#M374469</guid>
      <dc:creator>BruceBrad</dc:creator>
      <dc:date>2025-02-20T23:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import not closing output file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Import-not-closing-output-file/m-p/959864#M374470</link>
      <description>&lt;P&gt;Found the problem (I think). Nothing to do with proc import. Later in the program I run this macro which I use to rename the first variable in the file. I guess I need to put a close statement in there somewhere?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro FirstVName(data);
%* returns the name of the first variable in a file;
%let dsid = %sysfunc(open(&amp;amp;data,i));
%sysfunc(varname(&amp;amp;dsid,1))
%mend FirstVName;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Feb 2025 23:46:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Import-not-closing-output-file/m-p/959864#M374470</guid>
      <dc:creator>BruceBrad</dc:creator>
      <dc:date>2025-02-20T23:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import not closing output file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Import-not-closing-output-file/m-p/959865#M374471</link>
      <description>&lt;P&gt;The OPEN function will indeed create a file lock. The CLOSE function will remove it. It is always a good idea to ensure that you CLOSE OPENed files explicitly in your SAS application and not rely on just closing your SAS session which will also release these file locks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2025 23:55:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Import-not-closing-output-file/m-p/959865#M374471</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2025-02-20T23:55:50Z</dc:date>
    </item>
  </channel>
</rss>

