<?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: DCL logical operator in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/dcl-logical-operator/m-p/5244308#M40102</link>
    <description>&lt;BR /&gt;just to be clear, you really used f$file() right?&lt;BR /&gt;&lt;BR /&gt;The behaviour stands, but just to be clear.&lt;BR /&gt;&lt;BR /&gt;Hein&lt;BR /&gt;</description>
    <pubDate>Thu, 17 Jun 2010 18:06:20 GMT</pubDate>
    <dc:creator>Hein van den Heuvel</dc:creator>
    <dc:date>2010-06-17T18:06:20Z</dc:date>
    <item>
      <title>DCL logical operator</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-logical-operator/m-p/5244304#M40098</link>
      <description>&lt;!--!*#--&gt;i wrote following code &lt;BR /&gt;&lt;BR /&gt;if (f$search("ABC.DAT") .nes. "") .and. f$attribute("ABC.DAT","EOF") .ne. 0)&lt;BR /&gt;then &lt;BR /&gt;   ! do something&lt;BR /&gt;endif&lt;BR /&gt;&lt;BR /&gt;this code doent work when file in not present. f$attribute throws error. &lt;BR /&gt;Why is second expression evaluated when first is not true ?</description>
      <pubDate>Thu, 17 Jun 2010 17:16:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-logical-operator/m-p/5244304#M40098</guid>
      <dc:creator>sbisht</dc:creator>
      <dc:date>2010-06-17T17:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: DCL logical operator</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-logical-operator/m-p/5244305#M40099</link>
      <description>If memory serves me correctly:&lt;BR /&gt;&lt;BR /&gt;Because DCL is an interpretive "language", the entire line is parsed at the same time with symbol substitutions done "in-line".  In this case, both expressions are equated to "temporary" symbols and then evaluated for the equivalences and logic tests.&lt;BR /&gt;&lt;BR /&gt;In a case like this the statement should be in the following format:&lt;BR /&gt;&lt;BR /&gt;IF f$search("abc.dat") .eqs. "" then skip_it&lt;BR /&gt;&lt;BR /&gt;ELSE&lt;BR /&gt;   IF F$attribute...&lt;BR /&gt;   then&lt;BR /&gt;     !do something&lt;BR /&gt;   endif&lt;BR /&gt;ENDIF&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Dan&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Jun 2010 17:34:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-logical-operator/m-p/5244305#M40099</guid>
      <dc:creator>abrsvc</dc:creator>
      <dc:date>2010-06-17T17:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: DCL logical operator</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-logical-operator/m-p/5244306#M40100</link>
      <description>I'm going to guess that you're familiar with compilers, and less so with old-school interpreters.&lt;BR /&gt;&lt;BR /&gt;The DCL interpreter processes the whole command for symbol substitutions (in a couple of phases), and then figures out what to do with the results.&lt;BR /&gt;&lt;BR /&gt;DCL is an old-school and comparatively ancient command interpreter, and DCL procedures can thus have all sorts of interesting and even self-modifying behaviors.  Which is why DC interpreter tends to process the whole command.&lt;BR /&gt;&lt;BR /&gt;The definition of DCL syntax (for what that is) doesn't particularly lend itself to compilation, either.  &lt;BR /&gt;&lt;BR /&gt;There are other interesting behaviors you may encounter on your journey, such as specific cases where the contents of DCL comments can be executed.  Not ignored.  &lt;BR /&gt;&lt;BR /&gt;Regardless of how it works or how you might think it should work, DCL processing is also comparatively unlikely to change in any significant fashion, given its existing and massive installed-base problem.  The comment case was an old bug in DCL, and code became dependent on it, so DCL was changed (back) to allow the cases that were used.&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Jun 2010 17:44:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-logical-operator/m-p/5244306#M40100</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2010-06-17T17:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: DCL logical operator</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-logical-operator/m-p/5244307#M40101</link>
      <description>&lt;!--!*#--&gt;Thank you Dan, of course I did it other way but needed a better explanation.&lt;BR /&gt;&lt;BR /&gt;Thanks Hoff for further insight and interesting  fact.</description>
      <pubDate>Thu, 17 Jun 2010 18:02:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-logical-operator/m-p/5244307#M40101</guid>
      <dc:creator>sbisht</dc:creator>
      <dc:date>2010-06-17T18:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: DCL logical operator</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-logical-operator/m-p/5244308#M40102</link>
      <description>&lt;BR /&gt;just to be clear, you really used f$file() right?&lt;BR /&gt;&lt;BR /&gt;The behaviour stands, but just to be clear.&lt;BR /&gt;&lt;BR /&gt;Hein&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Jun 2010 18:06:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-logical-operator/m-p/5244308#M40102</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2010-06-17T18:06:20Z</dc:date>
    </item>
    <item>
      <title>Re: DCL logical operator</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-logical-operator/m-p/5244309#M40103</link>
      <description>For completeness and generality...&lt;BR /&gt;&lt;BR /&gt;Note that your expectation of shortcut logical evaluation depends on the rules of the language. Even for compiled languages, there are numerous different rules which may be applied.&lt;BR /&gt;&lt;BR /&gt;Some languages always shortcut, some never shortcut, some have different operators for complete or shortcit evaluation, and others (notably Fortran) are defined to allow the compiler to rearrange a logical expression as it sees fit.&lt;BR /&gt;&lt;BR /&gt;In situations such as yours, where the validity of one term in the expression is dependent on another, or where side effects of evaluating one term may affect another, you need to be careful that your assumptions match the rules of the language.</description>
      <pubDate>Thu, 17 Jun 2010 20:24:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-logical-operator/m-p/5244309#M40103</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2010-06-17T20:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: DCL logical operator</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-logical-operator/m-p/5244310#M40104</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;if (f$search("ABC.DAT") .nes. "") .and. f$attribute("ABC.DAT","EOF") .ne. 0)&lt;BR /&gt;Couple of things about this &lt;BR /&gt;* There is nothing like f$attribute. I guess you meant f$file_attributes&lt;BR /&gt;&lt;BR /&gt;* There is syntax error in the above line. the second expression is missing a&lt;BR /&gt;  bracket. It should rather be&lt;BR /&gt;  $if (f$search("ABC.DAT") .nes. "") .and. (f$file_attribute("ABC.DAT","EOF") .ne. 0)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;Why is second expression evaluated when first is not true ? &lt;BR /&gt;You would expect this to work in a C program for example.&lt;BR /&gt;But as others have already explained, DCL parsing stuff does not work like that.&lt;BR /&gt;&lt;BR /&gt;You have to modify your program based on how DCL works. Something like -&lt;BR /&gt;&lt;BR /&gt;$ if (f$search("ABC.DAT") .eqs. "") then GOTO skip_file&lt;BR /&gt;$ if f$file_attribute("ABC.DAT","EOF") .ne. 0&lt;BR /&gt;$ then&lt;BR /&gt;$ ! Handle file ...&lt;BR /&gt;$ endif&lt;BR /&gt;$&lt;BR /&gt;$ skip_file:&lt;BR /&gt;$ !skip file handling&lt;BR /&gt;$ ...&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Murali</description>
      <pubDate>Fri, 18 Jun 2010 02:42:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-logical-operator/m-p/5244310#M40104</guid>
      <dc:creator>P Muralidhar Kini</dc:creator>
      <dc:date>2010-06-18T02:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: DCL logical operator</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-logical-operator/m-p/5244311#M40105</link>
      <description>sbisht,&lt;BR /&gt;Looks like you are new to the forum.&lt;BR /&gt;&lt;BR /&gt;Check the following link which says how to thank the forum -&lt;BR /&gt;&lt;A href="http://forums11.itrc.hp.com/service/forums/helptips.do?#28" target="_blank"&gt;http://forums11.itrc.hp.com/service/forums/helptips.do?#28&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Murali</description>
      <pubDate>Sat, 19 Jun 2010 01:16:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-logical-operator/m-p/5244311#M40105</guid>
      <dc:creator>P Muralidhar Kini</dc:creator>
      <dc:date>2010-06-19T01:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: DCL logical operator</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-logical-operator/m-p/5244312#M40106</link>
      <description>I got explanation for the error..hence closing the thread.</description>
      <pubDate>Sun, 20 Jun 2010 17:27:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-logical-operator/m-p/5244312#M40106</guid>
      <dc:creator>sbisht</dc:creator>
      <dc:date>2010-06-20T17:27:29Z</dc:date>
    </item>
  </channel>
</rss>

