<?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: Project failed due to CSV file being used/opened by other user or programme in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613687#M179256</link>
    <description>My bad.&lt;BR /&gt;&lt;BR /&gt;Operating System:   LIN X64 .</description>
    <pubDate>Tue, 24 Dec 2019 06:01:26 GMT</pubDate>
    <dc:creator>Suzy_Cat</dc:creator>
    <dc:date>2019-12-24T06:01:26Z</dc:date>
    <item>
      <title>Project failed due to CSV file being used/opened by other user or programme</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613483#M179169</link>
      <description>&lt;P&gt;Hey there,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just found that if someone is using the CSV file that the SAS programme is trying to override then it will failed to export to CSV on the designated location.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is hard to tell when and who will be using it at the time as the outputs meant to be used by other programme and users.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any solution to resolve this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2019 01:49:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613483#M179169</guid>
      <dc:creator>Suzy_Cat</dc:creator>
      <dc:date>2019-12-23T01:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: Project failed due to CSV file being used/opened by other user or programme</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613488#M179170</link>
      <description>&lt;P&gt;One possible solution is given at the end of this thread:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT style="background-color: #ffffff;"&gt;&lt;A href="https://communities.sas.com/t5/ODS-and-Base-Reporting/ERROR-File-is-in-use/td-p/32964" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/ODS-and-Base-Reporting/ERROR-File-is-in-use/td-p/32964&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2019 07:39:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613488#M179170</guid>
      <dc:creator>Norman21</dc:creator>
      <dc:date>2019-12-23T07:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: Project failed due to CSV file being used/opened by other user or programme</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613490#M179171</link>
      <description>&lt;P&gt;If your SAS runs on a UNIX, there is a trick to prevent the collision, but it requires that XCMD (running external commands) is enabled.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2019 07:55:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613490#M179171</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-12-23T07:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: Project failed due to CSV file being used/opened by other user or programme</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613672#M179244</link>
      <description>&lt;P&gt;Very useful info suggested. Thank you for your help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 03:55:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613672#M179244</guid>
      <dc:creator>Suzy_Cat</dc:creator>
      <dc:date>2019-12-24T03:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: Project failed due to CSV file being used/opened by other user or programme</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613673#M179245</link>
      <description>&lt;P&gt;my SAS is running on a server.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 03:57:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613673#M179245</guid>
      <dc:creator>Suzy_Cat</dc:creator>
      <dc:date>2019-12-24T03:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: Project failed due to CSV file being used/opened by other user or programme</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613676#M179247</link>
      <description>&lt;P&gt;You could go for an approach where you create a timestamp as part of the file name. This way the file you create is always new (new name) and no one can lock it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If dealing with downstream processes where you can't control dependencies (here: users opening your file) I'd always go for a design approach where you first create the file in another location which no one can access and then have a separate copy/move process to the location for downstream consumption.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp; hints if your SAS Servers runs under Unix/Linux and you've got SAS option XCMD set then there are ways to copy/move your file to the final destination even if there is a lock on the target file.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 07:10:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613676#M179247</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-12-24T07:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: Project failed due to CSV file being used/opened by other user or programme</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613678#M179248</link>
      <description>&lt;P&gt;Sounds like a good solution - Thank&amp;nbsp;&amp;nbsp;you &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;, I will test if it works at my end.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any chance to provide the code to copy/back up data to a different folder by SAS option XCMD&amp;nbsp;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sue&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 05:22:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613678#M179248</guid>
      <dc:creator>Suzy_Cat</dc:creator>
      <dc:date>2019-12-24T05:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: Project failed due to CSV file being used/opened by other user or programme</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613680#M179249</link>
      <description>&lt;P&gt;SAS option XCMD enables you to issue OS level commands out of a SAS session. What the valid commands are depends on your operating system (the OS of the SAS server).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following command will show you in the SAS log if the option is set to XCMD or NOXCMD&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc options option=xcmd;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And this macro variable will tell you the OS of your SAS Server&lt;/P&gt;
&lt;PRE&gt;%put &amp;amp;=SYSHOSTINFOLONG;&lt;/PRE&gt;
&lt;P&gt;You need to tell us what you have for us to support you further.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 05:33:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613680#M179249</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-12-24T05:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: Project failed due to CSV file being used/opened by other user or programme</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613681#M179250</link>
      <description>XCMD              The X Command is valid in this SAS session.&lt;BR /&gt;NOTE: PROCEDURE OPTIONS used (Total process time):&lt;BR /&gt;      real time           0.00 seconds&lt;BR /&gt;      cpu time            0.00 seconds&lt;BR /&gt;      &lt;BR /&gt;&lt;BR /&gt;18         &lt;BR /&gt;19         %put &amp;amp;=SYSHOSTINFOLONG;&lt;BR /&gt;WARNING: Apparent symbolic reference SYSHOSTINFOLONG not resolved.&lt;BR /&gt;SYSHOSTINFOLONG</description>
      <pubDate>Tue, 24 Dec 2019 05:39:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613681#M179250</guid>
      <dc:creator>Suzy_Cat</dc:creator>
      <dc:date>2019-12-24T05:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: Project failed due to CSV file being used/opened by other user or programme</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613683#M179252</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;19 %put &amp;amp;=SYSHOSTINFOLONG;&lt;BR /&gt;WARNING: Apparent symbolic reference SYSHOSTINFOLONG not resolved.&lt;BR /&gt;SYSHOSTINFOLONG&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then execute below and examine if any of the macro variables provides the info which OS you're having.&lt;/P&gt;
