<?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: open/write of 2 files with same logical name oddity in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/open-write-of-2-files-with-same-logical-name-oddity/m-p/5554821#M28191</link>
    <description>&lt;P&gt;CLOSE/NOLOG is a good idea prior to any OPEN, but /NOLOG is a relatively recent addition to the syntax. I don't think it works pre V8. The backwards compatible method is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000000" face="courier new,courier"&gt;$ IF F$TRNLNM("logical-name").NES."" THEN CLOSE logical-name&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This assumes that any non-null value in the logical name represents an opened file. There's no simple way from DCL to check for sure. DCL hides the open file signature&amp;nbsp;word in the logical name translation which&amp;nbsp;is visible from an image. Look for %X001B as the first word in the (unfiltered) translation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There's a freeware image called "PPF" floating around which can determine the file specification from a logical name, and thereby validate an open file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Feb 2012 21:35:59 GMT</pubDate>
    <dc:creator>John Gillings</dc:creator>
    <dc:date>2012-02-16T21:35:59Z</dc:date>
    <item>
      <title>open/write of 2 files with same logical name oddity</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/open-write-of-2-files-with-same-logical-name-oddity/m-p/5553767#M28187</link>
      <description>&lt;P&gt;Consider the following in VMS 8.4:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$OPEN/WRITE TEST A.A&lt;/P&gt;&lt;P&gt;$WRITE TEST "TEXT"&lt;/P&gt;&lt;P&gt;$OPEN/WRITE TEST B.B&lt;/P&gt;&lt;P&gt;$WRITE TEST "NEW TEXT"&lt;/P&gt;&lt;P&gt;$CLOSE TEST&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result is 1 file - A.A with 2 lines:&lt;/P&gt;&lt;P&gt;TEXT&lt;/P&gt;&lt;P&gt;NEW TEXT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Shouldn't the second open/write return an error/warning?&lt;/P&gt;&lt;P&gt;Appreciate your input on this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2012 08:33:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/open-write-of-2-files-with-same-logical-name-oddity/m-p/5553767#M28187</guid>
      <dc:creator>tasevms</dc:creator>
      <dc:date>2012-02-16T08:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: open/write of 2 files with same logical name oddity</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/open-write-of-2-files-with-same-logical-name-oddity/m-p/5553809#M28188</link>
      <description>&lt;P&gt;This has been the behaviour for a very long time!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See the snippet below from the DCL dictionary manual:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://h71000.www7.hp.com/doc/84final/9996/9996pro_151.html#brass_5000" target="_blank"&gt;http://h71000.www7.hp.com/doc/84final/9996/9996pro_151.html#brass_5000&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do not use the same logical name when you open different files. If you specify a logical name with the OPEN command and the logical name is currently assigned to another file, no warning message is issued; however, the file is not opened, and the next READ request will access the file to which the logical name was originally assigned.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Duncan&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2012 08:52:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/open-write-of-2-files-with-same-logical-name-oddity/m-p/5553809#M28188</guid>
      <dc:creator>Duncan Morris</dc:creator>
      <dc:date>2012-02-16T08:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: open/write of 2 files with same logical name oddity</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/open-write-of-2-files-with-same-logical-name-oddity/m-p/5553841#M28189</link>
      <description>&lt;P&gt;That's the way it is and it is documented - although WRITE isn't explicitly mentioned - in the HP OpenVMS DCL Dictionary&amp;nbsp; (&lt;A href="http://h71000.www7.hp.com/doc/84final/9996/9996pro_151.html#index_x_820):" target="_blank"&gt;http://h71000.www7.hp.com/doc/84final/9996/9996pro_151.html#index_x_820):&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;Do not use the same logical name when you open different files. If you specify a logical name with the OPEN command and the logical name is currently assigned to another file, no warning message is issued; however, the file is not opened, and the next READ request will access the file to which the logical name was originally assigned.&lt;/EM&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 16 Feb 2012 09:03:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/open-write-of-2-files-with-same-logical-name-oddity/m-p/5553841#M28189</guid>
      <dc:creator>H.Becker</dc:creator>
      <dc:date>2012-02-16T09:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: open/write of 2 files with same logical name oddity</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/open-write-of-2-files-with-same-logical-name-oddity/m-p/5554265#M28190</link>
      <description>&lt;P&gt;Or..get into the habit of doing a (usually redundant) $ CLOSE/NOLOG logical-name&lt;/P&gt;&lt;P&gt;before doing an OPEN with that logical-name. In addition to knowing if you are in the situation described above pretty quickly during testing, it has the benefit of "closing out" any file that may be in the process of being written to from a previous run if the user did a control-y out of the program (and you don't have a DCL "interrupt handler")...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Dave&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2012 14:17:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/open-write-of-2-files-with-same-logical-name-oddity/m-p/5554265#M28190</guid>
      <dc:creator>David R. Lennon</dc:creator>
      <dc:date>2012-02-16T14:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: open/write of 2 files with same logical name oddity</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/open-write-of-2-files-with-same-logical-name-oddity/m-p/5554821#M28191</link>
      <description>&lt;P&gt;CLOSE/NOLOG is a good idea prior to any OPEN, but /NOLOG is a relatively recent addition to the syntax. I don't think it works pre V8. The backwards compatible method is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000000" face="courier new,courier"&gt;$ IF F$TRNLNM("logical-name").NES."" THEN CLOSE logical-name&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This assumes that any non-null value in the logical name represents an opened file. There's no simple way from DCL to check for sure. DCL hides the open file signature&amp;nbsp;word in the logical name translation which&amp;nbsp;is visible from an image. Look for %X001B as the first word in the (unfiltered) translation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There's a freeware image called "PPF" floating around which can determine the file specification from a logical name, and thereby validate an open file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2012 21:35:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/open-write-of-2-files-with-same-logical-name-oddity/m-p/5554821#M28191</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2012-02-16T21:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: open/write of 2 files with same logical name oddity</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/open-write-of-2-files-with-same-logical-name-oddity/m-p/5554877#M28192</link>
      <description>&lt;P&gt;Eh? &amp;nbsp;CLOSE /NOLOG has been around for over twenty years. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It showed up in early V6 if not before, IIRC, and I can find references to it in DCL from 1988 and 1989.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if you're targeting DCL on OpenVMS VAX V5-ish, you might want to check on the command availability.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's been standard DCL defensive programming for quite a while, too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2012 22:38:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/open-write-of-2-files-with-same-logical-name-oddity/m-p/5554877#M28192</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2012-02-16T22:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: open/write of 2 files with same logical name oddity</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/open-write-of-2-files-with-same-logical-name-oddity/m-p/5554981#M28193</link>
      <description>&lt;P&gt;Hoff,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Sorry, my mistake,&amp;nbsp;I was confusing it with&amp;nbsp;DEASSIGN/NOLOG, which is quite recent.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2012 01:00:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/open-write-of-2-files-with-same-logical-name-oddity/m-p/5554981#M28193</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2012-02-17T01:00:15Z</dc:date>
    </item>
  </channel>
</rss>

