<?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: Import a CSV file that could be opened by someone else in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Import-a-CSV-file-that-could-be-opened-by-someone-else/m-p/263746#M51633</link>
    <description>&lt;P&gt;If you make the file &lt;STRONG&gt;readonly&lt;/STRONG&gt; (in Windows) then you can concurently read in in, say, Excel and import it with SAS. Another option is to open the file for readonly in Excel (it's an option in the open dialog); you can then import it with SAS at the same time.&lt;/P&gt;</description>
    <pubDate>Thu, 14 Apr 2016 03:29:27 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2016-04-14T03:29:27Z</dc:date>
    <item>
      <title>Import a CSV file that could be opened by someone else</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-a-CSV-file-that-could-be-opened-by-someone-else/m-p/263687#M51618</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My&amp;nbsp;question is quite simple, is it possible to avoid getting an error when running a proc import of a CSV file that would be opened by someone else during the&amp;nbsp;execution of the SAS program ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using SAS 9.4 (M1) 32bits on Microsoft 7.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance for the feedback!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kr,&lt;/P&gt;
&lt;P&gt;Florent&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2016 21:23:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-a-CSV-file-that-could-be-opened-by-someone-else/m-p/263687#M51618</guid>
      <dc:creator>Florent</dc:creator>
      <dc:date>2016-04-13T21:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: Import a CSV file that could be opened by someone else</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-a-CSV-file-that-could-be-opened-by-someone-else/m-p/263689#M51619</link>
      <description>&lt;P&gt;It depends on the program the other person is using to view the file. Some applications lock the file for possible editing, Excel, Word, Wordpad and such are examples. If the file is viewed with something that doesn't locke the file such as a web browser then the file isn't locked and can be read by multile users.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since this is more of an operating system behavior I'm&amp;nbsp;not sure much can be done is SAS other than to try to copy the file before someone else opens and locks it.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2016 21:37:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-a-CSV-file-that-could-be-opened-by-someone-else/m-p/263689#M51619</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-04-13T21:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: Import a CSV file that could be opened by someone else</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-a-CSV-file-that-could-be-opened-by-someone-else/m-p/263746#M51633</link>
      <description>&lt;P&gt;If you make the file &lt;STRONG&gt;readonly&lt;/STRONG&gt; (in Windows) then you can concurently read in in, say, Excel and import it with SAS. Another option is to open the file for readonly in Excel (it's an option in the open dialog); you can then import it with SAS at the same time.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 03:29:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-a-CSV-file-that-could-be-opened-by-someone-else/m-p/263746#M51633</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-04-14T03:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: Import a CSV file that could be opened by someone else</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-a-CSV-file-that-could-be-opened-by-someone-else/m-p/263753#M51636</link>
      <description>&lt;P&gt;Even if the file is open ni Excel, Windows can copy it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could do something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%let file    =path\text.csv;

data _null_;    
  %*copy file and display OS process output; 
  infile  "copy ""&amp;amp;file"" ""&amp;amp;file._COPY"" " pipe;
  input; 
  put _infile_;
run;

data _null_;
  %*read file;
  infile "&amp;amp;file._COPY"  ;
  input;
  put _infile_;
run;

%*delete file when done; 
x "del ""&amp;amp;file._COPY"" " ;
          

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Apr 2016 03:48:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-a-CSV-file-that-could-be-opened-by-someone-else/m-p/263753#M51636</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2016-04-14T03:48:48Z</dc:date>
    </item>
    <item>
      <title>Re: Import a CSV file that could be opened by someone else</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-a-CSV-file-that-could-be-opened-by-someone-else/m-p/263791#M51644</link>
      <description>&lt;P&gt;Why would you encounter this issue? &amp;nbsp;The import procedure should be a documented process whereby data is recieved and imported, then validated, at no point in the process should the file be open by someone else? &amp;nbsp;What if they change somethin and save after your program has finished for example. &amp;nbsp;Identify the part of the process that is failing and fix that rather than trying to work around it.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 08:23:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-a-CSV-file-that-could-be-opened-by-someone-else/m-p/263791#M51644</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-04-14T08:23:51Z</dc:date>
    </item>
  </channel>
</rss>

