<?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: OpenVMS automatically in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/openvms-automatically/m-p/6024845#M28521</link>
    <description>&lt;P&gt;You can redirect the middle of your log to another file, close it, and then mail that file, like the following, which will send you an e-mail consisting entirely of "Do stuff here":&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$ type mail_batch_log.com
$ IF F$SEARCH("SYS$SCRATCH:my_batch_log.tmp") .NES. ""
$ THEN
$    DELETE SYS$SCRATCH:my_batch_log.tmp;*
$ ENDIF
$ OPEN/WRITE/SHARE=READ OUTFILE SYS$SCRATCH:my_batch_log.tmp
$ DEFINE/NOLOG SYS$OUTPUT OUTFILE
$ DEFINE/NOLOG SYS$ERROR OUTFILE
$!***
$ WRITE SYS$OUTPUT "Do stuff here"
$!***
$ ALL_DONE:
$ CLOSE/NOLOG OUTFILE
$ MAIL/SUBJECT= "Results from MY_BATCH_LOG" -
        SYS$SCRATCH:MY_BATCH_LOG.TMP 'F$GETJPI("","USERNAME")'
$ EXIT&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are a bunch of holes in this simple example, such as the lack of error handling, and the failure to dodge race conditions by giving the scratch file a unique name, but it should get you started.&lt;/P&gt;</description>
    <pubDate>Tue, 09 Apr 2013 17:38:03 GMT</pubDate>
    <dc:creator>Craig A Berry</dc:creator>
    <dc:date>2013-04-09T17:38:03Z</dc:date>
    <item>
      <title>OpenVMS automatically</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/openvms-automatically/m-p/6021507#M28514</link>
      <description>&lt;P&gt;Hi&amp;nbsp;all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I&amp;nbsp;would&amp;nbsp;like&amp;nbsp;to&amp;nbsp;ask&amp;nbsp;some&amp;nbsp;stupid&amp;nbsp;question.&amp;nbsp;Im&amp;nbsp;a&amp;nbsp;new&amp;nbsp;to&amp;nbsp;OpenVMS&amp;nbsp;and&amp;nbsp;I&amp;nbsp;have&amp;nbsp;running&amp;nbsp;a&amp;nbsp;command&amp;nbsp;procedure&amp;nbsp;or&amp;nbsp;let&amp;nbsp;me&amp;nbsp;say&amp;nbsp;script.&amp;nbsp;This&amp;nbsp;script&amp;nbsp;is&amp;nbsp;run&amp;nbsp;like&amp;nbsp;this:&amp;nbsp;submit&amp;nbsp;/noprint&amp;nbsp;script_name&amp;nbsp;&amp;nbsp; &amp;nbsp;and&amp;nbsp;it&amp;nbsp;generate&amp;nbsp;a&amp;nbsp;log&amp;nbsp;file.&amp;nbsp;So&amp;nbsp;I&amp;nbsp;would&amp;nbsp;like&amp;nbsp;to&amp;nbsp;add&amp;nbsp;another&amp;nbsp;thing&amp;nbsp;or&amp;nbsp;make&amp;nbsp;new&amp;nbsp;script&amp;nbsp;that&amp;nbsp;after&amp;nbsp;it&amp;nbsp;finish&amp;nbsp;the&amp;nbsp;log&amp;nbsp;file&amp;nbsp;will&amp;nbsp;be&amp;nbsp;send&amp;nbsp;on&amp;nbsp;mail.&amp;nbsp;The&amp;nbsp;procedure&amp;nbsp;is&amp;nbsp;long&amp;nbsp;and&amp;nbsp;running&amp;nbsp;more&amp;nbsp;then&amp;nbsp;2&amp;nbsp;hours.&amp;nbsp;So&amp;nbsp;afther&amp;nbsp;its&amp;nbsp;done&amp;nbsp;to&amp;nbsp;send&amp;nbsp;me&amp;nbsp;the&amp;nbsp;log&amp;nbsp;file&amp;nbsp;or&amp;nbsp;after&amp;nbsp;2&amp;nbsp;hours&amp;nbsp;or&amp;nbsp;3&amp;nbsp;to&amp;nbsp;send&amp;nbsp;me&amp;nbsp;the&amp;nbsp;log&amp;nbsp;file&amp;nbsp;on&amp;nbsp;mail.&amp;nbsp;also&amp;nbsp;i&amp;nbsp;would&amp;nbsp;like&amp;nbsp;to&amp;nbsp;make&amp;nbsp;this&amp;nbsp;automaticaly,&amp;nbsp;for&amp;nbsp;example&amp;nbsp;this&amp;nbsp;script&amp;nbsp;to&amp;nbsp;run&amp;nbsp;automaticaly&amp;nbsp;every&amp;nbsp;day&amp;nbsp;at&amp;nbsp;17h&amp;nbsp;oclock&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2013 12:09:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/openvms-automatically/m-p/6021507#M28514</guid>
      <dc:creator>MPIvan</dc:creator>
      <dc:date>2013-04-05T12:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: OpenVMS automatically</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/openvms-automatically/m-p/6021517#M28515</link>
      <description>&lt;P&gt;The question isn't stupid but it could have been answered with HELP SUBMIT.&amp;nbsp; Unfortunately there isn't a command qualifier that would mail the logfile to you.&amp;nbsp; The easiest solution, from my point of view, would be to write another simple command procedure that contains the $ SUBMIT/NOPRINT command you're issuing to run the job.&amp;nbsp; For most circumstances you could use the SYNCH command to wait for the job to finish and then have a command to use MAIL to send the logfile to you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;bob&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2013 12:27:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/openvms-automatically/m-p/6021517#M28515</guid>
      <dc:creator>Bob Blunt</dc:creator>
      <dc:date>2013-04-05T12:27:58Z</dc:date>
    </item>
    <item>
      <title>Re: OpenVMS automatically</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/openvms-automatically/m-p/6021669#M28517</link>
      <description>The simplist way to accomplish this is to submit a com file with the following:&lt;BR /&gt;&lt;BR /&gt;1) Submit (actual job)&lt;BR /&gt;2) SYNC on the above job&lt;BR /&gt;3) $mail/subj="whatever" /to="whomever" logfile_from_above&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Note: The SYNC will cause the current stream to wait until the batch job is complete. At that point, the mail will be sent.&lt;BR /&gt;&lt;BR /&gt;I use a similar mechanism.&lt;BR /&gt;&lt;BR /&gt;Dan</description>
      <pubDate>Fri, 05 Apr 2013 14:16:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/openvms-automatically/m-p/6021669#M28517</guid>
      <dc:creator>abrsvc</dc:creator>
      <dc:date>2013-04-05T14:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: OpenVMS automatically</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/openvms-automatically/m-p/6024845#M28521</link>
      <description>&lt;P&gt;You can redirect the middle of your log to another file, close it, and then mail that file, like the following, which will send you an e-mail consisting entirely of "Do stuff here":&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$ type mail_batch_log.com
