<?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: how to print to screen when com-procedure is run with /output ? in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/how-to-print-to-screen-when-com-procedure-is-run-with-output/m-p/5262950#M41105</link>
    <description>Why not just open the logfile directly from the program and write the message every 20 files to the standard output?  Either way a second "file" needs to be opened.  Why redirect the standard output and then open another channel to the screen.  Why not just open/write to the logfile directly?&lt;BR /&gt;&lt;BR /&gt;Dan</description>
    <pubDate>Tue, 16 Nov 2010 13:42:55 GMT</pubDate>
    <dc:creator>abrsvc</dc:creator>
    <dc:date>2010-11-16T13:42:55Z</dc:date>
    <item>
      <title>how to print to screen when com-procedure is run with /output ?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-print-to-screen-when-com-procedure-is-run-with-output/m-p/5262946#M41101</link>
      <description>I have command-procedure calling a c-program.&lt;BR /&gt;&lt;BR /&gt;the c-program has a loop for 1000 where it does some work. i run command-procedure like&lt;BR /&gt;@work/output=work.log&lt;BR /&gt;&lt;BR /&gt;all the detailed output of the work.com goes to work.log which is correct. but for every 20 entries processed, i want a message like "processed 20 elements" to be displayed on the screen. how to do this ?&lt;BR /&gt;&lt;BR /&gt;expected output,&lt;BR /&gt;$@work/output=work.log&lt;BR /&gt;processed 20 files&lt;BR /&gt;processed 40 files&lt;BR /&gt;processed 60 files&lt;BR /&gt;processed 80 files&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;what changes to do in the c-prgram ?&lt;BR /&gt;after every 20 entries, should the c-program call some com procedure for the printing work ?&lt;BR /&gt;&lt;BR /&gt;Scotty</description>
      <pubDate>Tue, 16 Nov 2010 12:57:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-print-to-screen-when-com-procedure-is-run-with-output/m-p/5262946#M41101</guid>
      <dc:creator>Scotty HD</dc:creator>
      <dc:date>2010-11-16T12:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to print to screen when com-procedure is run with /output ?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-print-to-screen-when-com-procedure-is-run-with-output/m-p/5262947#M41102</link>
      <description>Scotty,&lt;BR /&gt;&lt;BR /&gt;one way: open an extra output channel to the TT device (logical name: tt) and write to that&lt;BR /&gt;another way: write to SYS$ERROR&lt;BR /&gt;or: (as you suggested) spawn a DCL procedure, with the number as parameter, and have the DCL write that number + your fixed text.&lt;BR /&gt;If it needs "a lot" (whatever you define that to be) of invcations, DO realise that each SPAWN creates another supprocess, which  is quite expensive in VMS (unlike Unices).&lt;BR /&gt;&lt;BR /&gt;I am sure there are a gazillion other ways... &lt;BR /&gt;&lt;BR /&gt;PS. you may well want to also find a way to turn your progress reporting OFF and ON again.&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;jpe</description>
      <pubDate>Tue, 16 Nov 2010 13:12:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-print-to-screen-when-com-procedure-is-run-with-output/m-p/5262947#M41102</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2010-11-16T13:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to print to screen when com-procedure is run with /output ?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-print-to-screen-when-com-procedure-is-run-with-output/m-p/5262948#M41103</link>
      <description>thanks for help.&lt;BR /&gt;&lt;BR /&gt;#open an extra output channel to the TT device (logical name: tt) and write to that&lt;BR /&gt;do you mean i do a assign to tt: and get a channel number ?&lt;BR /&gt;i use printf but that put data to sys$output always i think. what other print call should i use so that i can tell it where to print?&lt;BR /&gt;&lt;BR /&gt;#write to SYS$ERROR&lt;BR /&gt;When i try this using a single com-procedure it works. but it does not work in case of,&lt;BR /&gt;com1-&amp;gt;c_prg-&amp;gt;com2.&lt;BR /&gt;in com2, i find sys$error is same as sys$output. all output goes to work.log.&lt;BR /&gt;&lt;BR /&gt;any comment.?&lt;BR /&gt;&lt;BR /&gt;Scotty</description>
      <pubDate>Tue, 16 Nov 2010 13:25:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-print-to-screen-when-com-procedure-is-run-with-output/m-p/5262948#M41103</guid>
      <dc:creator>Scotty HD</dc:creator>
      <dc:date>2010-11-16T13:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: how to print to screen when com-procedure is run with /output ?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-print-to-screen-when-com-procedure-is-run-with-output/m-p/5262949#M41104</link>
      <description>i did some test,&lt;BR /&gt;&lt;BR /&gt;Com1-&amp;gt;c_prg-&amp;gt;com2&lt;BR /&gt;i got this working. i use sys$command, it is set to terminal in com2.&lt;BR /&gt;&lt;BR /&gt;from your reply, i want&lt;BR /&gt;Com-&amp;gt;c_prg&lt;BR /&gt;with c_prg printing progress. this way i can avoid the costly subprocess creation.&lt;BR /&gt;&lt;BR /&gt;from c program, how to print to sys$command ?&lt;BR /&gt;lib$put_output and printf always use sys$output, correct?&lt;BR /&gt;&lt;BR /&gt;Scotty</description>
      <pubDate>Tue, 16 Nov 2010 13:40:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-print-to-screen-when-com-procedure-is-run-with-output/m-p/5262949#M41104</guid>
      <dc:creator>Scotty HD</dc:creator>
      <dc:date>2010-11-16T13:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: how to print to screen when com-procedure is run with /output ?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-print-to-screen-when-com-procedure-is-run-with-output/m-p/5262950#M41105</link>
      <description>Why not just open the logfile directly from the program and write the message every 20 files to the standard output?  Either way a second "file" needs to be opened.  Why redirect the standard output and then open another channel to the screen.  Why not just open/write to the logfile directly?&lt;BR /&gt;&lt;BR /&gt;Dan</description>
      <pubDate>Tue, 16 Nov 2010 13:42:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-print-to-screen-when-com-procedure-is-run-with-output/m-p/5262950#M41105</guid>
      <dc:creator>abrsvc</dc:creator>
      <dc:date>2010-11-16T13:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to print to screen when com-procedure is run with /output ?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-print-to-screen-when-com-procedure-is-run-with-output/m-p/5262951#M41106</link>
      <description>Yes, printf always uses sys$output. Try&lt;BR /&gt;&lt;BR /&gt;  fprintf (stderr, "hello world\n");&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Nov 2010 16:31:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-print-to-screen-when-com-procedure-is-run-with-output/m-p/5262951#M41106</guid>
      <dc:creator>RBrown_1</dc:creator>
      <dc:date>2010-11-16T16:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to print to screen when com-procedure is run with /output ?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-print-to-screen-when-com-procedure-is-run-with-output/m-p/5262952#M41107</link>
      <description>or&lt;BR /&gt;use TEE output to 2 streams, sys$output and sys$command (TT:) ?&lt;BR /&gt;&lt;BR /&gt;$ help pipe examples&lt;BR /&gt;...&lt;BR /&gt;       5.$ ! TEE.COM - command procedure to display/log data flowing through&lt;BR /&gt;          $ !           a pipeline&lt;BR /&gt;          $ ! Usage: @TEE log-file&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;You could use it like this:&lt;BR /&gt;&lt;BR /&gt;$ pipe @abc | @tee abc.log</description>
      <pubDate>Tue, 16 Nov 2010 18:57:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-print-to-screen-when-com-procedure-is-run-with-output/m-p/5262952#M41107</guid>
      <dc:creator>Joseph Huber_1</dc:creator>
      <dc:date>2010-11-16T18:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: how to print to screen when com-procedure is run with /output ?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-print-to-screen-when-com-procedure-is-run-with-output/m-p/5262953#M41108</link>
      <description>Scotty,&lt;BR /&gt;  If you want the same output to screen and log file use:&lt;BR /&gt;&lt;BR /&gt;$ SUBMIT/LOG=work.log work&lt;BR /&gt;&lt;BR /&gt;then: &lt;BR /&gt;&lt;BR /&gt;$ TYPE/TAIL/CONTINUOUS WORK.LOG&lt;BR /&gt;&lt;BR /&gt;If you want different output, then you'll need two channels. Use SYS$OUTPUT for your log and SYS$ERROR for progress:&lt;BR /&gt;&lt;BR /&gt;$ c=0&lt;BR /&gt;$ loop: c=c+1&lt;BR /&gt;$   WRITE SYS$OUTPUT "C=''c'"&lt;BR /&gt;$   IF c/20*20.EQS.c THEN WRITE SYS$ERROR "Processed ''c'"&lt;BR /&gt;$   WAIT 00:00:00.1&lt;BR /&gt;$ GOTO loop&lt;BR /&gt;&lt;BR /&gt; A benefit of using SYS$ERROR is, in BATCH mode both SYS$OUTPUT and SYS$ERROR will go to the log file. SYS$COMMAND will work in interactive mode, but techhnically it's supposed to be an input channel, so in BATCH mode it will attempt to write back to the executing procedure, which will fail.&lt;BR /&gt;&lt;BR /&gt;Example of batch log file sending output to SYS$ERROR:&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;C=15&lt;BR /&gt;C=16&lt;BR /&gt;C=17&lt;BR /&gt;C=18&lt;BR /&gt;C=19&lt;BR /&gt;C=20&lt;BR /&gt;Processed 20&lt;BR /&gt;C=21&lt;BR /&gt;C=22&lt;BR /&gt;C=23&lt;BR /&gt;C=24&lt;BR /&gt;&lt;BR /&gt;and using SYS$COMMAND:&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;C=16&lt;BR /&gt;C=17&lt;BR /&gt;C=18&lt;BR /&gt;C=19&lt;BR /&gt;C=20&lt;BR /&gt;%RMS-F-FAC, record operation not permitted by specified file access (FAC)&lt;BR /&gt;  GILLINGS_J   job terminated at 17-NOV-2010 08:01:04.89&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Nov 2010 21:06:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-print-to-screen-when-com-procedure-is-run-with-output/m-p/5262953#M41108</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2010-11-16T21:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: how to print to screen when com-procedure is run with /output ?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-print-to-screen-when-com-procedure-is-run-with-output/m-p/5262954#M41109</link>
      <description>thanks to all.&lt;BR /&gt;&lt;BR /&gt;Scotty</description>
      <pubDate>Fri, 18 Feb 2011 15:40:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-print-to-screen-when-com-procedure-is-run-with-output/m-p/5262954#M41109</guid>
      <dc:creator>Scotty HD</dc:creator>
      <dc:date>2011-02-18T15:40:45Z</dc:date>
    </item>
  </channel>
</rss>

