<?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: File locked in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/file-locked/m-p/5062892#M85931</link>
    <description>Thank you all for your help. &lt;BR /&gt;&lt;BR /&gt;The file was locked because it was being used by multiple users. Thanks for your feedback Hoff.&lt;BR /&gt;&lt;BR /&gt;I corrected that by using F$search lexical to search and create a specific com file for every execution and deleting the specific version of the file in the end to resolve any ambiguities. &lt;BR /&gt;&lt;BR /&gt;This took care of things in a nice and neat manner. &lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 16 Aug 2007 10:32:11 GMT</pubDate>
    <dc:creator>nipun_2</dc:creator>
    <dc:date>2007-08-16T10:32:11Z</dc:date>
    <item>
      <title>File locked</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/file-locked/m-p/5062887#M85926</link>
      <description>Hello all,&lt;BR /&gt;I am running OpenVMS 7.3-2 and I recently wrote a script. &lt;BR /&gt;&lt;BR /&gt;Users have submitted this as a queue using the submit command which is normally done with other scripts often used in our lab. &lt;BR /&gt;&lt;BR /&gt;However, the first couple of entries ran fine. However, later on an error was reported stating&lt;BR /&gt;&lt;BR /&gt;"File (the script file) locked by another user"??&lt;BR /&gt;&lt;BR /&gt;%DCL-E-OPENIN, error opening DISK1:[XXXXX.XXXX]TEMP_XXX.COM; as input&lt;BR /&gt;-RMS-E-FLK, file currently locked by another user&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Why does this kind of error occur and how can we correct for this problem ?&lt;BR /&gt;Could this be because the file has been left open ? by a user or are their file security issues. &lt;BR /&gt;&lt;BR /&gt;Some details would be very helpful if this is indeed a simple answer. &lt;BR /&gt;&lt;BR /&gt;In case more information is required can you please let me know what that would be and what commands should I use to get the same. &lt;BR /&gt;&lt;BR /&gt;thanks in advance.</description>
      <pubDate>Mon, 13 Aug 2007 16:09:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/file-locked/m-p/5062887#M85926</guid>
      <dc:creator>nipun_2</dc:creator>
      <dc:date>2007-08-13T16:09:32Z</dc:date>
    </item>
    <item>
      <title>Re: File locked</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/file-locked/m-p/5062888#M85927</link>
      <description>Step 1, find out what is locking the file.&lt;BR /&gt;Try $ show dev/files disk1 and look for the file name.&lt;BR /&gt;&lt;BR /&gt;Better &lt;BR /&gt;$ pipe show dev/files disk1 | sea sys$input temp_xxx.com&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 13 Aug 2007 16:48:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/file-locked/m-p/5062888#M85927</guid>
      <dc:creator>Thomas Ritter</dc:creator>
      <dc:date>2007-08-13T16:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: File locked</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/file-locked/m-p/5062889#M85928</link>
      <description>First, it would be most helpful if you showed&lt;BR /&gt;actual commands and actual output instead of&lt;BR /&gt;vague descriptions and edited output.&lt;BR /&gt;Unless, of course, you really have a&lt;BR /&gt;directory named "[XXXXX.XXXX]", and a&lt;BR /&gt;procedure named "TEMP_XXX.COM".&lt;BR /&gt;&lt;BR /&gt;&amp;gt; "File (the script file) locked by another&lt;BR /&gt;&amp;gt; user"??&lt;BR /&gt;&lt;BR /&gt;You mean that _your_ procedure is named&lt;BR /&gt;"TEMP_XXX.COM"?  From that name, I'd have&lt;BR /&gt;guessed that your procedure (whatever it's&lt;BR /&gt;called) creates a _temporary_ file named&lt;BR /&gt;"TEMP_XXX.COM", and when you run it twice at&lt;BR /&gt;the same time, both jobs use the same&lt;BR /&gt;temporary file name, and _that's_ what's&lt;BR /&gt;causing the file access conflict.  If that&lt;BR /&gt;were the case, I'd suggest incorporating the&lt;BR /&gt;process ID (f$getjpi( "", "PID")) in the&lt;BR /&gt;temporary file name to avoid that sort of&lt;BR /&gt;collision.&lt;BR /&gt;&lt;BR /&gt;However, we can't see your procedure, and we&lt;BR /&gt;can't see what it really did, so it's not&lt;BR /&gt;easy to say (with any confidence) what went&lt;BR /&gt;wrong.</description>
      <pubDate>Mon, 13 Aug 2007 17:24:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/file-locked/m-p/5062889#M85928</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2007-08-13T17:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: File locked</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/file-locked/m-p/5062890#M85929</link>
      <description>Two users -- or the same user twice -- has the file held open.&lt;BR /&gt;&lt;BR /&gt;If you're working with a scratch area, you either need to use unique filenames, or you need to use unique scratch areas.&lt;BR /&gt;&lt;BR /&gt;I tend to redefine SYS$SCRATCH, and toss the temporary files over there.&lt;BR /&gt;&lt;BR /&gt;Here's some troubleshooting info:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://64.223.189.234/node/217" target="_blank"&gt;http://64.223.189.234/node/217&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;There's a case where you can get into trouble with an exit path -- where the file isn't closed -- and this can manifest itself in several ways.  To avoid this at run-time...&lt;BR /&gt;&lt;BR /&gt;If you're using a DCL command such as the following:&lt;BR /&gt;&lt;BR /&gt;OPEN/WRITE foo filename&lt;BR /&gt;&lt;BR /&gt;Issue the following command just before the OPEN:&lt;BR /&gt;&lt;BR /&gt;CLOSE/NOLOG foo&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://64.223.189.234/node/383" target="_blank"&gt;http://64.223.189.234/node/383&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;And within the application procedure itself, ensure the procedure closes the file on the way out.&lt;BR /&gt;&lt;BR /&gt;If you're intending to share the file, use the /SHARE qualifier on the open.&lt;BR /&gt;&lt;BR /&gt;There's a write-up on sharing file access from within C -- the C extensions related to file locking and file sharing -- available within the OpenVMS FAQ.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.hoffmanlabs.com/vmsfaq/" target="_blank"&gt;http://www.hoffmanlabs.com/vmsfaq/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The details are easier to find within the text or PDF versions.  HTML is hard to search.&lt;BR /&gt;&lt;BR /&gt;And the DCL command SHOW DEVICE ddcu:/FILE will show you which process has the file opened on the particular device, as was mentioned previously in this thread.&lt;BR /&gt;&lt;BR /&gt;Stephen Hoffman&lt;BR /&gt;HoffmanLabs LLC</description>
      <pubDate>Mon, 13 Aug 2007 17:44:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/file-locked/m-p/5062890#M85929</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2007-08-13T17:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: File locked</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/file-locked/m-p/5062891#M85930</link>
      <description>$ SHO DEV/FILES &lt;DEVICE_OF_FILE&gt; could tell you more. also, think about installed images that could have a channel opened. Thinking that way, SDA might give you a clue as well.&lt;/DEVICE_OF_FILE&gt;</description>
      <pubDate>Wed, 15 Aug 2007 10:02:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/file-locked/m-p/5062891#M85930</guid>
      <dc:creator>Willem Grooters</dc:creator>
      <dc:date>2007-08-15T10:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: File locked</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/file-locked/m-p/5062892#M85931</link>
      <description>Thank you all for your help. &lt;BR /&gt;&lt;BR /&gt;The file was locked because it was being used by multiple users. Thanks for your feedback Hoff.&lt;BR /&gt;&lt;BR /&gt;I corrected that by using F$search lexical to search and create a specific com file for every execution and deleting the specific version of the file in the end to resolve any ambiguities. &lt;BR /&gt;&lt;BR /&gt;This took care of things in a nice and neat manner. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 16 Aug 2007 10:32:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/file-locked/m-p/5062892#M85931</guid>
      <dc:creator>nipun_2</dc:creator>
      <dc:date>2007-08-16T10:32:11Z</dc:date>
    </item>
  </channel>
</rss>

