<?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: sys$input question in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/sys-input-question/m-p/5092499#M25337</link>
    <description>Thanks Hein &amp;amp; Bob.  That answers it.</description>
    <pubDate>Wed, 13 Feb 2008 18:20:02 GMT</pubDate>
    <dc:creator>Layne Burleson_1</dc:creator>
    <dc:date>2008-02-13T18:20:02Z</dc:date>
    <item>
      <title>sys$input question</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sys-input-question/m-p/5092496#M25334</link>
      <description>When logging into VMS 7.3-2 alpha server, a show logical cmd will show the NTY device as the definition for sys$input.  If you create a .com procedure with a show logical sys$input as the top line, it will display dsa2: as the definition.  I put a $set verify in the top of the .com procedure but can't find anywhere that redefined sys$input.  Any ideas why it is different or where I can look?</description>
      <pubDate>Wed, 13 Feb 2008 16:15:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sys-input-question/m-p/5092496#M25334</guid>
      <dc:creator>Layne Burleson_1</dc:creator>
      <dc:date>2008-02-13T16:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: sys$input question</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sys-input-question/m-p/5092497#M25335</link>
      <description>The command file is reading from a file on disk right? So the (sys$)input device is a disk. Makes sense?&lt;BR /&gt;&lt;BR /&gt;Try this command file &lt;BR /&gt;$show log sys$input&lt;BR /&gt;$show log sys$command&lt;BR /&gt;$type sys$input&lt;BR /&gt;&lt;BR /&gt;this data line can from the command file&lt;BR /&gt;&lt;BR /&gt;now switch to input fromthe terminal&lt;BR /&gt;&lt;BR /&gt;please enter some text, end with control-Z"&lt;BR /&gt;&lt;BR /&gt;$define /user sys$input sys$command&lt;BR /&gt;$type sys$input&lt;BR /&gt;$&lt;BR /&gt;$write sys$output "demonstration with EDT (quit to exit)"&lt;BR /&gt;$EDITTTT/EDT/NOCOM sys$login:login.com&lt;BR /&gt;s/blah blah/blah blah/&lt;BR /&gt;$write sys$output "at DCL level, go back into edt for real...&lt;BR /&gt;$define /user sys$input sys$command&lt;BR /&gt;$EDITTTT/EDT/NOCOM sys$login:login.com&lt;BR /&gt;$exit&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Wed, 13 Feb 2008 16:38:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sys-input-question/m-p/5092497#M25335</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2008-02-13T16:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: sys$input question</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sys-input-question/m-p/5092498#M25336</link>
      <description>Burleson,&lt;BR /&gt;&lt;BR /&gt;As Hein has noted, the command file is a disk.&lt;BR /&gt;&lt;BR /&gt;SYS$INPUT is the "current" input device. I do not have the time for a full exposition, but my recollection is that there is a good description of the behavior of the various logical names (SYS$INPUT, SYS$COMMAND, and SYS$ERROR) in either the OpenVMS User's Manual or in the DCL Dictionary, both of which are online at &lt;A href="http://www.hp.com/go/openvms" target="_blank"&gt;http://www.hp.com/go/openvms&lt;/A&gt; (if my recollection is faulty, then it is is one of the other manuals).&lt;BR /&gt;&lt;BR /&gt;- Bob Gezelter, &lt;A href="http://www.rlgsc.com" target="_blank"&gt;http://www.rlgsc.com&lt;/A&gt;</description>
      <pubDate>Wed, 13 Feb 2008 17:03:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sys-input-question/m-p/5092498#M25336</guid>
      <dc:creator>Robert Gezelter</dc:creator>
      <dc:date>2008-02-13T17:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: sys$input question</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sys-input-question/m-p/5092499#M25337</link>
      <description>Thanks Hein &amp;amp; Bob.  That answers it.</description>
      <pubDate>Wed, 13 Feb 2008 18:20:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sys-input-question/m-p/5092499#M25337</guid>
      <dc:creator>Layne Burleson_1</dc:creator>
      <dc:date>2008-02-13T18:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: sys$input question</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sys-input-question/m-p/5092500#M25338</link>
      <description>&lt;!--!*#--&gt;Burleson,&lt;BR /&gt;&lt;BR /&gt;This is one of the great features of VMS.  When you are entering commands from a terminal there are two different logicals you could use to get input, SYS$INPUT and SYS$COMMAND.  From a terminal they will both work the same.&lt;BR /&gt;&lt;BR /&gt;But when you execute commands from within a DCL .COM file SYS$INPUT is automatically redefined to be that .COM file (Unfortunately, as you discovered, SHOW LOGICAL SYS$INPUT only shows the device name but it has a hidden binary value that points to the current command file).  When the .COM file exits SYS$INPUT will point to the terminal again.&lt;BR /&gt;&lt;BR /&gt;SYS$COMMAND will always point to the terminal for an interactive process.&lt;BR /&gt;&lt;BR /&gt;This behaviour allows you to write a .COM file that runs programs which can get their input either from the command file, or from the user running the command file.  For example...&lt;BR /&gt;&lt;BR /&gt;Interactive commands:&lt;BR /&gt;$ RUN PROGRAMS:DINNER&lt;BR /&gt;Enter Ingrediant: DOUGH.FOOD&lt;BR /&gt;Enter Ingrediant: TOMATO_SAUCE.FOOD&lt;BR /&gt;Enter Ingrediant: CHEESE.FOOD&lt;BR /&gt;Enter Ingrediant: TOPPINGS.FOOD&lt;BR /&gt;Enter Ingrediant: &lt;CTRL z=""&gt;&lt;BR /&gt;***Your dinner will be ready in 20 minutes***&lt;BR /&gt;&lt;BR /&gt;But that's a lot of typing just to get a pizza.  My wife complained about how cooking was a lot of work, so I wrote her a command file:&lt;BR /&gt;&lt;BR /&gt;$!! PIZZA.COM&lt;BR /&gt;$ IF (F$MODE() .EQS. "INTERACTIVE")&lt;BR /&gt;$ THEN&lt;BR /&gt;$   WRITE SYS$OUTPUT "Enter your toppings."&lt;BR /&gt;$   DEFINE/USER SYS$INPUT SYS$COMMAND:&lt;BR /&gt;$   EDIT TOPPINGS.FOOD&lt;BR /&gt;$ ELSE&lt;BR /&gt;$   CREATE TOPPINGS.FOOD&lt;BR /&gt;MUSHROOMS&lt;BR /&gt;PEPPERONI&lt;BR /&gt;$ ENDIF&lt;BR /&gt;$!&lt;BR /&gt;$ RUN PROGRAMS:DINNER&lt;BR /&gt;DOUGH.FOOD&lt;BR /&gt;TOMATO_SAUCE.FOOD&lt;BR /&gt;CHEESE.FOOD&lt;BR /&gt;TOPPINGS.FOOD&lt;BR /&gt;$!&lt;BR /&gt;$ IF (F$MODE() .NES. "INTERACTIVE")&lt;BR /&gt;$ THEN&lt;BR /&gt;$  MAIL /SUBJECT="Dinner Time" SYS$INPUT ME&lt;BR /&gt;The pepperoni and mushroom pizza is ready.&lt;BR /&gt;$ ENDIF&lt;BR /&gt;$ EXIT&lt;BR /&gt;&lt;BR /&gt;She really likes that if she will be out for the day she can just do:&lt;BR /&gt;$ SUBMIT PIZZA /AFTER=18:00&lt;BR /&gt;&lt;BR /&gt;Note that DINNER and CREATE, like most programs, read input from SYS$INPUT.  When they are run interactively this will be the terminal and end-of-input is indicated by typing &lt;CTRL z=""&gt;.&lt;BR /&gt;&lt;BR /&gt;When programs are run from a command file SYS$INPUT are the lines in the command file that immediately follow the command line that runs the program.  End of input is indicated by the next line that begins with a $ from within a command file.&lt;BR /&gt;&lt;BR /&gt;So lines in a command file that begin with a $ are interpreted by DCL and lines that don't (other than continuation lines) should be program input.&lt;BR /&gt;&lt;BR /&gt;The EDIT command also reads its input from SYS$INPUT, but here even though you are running it from a command file you want EDIT to get its input from the terminal.  This is accomplished by temporarily redefining SYS$INPUT to point to SYS$COMMAND right before running EDIT.&lt;BR /&gt;&lt;BR /&gt;The last trick shown is the MAIL command line which expects a file name for its first parameter.  Here I use SYS$INPUT for the file name so that the mail text that is used can follow the MAIL command line in the .COM file.  This avoids having to create a file every time with the same text.&lt;/CTRL&gt;&lt;/CTRL&gt;</description>
      <pubDate>Wed, 13 Feb 2008 18:32:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sys-input-question/m-p/5092500#M25338</guid>
      <dc:creator>Jess Goodman</dc:creator>
      <dc:date>2008-02-13T18:32:27Z</dc:date>
    </item>
  </channel>
</rss>

