<?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: A function to tackle &amp;quot;FILE LOCKING&amp;quot; in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/288368#M59452</link>
    <description>&lt;P&gt;Reeza,&lt;/P&gt;&lt;P&gt;Not really. I look at the log only after the program has finished running. But I have the program itself opened in NOTEPAD++. But this file locking started to happen very recently. I know that Notepad++ dont keep a lock on the file, but still?. The worst part is that It happens randomly(days) to the same program.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Sun, 31 Jul 2016 02:11:24 GMT</pubDate>
    <dc:creator>SASER</dc:creator>
    <dc:date>2016-07-31T02:11:24Z</dc:date>
    <item>
      <title>A function to tackle "FILE LOCKING"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/288020#M59343</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could someone please suggest me a method/function that helps SAS not to stop/terminate when a non sas file like a LOG file is in use. The LOG file is not used/opened by me, I guess Windows or some third party app is doing it. Any suggestion would be of great use.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2016 02:11:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/288020#M59343</guid>
      <dc:creator>SASER</dc:creator>
      <dc:date>2016-07-29T02:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: A function to tackle "FILE LOCKING"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/288024#M59344</link>
      <description>&lt;P&gt;Why would your SAS log file be locked? Virus scanner?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2016 02:36:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/288024#M59344</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-07-29T02:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: A function to tackle "FILE LOCKING"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/288030#M59346</link>
      <description>Thanks Reeza for the reply. Seriously I have no idea why it gets locked. I do not think its a virus scanner coz, this happens only to a "constant" couple of programs.</description>
      <pubDate>Fri, 29 Jul 2016 03:17:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/288030#M59346</guid>
      <dc:creator>SASER</dc:creator>
      <dc:date>2016-07-29T03:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: A function to tackle "FILE LOCKING"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/288031#M59347</link>
      <description>&lt;P&gt;How do you use the file? is it a log file you write to via proc printto? or is this log file an input file that you need reading?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2016 03:40:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/288031#M59347</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2016-07-29T03:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: A function to tackle "FILE LOCKING"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/288053#M59353</link>
      <description>&lt;P&gt;If a file is explicitly locked for any type of access (not just write/update), there's nothing you can do except identify the process that holds the lock, and then terminate it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which is a very rude way to go about it. (And you need to have the rights/permissions to do this. I have found that the execrable Windows does not really have a "superuser" type UserID like UNIX. Even "the" Administrator is often unable to to stop a process, short of restarting the system.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, after having identified the offending process with operating system tools, check why the file is locked. If there is an update underway at the moment SAS tries to read the file, the lock is quite natural. In this case you have to set up time windows during which the file will not be updated so SAS can safely read it.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2016 07:32:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/288053#M59353</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-07-29T07:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: A function to tackle "FILE LOCKING"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/288066#M59356</link>
      <description>&lt;P&gt;Just going to ad to the great advice above, encountering file locks should be almost never. &amp;nbsp;If you are finding files locked then you have a structural or process fault. &amp;nbsp;For instance, if you have users who use the data, then don't have them doing that in the production branch, otherwise when you try to run production you will encounter this. &amp;nbsp;A way of seperating users working areas out from production (which should be run at fixed - known times) shuld remove file lock issues.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2016 08:43:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/288066#M59356</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-07-29T08:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: A function to tackle "FILE LOCKING"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/288363#M59447</link>
      <description>&lt;P&gt;Its a log file that I get from running SAS in BATCH. I do not use/read it other than in notepad++ to check where/how the program is.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jul 2016 01:45:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/288363#M59447</guid>
      <dc:creator>SASER</dc:creator>
      <dc:date>2016-07-31T01:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: A function to tackle "FILE LOCKING"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/288364#M59448</link>
      <description>&lt;P&gt;Kurt,&lt;BR /&gt;Could you please tell me what you meant by "&lt;SPAN&gt;In this case you have to set up time windows during which the file will not be updated so SAS can safely read it."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jul 2016 01:48:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/288364#M59448</guid>
      <dc:creator>SASER</dc:creator>
      <dc:date>2016-07-31T01:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: A function to tackle "FILE LOCKING"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/288365#M59449</link>
      <description>&lt;P&gt;I agree with what you have said,RW9. But in my case I have no idea why the log file gets locked. If I know that some app/OS is holding the lock, then I can manually terminate it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jul 2016 01:51:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/288365#M59449</guid>
      <dc:creator>SASER</dc:creator>
      <dc:date>2016-07-31T01:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: A function to tackle "FILE LOCKING"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/288366#M59450</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@niranvijay wrote:&lt;BR /&gt;
