<?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 Import a locked excel file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Import-a-locked-excel-file/m-p/398773#M96491</link>
    <description>&lt;P&gt;I have a batch that will read data from an excel file on a daily basis, and run the programs whose filepath is included in the file. This will make it easier to add new programs to the batch, and keep track of which programs have a batch job.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Few people have access to the excel-file, and getting a lock would be quite rare, as the batch runs outside of working hours. Still, I was wondering if there is a way to read the file even if the excel file is opened by someone. There doesn't seem to be a sas-spesific way to do this, but I can sort of imagine how to write this as a shell script that either runs is the file has a lock, as a X-command, or just writing a standalone shellscprit that either forces a close or makes a copy, so that the batch can import the file with the contents of the previously saved file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a standard best practice for such situations?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 26 Sep 2017 12:36:27 GMT</pubDate>
    <dc:creator>Ullsokk</dc:creator>
    <dc:date>2017-09-26T12:36:27Z</dc:date>
    <item>
      <title>Import a locked excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-a-locked-excel-file/m-p/398773#M96491</link>
      <description>&lt;P&gt;I have a batch that will read data from an excel file on a daily basis, and run the programs whose filepath is included in the file. This will make it easier to add new programs to the batch, and keep track of which programs have a batch job.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Few people have access to the excel-file, and getting a lock would be quite rare, as the batch runs outside of working hours. Still, I was wondering if there is a way to read the file even if the excel file is opened by someone. There doesn't seem to be a sas-spesific way to do this, but I can sort of imagine how to write this as a shell script that either runs is the file has a lock, as a X-command, or just writing a standalone shellscprit that either forces a close or makes a copy, so that the batch can import the file with the contents of the previously saved file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a standard best practice for such situations?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 12:36:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-a-locked-excel-file/m-p/398773#M96491</guid>
      <dc:creator>Ullsokk</dc:creator>
      <dc:date>2017-09-26T12:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Import a locked excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-a-locked-excel-file/m-p/398782#M96496</link>
      <description>&lt;P&gt;Don't keep such control data in a spreadsheet file, use a text file instead, and edit it with a text editor.&lt;/P&gt;
&lt;P&gt;Notepad++ or the standard Windows Editor (just to give some examples) do not lock the file.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 12:58:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-a-locked-excel-file/m-p/398782#M96496</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-09-26T12:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Import a locked excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-a-locked-excel-file/m-p/398783#M96497</link>
      <description>&lt;P&gt;Have you tried testing this to see what happens? I ask because as you aren't writing back to the excel file I can't see why there would be an issue as sas would presumably just get a read only version of the file just as a user would when they open a worksheet already opened by another user.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 13:00:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-a-locked-excel-file/m-p/398783#M96497</guid>
      <dc:creator>andrewboyd</dc:creator>
      <dc:date>2017-09-26T13:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: Import a locked excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-a-locked-excel-file/m-p/398784#M96498</link>
      <description>&lt;P&gt;That will probably not be an option in my case. In any case, I am planning to use a x-command to create a temporary copy of the file if it is already open. The only problem is getting SAS to check if the file is already open.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 13:00:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-a-locked-excel-file/m-p/398784#M96498</guid>
      <dc:creator>Ullsokk</dc:creator>
      <dc:date>2017-09-26T13:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: Import a locked excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-a-locked-excel-file/m-p/398786#M96499</link>
      <description>&lt;P&gt;On second thought, I might as well just make a copy and read that file instead. No need to run a condition beforehand&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 13:06:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-a-locked-excel-file/m-p/398786#M96499</guid>
      <dc:creator>Ullsokk</dc:creator>
      <dc:date>2017-09-26T13:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Import a locked excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-a-locked-excel-file/m-p/398880#M96532</link>
      <description>&lt;P&gt;Write a Powershell script to kill the task.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 17:46:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-a-locked-excel-file/m-p/398880#M96532</guid>
      <dc:creator>AlanC</dc:creator>
      <dc:date>2017-09-26T17:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: Import a locked excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-a-locked-excel-file/m-p/398891#M96539</link>
      <description>&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/24992681/powershell-check-if-a-file-is-locked" target="_blank"&gt;https://stackoverflow.com/questions/24992681/powershell-check-if-a-file-is-locked&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 18:13:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-a-locked-excel-file/m-p/398891#M96539</guid>
      <dc:creator>AlanC</dc:creator>
      <dc:date>2017-09-26T18:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: Import a locked excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-a-locked-excel-file/m-p/398941#M96562</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13798"&gt;@AlanC&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;Write a Powershell script to kill the task.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Hardly possible to do in a Client-Server-Setup, the task locking the Excel-file will most likely not be running on the same machine as the sas process.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 20:32:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-a-locked-excel-file/m-p/398941#M96562</guid>
      <dc:creator>error_prone</dc:creator>
      <dc:date>2017-09-26T20:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: Import a locked excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-a-locked-excel-file/m-p/398942#M96563</link>
      <description>&lt;P&gt;Powershell can be executed remotely. However, I don't think we have enough informationas to the configuration of the system in question here.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 20:43:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-a-locked-excel-file/m-p/398942#M96563</guid>
      <dc:creator>AlanC</dc:creator>
      <dc:date>2017-09-26T20:43:53Z</dc:date>
    </item>
  </channel>
</rss>