$ IF F$SEARCH("SYS$SCRATCH:my_batch_log.tmp") .NES. ""
$ THEN
$    DELETE SYS$SCRATCH:my_batch_log.tmp;*
$ ENDIF
$ OPEN/WRITE/SHARE=READ OUTFILE SYS$SCRATCH:my_batch_log.tmp
$ DEFINE/NOLOG SYS$OUTPUT OUTFILE
$ DEFINE/NOLOG SYS$ERROR OUTFILE
$!***
$ WRITE SYS$OUTPUT "Do stuff here"
$!***
$ ALL_DONE:
$ CLOSE/NOLOG OUTFILE
$ MAIL/SUBJECT= "Results from MY_BATCH_LOG" -
        SYS$SCRATCH:MY_BATCH_LOG.TMP 'F$GETJPI("","USERNAME")'
$ EXIT&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are a bunch of holes in this simple example, such as the lack of error handling, and the failure to dodge race conditions by giving the scratch file a unique name, but it should get you started.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2013 17:38:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/openvms-automatically/m-p/6024845#M28521</guid>
      <dc:creator>Craig A Berry</dc:creator>
      <dc:date>2013-04-09T17:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: OpenVMS automatically</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/openvms-automatically/m-p/6032139#M28524</link>
      <description>&lt;P&gt;Hi all and tnx for the reply ... i would like to tell that im a total noob in this :) im trying to learn how it works. Any way sorry for long time no reply and i guess it left to me to try ... Also i have to tell that if the tape where it is saving the backup may be out of memory and then the log stops and i have to know that too so i can react ... but i guess can be left off and wait for mail :) and if it not coming then to chekit :) ...&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2013 05:43:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/openvms-automatically/m-p/6032139#M28524</guid>
      <dc:creator>MPIvan</dc:creator>
      <dc:date>2013-04-17T05:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: OpenVMS automatically</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/openvms-automatically/m-p/6032485#M28525</link>
      <description>You appear to be requesting a number of different but related things here.&lt;BR /&gt;&lt;BR /&gt;You mention that you would like the procedure to start every day at the same time. To accomplish this, submit the same procedure to the batch queue using the /AFTER qualifier and specify "tomorrow+X" where X is the time you would like the procedure to start. For example: /AFTER="tomorrow+05:00" would start the job at 5AM the next day.&lt;BR /&gt;&lt;BR /&gt;In your last reply, you imply that you are doing backups and that the tape may run out of space requiring another tape. Enabling your terminal for operator messages will allow the operator messages to appear on your terminal. Messages requesting another tape will appear there.&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;Dan</description>
      <pubDate>Wed, 17 Apr 2013 12:58:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/openvms-automatically/m-p/6032485#M28525</guid>
      <dc:creator>abrsvc</dc:creator>
      <dc:date>2013-04-17T12:58:56Z</dc:date>
    </item>
  </channel>
</rss>

