<?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: Read CSv File open by another person in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Read-CSv-File-open-by-another-person/m-p/112995#M259145</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have had this problem in the past and the way around it is very similar to the above but using pipes;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename dirlist PIPE 'copy "&lt;A href="https://communities.sas.com/"&gt;\\[SERVER]\[FOLDER]\[FILE].csv&lt;/A&gt;" &lt;A href="https://communities.sas.com/"&gt;\\[SERVER]\[FOLDER&lt;/A&gt;] /y '; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data dirlist;&lt;BR /&gt; infile dirlist missover pad;&lt;BR /&gt; input&amp;nbsp; Filename $ 1-100 ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc Print data=dirlist; &lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Jun 2013 23:47:43 GMT</pubDate>
    <dc:creator>Ce_Wo</dc:creator>
    <dc:date>2013-06-20T23:47:43Z</dc:date>
    <item>
      <title>Read CSv File open by another person</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-CSv-File-open-by-another-person/m-p/112988#M259138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello. In general when you try to input a csv file through an infile statement, if someone has that csv file open, you get the error "&lt;SPAN style="color: #ff0000;"&gt;The process cannot access the file because it is being used by another process"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;This is using Base SAS &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;windows 7 environment &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;accessing a file on a shared network drive&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Is there a known way around this issue? I have to read this file on a specific timing basis, however it is highly likely that someone will be using this file at the time I need to open it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Would the only solution be to make a copy of the file using the command line from with SAS, and then read in that copy of the file?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;As always, thanks for the help!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Brandon&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jun 2013 21:49:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-CSv-File-open-by-another-person/m-p/112988#M259138</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2013-06-19T21:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: Read CSv File open by another person</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-CSv-File-open-by-another-person/m-p/112989#M259139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you will find that the other person has the file open in MS Excel, the Windows 'default' application for CSV files.&amp;nbsp; Excel locks any file it has open.&amp;nbsp; Normally text files can be read by multiple users, but Excel locks in case any changes are made.&lt;/P&gt;&lt;P&gt;Talk to your systems admin to see if there is a solution whereby the file can be kept in a folder where only you have write access.&amp;nbsp; You only need read access, but anyone else wanting to read the file in Excel will be forced to make a copy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2013 10:43:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-CSv-File-open-by-another-person/m-p/112989#M259139</guid>
      <dc:creator>RichardinOz</dc:creator>
      <dc:date>2013-06-20T10:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: Read CSv File open by another person</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-CSv-File-open-by-another-person/m-p/112990#M259140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Richard. This is what I had feared. Unfortunately other people need to be able to access the Excel file in question to make changes to the base data with in, which will then be loaded into a database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Okay, it looks like I will be forced to write the code to make a copy of the file first (this can be done even while locked from Excel, not sure why that is), and then read in the data from the file copy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Brandon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2013 14:06:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-CSv-File-open-by-another-person/m-p/112990#M259140</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2013-06-20T14:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: Read CSv File open by another person</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-CSv-File-open-by-another-person/m-p/112991#M259141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;On UNIX there is FILELOCKS system option that would allow SAS to ignore the lock and read the file.&amp;nbsp; I could not find that option documented for Winders.&amp;nbsp; You might try it might work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2013 14:44:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-CSv-File-open-by-another-person/m-p/112991#M259141</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2013-06-20T14:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: Read CSv File open by another person</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-CSv-File-open-by-another-person/m-p/112992#M259142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it a problem that you might not get the latest data in the copy? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont have a lot experience with people actively updating csv files, but I imagine the data in the copy would not have the updated information. Could you move it to Access?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just a thought!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2013 14:52:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-CSv-File-open-by-another-person/m-p/112992#M259142</guid>
      <dc:creator>esjackso</dc:creator>
      <dc:date>2013-06-20T14:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: Read CSv File open by another person</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-CSv-File-open-by-another-person/m-p/112993#M259143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is actually not a problem if I do not get the latest data, as the process is set up dynamically to update data as of the grab time (even if someone is working in it, or at least it would be without the locking problem).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sadly Access is not available as a solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2013 14:55:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-CSv-File-open-by-another-person/m-p/112993#M259143</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2013-06-20T14:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: Read CSv File open by another person</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-CSv-File-open-by-another-person/m-p/112994#M259144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I have done quite a bit of testing, and it turns out as long as you use a call system option, SAS can copy any file regardless of its locked status.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As such, I will simply use the following code, and then use the newly copied file as part of my coding solutions in the future.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000e6; font-size: 10pt;"&gt;OPTIONS&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; NOXWAIT XSYNC;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #0000e6; font-size: 10pt;"&gt;DATA&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; _NULL_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000e6; font-size: 10pt;"&gt;CALL&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; SYSTEM (&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 10pt;"&gt;"copy ""G:\Input File Template_6.19.13 v1.csv"" ""G:\Input File Template_6.19.13 v1 test.csv"""&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #0000e6; font-size: 10pt;"&gt;RUN&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;This is a 'easy enough' way to get around the problem of file location, while the only cost is the time it takes the command line to create a copy of the given file (not to bad in this instance since the file will only get to 100 MB max).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks for the help everyone!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2013 15:20:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-CSv-File-open-by-another-person/m-p/112994#M259144</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2013-06-20T15:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: Read CSv File open by another person</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-CSv-File-open-by-another-person/m-p/112995#M259145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have had this problem in the past and the way around it is very similar to the above but using pipes;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename dirlist PIPE 'copy "&lt;A href="https://communities.sas.com/"&gt;\\[SERVER]\[FOLDER]\[FILE].csv&lt;/A&gt;" &lt;A href="https://communities.sas.com/"&gt;\\[SERVER]\[FOLDER&lt;/A&gt;] /y '; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data dirlist;&lt;BR /&gt; infile dirlist missover pad;&lt;BR /&gt; input&amp;nbsp; Filename $ 1-100 ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc Print data=dirlist; &lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2013 23:47:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-CSv-File-open-by-another-person/m-p/112995#M259145</guid>
      <dc:creator>Ce_Wo</dc:creator>
      <dc:date>2013-06-20T23:47:43Z</dc:date>
    </item>
  </channel>
</rss>