&lt;P&gt;Its a log file that I get from running SAS in BATCH. I do not use/read it other than in notepad++ to check where/how the program is.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So you open the log file in Notepad++ and then SAS throws an error because it's locked? What happens if you don't open file while process is running? Do you still get a File Lock?&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jul 2016 01:53:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/288366#M59450</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-07-31T01:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: A function to tackle "FILE LOCKING"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/288368#M59452</link>
      <description>&lt;P&gt;Reeza,&lt;/P&gt;&lt;P&gt;Not really. I look at the log only after the program has finished running. But I have the program itself opened in NOTEPAD++. But this file locking started to happen very recently. I know that Notepad++ dont keep a lock on the file, but still?. The worst part is that It happens randomly(days) to the same program.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jul 2016 02:11:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/288368#M59452</guid>
      <dc:creator>SASER</dc:creator>
      <dc:date>2016-07-31T02:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: A function to tackle "FILE LOCKING"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/288371#M59453</link>
      <description>Sadly this is a system issue. If you ask sas to use a file and the file is locked, sas will complain. You must fix this at the system level. Utilities like process explorer can tell you what processes use what file handles.</description>
      <pubDate>Sun, 31 Jul 2016 02:51:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/288371#M59453</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2016-07-31T02:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: A function to tackle "FILE LOCKING"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/288385#M59466</link>
      <description>&lt;P&gt;Speak to your IT team, they will help finding out what application is locking the file. &amp;nbsp;Text files generally don't get locked, so that is unusual. &amp;nbsp;That being said, my company has applications running the background which mirror files off to a backup, and that sometimes prevents me deleting files or folders, so it could be something like that. &amp;nbsp;Its a system thing though, not really a SAS problem.&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jul 2016 09:43:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/288385#M59466</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-07-31T09:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: A function to tackle "FILE LOCKING"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/289185#M59719</link>
      <description>&lt;P&gt;Thanks again RW9&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2016 12:26:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/289185#M59719</guid>
      <dc:creator>SASER</dc:creator>
      <dc:date>2016-08-03T12:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: A function to tackle "FILE LOCKING"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/289186#M59720</link>
      <description>&lt;P&gt;Thanks ChrisNZ for your suggestion.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2016 12:27:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/289186#M59720</guid>
      <dc:creator>SASER</dc:creator>
      <dc:date>2016-08-03T12:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: A function to tackle "FILE LOCKING"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/870695#M343913</link>
      <description>Hey Can you confirm that the Sas job is initiated from a .bat?&lt;BR /&gt;&lt;BR /&gt;If so does the .bat set the log location?&lt;BR /&gt;If so thats probably what has the log file open. I am wrestling with the same issue atm.&lt;BR /&gt;&lt;BR /&gt;My options (i am yet to investigate) in order of preference is. Disregard lock, find a read only access method, Duplicate then delete.&lt;BR /&gt;&lt;BR /&gt;Hope this helps</description>
      <pubDate>Thu, 20 Apr 2023 03:23:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/870695#M343913</guid>
      <dc:creator>ReNSFW</dc:creator>
      <dc:date>2023-04-20T03:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: A function to tackle "FILE LOCKING"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/870696#M343914</link>
      <description>&lt;P&gt;If you are using the sasbatch.bat file to execute SAS batch jobs, all this file is doing is calling sas.exe with some options, one of which might be the -LOG option to specify the name and location of the SAS log file. It's the SAS executable that is creating and locking the log file, not sasbatch.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 04:03:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/870696#M343914</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-04-20T04:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: A function to tackle "FILE LOCKING"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/870702#M343917</link>
      <description>&lt;P&gt;User said they were using SAS in batch.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 05:12:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/870702#M343917</guid>
      <dc:creator>ReNSFW</dc:creator>
      <dc:date>2023-04-20T05:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: A function to tackle "FILE LOCKING"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/870890#M344022</link>
      <description>&lt;P&gt;There are various ways of invoking SAS in batch mode. You can call the SAS command directly from a command line or via a scheduling tool, run the SAS-provided sasbatch BAT file, or run SAS via a user-written BAT or script file. You will need to provide more details of your problem before we can help.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 20:25:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-function-to-tackle-quot-FILE-LOCKING-quot/m-p/870890#M344022</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-04-20T20:25:04Z</dc:date>
    </item>
  </channel>
</rss>

