<?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: Process-permanent SYS$OUTPUT, WRITE SYS$OUTPUT and DEFINE /USER vs DEFINE /PROCESS in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/process-permanent-sys-output-write-sys-output-and-define-user-vs/m-p/7067672#M104798</link>
    <description>&lt;P&gt;&amp;gt; A colleague [...]&lt;/P&gt;
&lt;P&gt;&amp;gt; [...] had recently made some changes to a command procedure that is&lt;BR /&gt;&amp;gt; invoked from the DCL command line, and it invokes another command&lt;BR /&gt;&amp;gt; procedure. [...]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; An actual test case might be more helpful than any such (vague)&lt;BR /&gt;description.&lt;/P&gt;
&lt;P&gt;&amp;gt; [...] In the calling procedure, he changed it to do DEFINE /USER&lt;BR /&gt;&amp;gt; SYS$OUTPUT temporary_file before invoking the called procedure, [...]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Did anyone actually open that file?&amp;nbsp; The default SYS$OUTPUT may not&lt;BR /&gt;need it, but some plain-old file might.&amp;nbsp; For example:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;ITS $ define /user_mode sys$output fred.out&lt;BR /&gt;ITS $ write sys$output "ABC"&lt;BR /&gt;%DCL-W-UNDFIL, file has not been opened by DCL - check logical name&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; There's no need for nested DCL scripts to get that effect.&lt;/P&gt;
&lt;P&gt;&amp;gt; [...] but does write to it if it has been redefined with DEFINE&lt;BR /&gt;&amp;gt; /PROCESS [...]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; I know nothing, but I might guess that invoking ("@") the sub-script&lt;BR /&gt;causes DCL to do things with whatever SYS$OUTPUT is at that time.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; So, your actual complaint is that invoking the sub-script makes it&lt;BR /&gt;all work better (or more easily) than it would if everything were at the&lt;BR /&gt;same level?&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; I might stick some "show logical /full sys$output" statements in&lt;BR /&gt;various places if I were desperate for clues.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Oct 2019 14:26:37 GMT</pubDate>
    <dc:creator>Steven Schweda</dc:creator>
    <dc:date>2019-10-30T14:26:37Z</dc:date>
    <item>
      <title>Process-permanent SYS$OUTPUT, WRITE SYS$OUTPUT and DEFINE /USER vs DEFINE /PROCESS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/process-permanent-sys-output-write-sys-output-and-define-user-vs/m-p/7067594#M104797</link>
      <description>&lt;P&gt;A colleague had recently made some changes to a command procedure that is invoked from the DCL command line, and it invokes another command procedure.&lt;/P&gt;&lt;P&gt;In the calling procedure, he changed it to do DEFINE /USER SYS$OUTPUT&amp;nbsp;&lt;EM&gt;temporary_file&lt;/EM&gt; before invoking the called procedure, and when the calling procedure was invoked, WRITE SYS$OUTPUT calls in the called procedure failed with the warning message "%DCL-W-UNDFIL, file has not been opened by DCL - check logical name".&lt;/P&gt;&lt;P&gt;Changing the code to wrap the invocation of the called procedure inside a DEFINE (/PROCESS) and DEASSIGN (/PROCESS) of SYS$OUTPUT works.&lt;/P&gt;&lt;P&gt;I was intrigued enough to try and find an explanation as to why this is the case, but I've been unable to (looked in DCL Dictionary, Programming Concepts, IDSM, User Manual).&lt;/P&gt;&lt;P&gt;I get that SYS$OUTPUT is a process-permanent file, and has special handling and does not need to be OPENed in order to WRITE to it.&lt;/P&gt;&lt;P&gt;I can't fathom why WRITE fails to write to SYS$OUTPUT if it has been redefined with DEFINE /USER, but does write to it if it has been redefined with DEFINE /PROCESS (the DEFINE /PROCESS doesn't create the file, and WRITE does not of itself open a channel to a new file).&lt;BR /&gt;&lt;BR /&gt;My only thoughts are "magic jiggery-pokery" being undertaken by the CLI - can anyone provide a more detailed reason?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 09:09:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/process-permanent-sys-output-write-sys-output-and-define-user-vs/m-p/7067594#M104797</guid>
      <dc:creator>Mark_Corcoran</dc:creator>
      <dc:date>2019-10-25T09:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: Process-permanent SYS$OUTPUT, WRITE SYS$OUTPUT and DEFINE /USER vs DEFINE /PROCESS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/process-permanent-sys-output-write-sys-output-and-define-user-vs/m-p/7067672#M104798</link>
      <description>&lt;P&gt;&amp;gt; A colleague [...]&lt;/P&gt;
&lt;P&gt;&amp;gt; [...] had recently made some changes to a command procedure that is&lt;BR /&gt;&amp;gt; invoked from the DCL command line, and it invokes another command&lt;BR /&gt;&amp;gt; procedure. [...]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; An actual test case might be more helpful than any such (vague)&lt;BR /&gt;description.&lt;/P&gt;
&lt;P&gt;&amp;gt; [...] In the calling procedure, he changed it to do DEFINE /USER&lt;BR /&gt;&amp;gt; SYS$OUTPUT temporary_file before invoking the called procedure, [...]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Did anyone actually open that file?&amp;nbsp; The default SYS$OUTPUT may not&lt;BR /&gt;need it, but some plain-old file might.&amp;nbsp; For example:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;ITS $ define /user_mode sys$output fred.out&lt;BR /&gt;ITS $ write sys$output "ABC"&lt;BR /&gt;%DCL-W-UNDFIL, file has not been opened by DCL - check logical name&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; There's no need for nested DCL scripts to get that effect.&lt;/P&gt;
&lt;P&gt;&amp;gt; [...] but does write to it if it has been redefined with DEFINE&lt;BR /&gt;&amp;gt; /PROCESS [...]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; I know nothing, but I might guess that invoking ("@") the sub-script&lt;BR /&gt;causes DCL to do things with whatever SYS$OUTPUT is at that time.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; So, your actual complaint is that invoking the sub-script makes it&lt;BR /&gt;all work better (or more easily) than it would if everything were at the&lt;BR /&gt;same level?&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; I might stick some "show logical /full sys$output" statements in&lt;BR /&gt;various places if I were desperate for clues.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2019 14:26:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/process-permanent-sys-output-write-sys-output-and-define-user-vs/m-p/7067672#M104798</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2019-10-30T14:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: Process-permanent SYS$OUTPUT, WRITE SYS$OUTPUT and DEFINE /USER vs DEFINE /PROCESS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/process-permanent-sys-output-write-sys-output-and-define-user-vs/m-p/7067766#M104799</link>
      <description>&lt;P&gt;What you are missing is the reason/definition of the "/user" qualifier.&amp;nbsp; This qualifier means that the logical name assignment will last for one program execution.&amp;nbsp; Since many DCL commands are actually "programs" this means that the assignment will last for perhaps one or two commands at most..&amp;nbsp; This qualifier is used for truly temporary assignments.&lt;/P&gt;&lt;P&gt;For example, if you wanted to place the output of a program into file X.X, you could simply use the following:&lt;/P&gt;&lt;P&gt;$ ASSIGN/USER X.X SYS$OUTPUT&lt;/P&gt;&lt;P&gt;$ RUN PROGRAM_XYZ&lt;/P&gt;&lt;P&gt;With the above sequence there is no need for any DEASSIGN command as the logical assignment will be removed during the program rundown process.&lt;/P&gt;&lt;P&gt;In order to use the logical name assignment across a command procedure, you will need to ASSIGN and DEASSIGN the logical prior to entry and after exit respectively.&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2019 00:23:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/process-permanent-sys-output-write-sys-output-and-define-user-vs/m-p/7067766#M104799</guid>
      <dc:creator>abrsvc</dc:creator>
      <dc:date>2019-10-28T00:23:06Z</dc:date>
    </item>
  </channel>
</rss>