&lt;PRE&gt;%put _all_;&lt;/PRE&gt;
&lt;P&gt;If above doesn't return the required info then run below. This tells you which type of OS you've got a SAS license for.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc setinit;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 05:43:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613683#M179252</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-12-24T05:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: Project failed due to CSV file being used/opened by other user or programme</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613685#M179254</link>
      <description />
      <pubDate>Tue, 24 Dec 2019 06:06:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613685#M179254</guid>
      <dc:creator>Suzy_Cat</dc:creator>
      <dc:date>2019-12-24T06:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Project failed due to CSV file being used/opened by other user or programme</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613686#M179255</link>
      <description>&lt;P&gt;That doesn't tell us the OS. There must be a line a bit higher up in the SAS log starting with:&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Operating System:&amp;nbsp;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 05:59:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613686#M179255</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-12-24T05:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: Project failed due to CSV file being used/opened by other user or programme</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613687#M179256</link>
      <description>My bad.&lt;BR /&gt;&lt;BR /&gt;Operating System:   LIN X64 .</description>
      <pubDate>Tue, 24 Dec 2019 06:01:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613687#M179256</guid>
      <dc:creator>Suzy_Cat</dc:creator>
      <dc:date>2019-12-24T06:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: Project failed due to CSV file being used/opened by other user or programme</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613690#M179258</link>
      <description>&lt;P&gt;I can't fully test it but I believe the mv command doesn't care about locks and though should allow to replace the target file even if a user locks it (this user will then still see the old data until refreshing the connection).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  x 'mv -f ~/test_new.txt ~/test_orig.txt';
  stop;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If the mv alone doesn't work (but it should) then you would first issue a rename command for the target file and then move the new source file to the target (with the name of the target file you want to have it).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The ~ in above code is short hand for the Home directory. You would likely want to replace this with the actual paths for source and target.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If using double quotes then you can also use SAS Macro variables in the X command (like for the path names). These macro variables get then resolved before the X command executes.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 06:38:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613690#M179258</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-12-24T06:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: Project failed due to CSV file being used/opened by other user or programme</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613691#M179259</link>
      <description>testing...&lt;BR /&gt;hope it works &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Tue, 24 Dec 2019 06:39:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613691#M179259</guid>
      <dc:creator>Suzy_Cat</dc:creator>
      <dc:date>2019-12-24T06:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: Project failed due to CSV file being used/opened by other user or programme</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613703#M179266</link>
      <description>&lt;P&gt;In UNIX, you can remove a file even when it's opened by a user. This is possible because the main metadata of the file (owner, group, date modified, data blocks) is kept in a so-called "inode" in a separate table (not in the directory entry as Windows does it). Removing a file in UNIX removes the directory entry (called "link"), but the file itself is only deleted once no further links exist and the last open handle on the inode is closed.&lt;/P&gt;
&lt;P&gt;Since the system might want confirmation of the remove, you should use the -f option (for "force") in the rm command.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 08:00:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613703#M179266</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-12-24T08:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: Project failed due to CSV file being used/opened by other user or programme</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613711#M179271</link>
      <description>&lt;P&gt;I do have a utility macro for this that basically looks like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro del_file(ext_file);
%if %sysfunc(fileexist(&amp;amp;ext_file.))
%then %do;
filename delfile pipe "rm -f &amp;amp;ext_file. 2&amp;gt;&amp;amp;1";
data _null_;
infile delfile;
input;
put _infile_;
run;
%end;
%mend;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The macro will do the remove only when the file exists, and record all responses from the remove command in the SAS log.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 09:45:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/613711#M179271</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-12-24T09:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: Project failed due to CSV file being used/opened by other user or programme</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/614049#M179435</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/293494"&gt;@Suzy_Cat&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looks like it worked&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below an alternative way to issue the mv command.&lt;/P&gt;
&lt;P&gt;This coding approach has the advantage that you'll get all the return messages from the command back into the SAS log (untested again because my current environment has NOXCMD set).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  cmd='mv -f ~/test_new.txt ~/test_orig.txt';
  infile mv pipe filevar=cmd end=eof;
  while (not eof);
    input ;
    put _infile_;
  end;
  stop;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2019 11:18:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/614049#M179435</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-12-27T11:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: Project failed due to CSV file being used/opened by other user or programme</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/614076#M179451</link>
      <description>&lt;P&gt;Note that there is no need to wrap a data step around an X command.&amp;nbsp; The X statement is GLOBAL,like a TITLE statement, so it can be placed anywhere.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2019 13:44:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Project-failed-due-to-CSV-file-being-used-opened-by-other-user/m-p/614076#M179451</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-12-27T13:44:40Z</dc:date>
    </item>
  </channel>
</rss>

