<?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: Script problem for automatic execution in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/script-problem-for-automatic-execution/m-p/4349053#M45145</link>
    <description>Gajendra, is it just coincidence, or are You the alter ego of GP1 on &lt;BR /&gt; &lt;A href="http://www.computing.net/answers/openvms/how-to-run-script-at-30-min-automat/556.html" target="_blank"&gt;http://www.computing.net/answers/openvms/how-to-run-script-at-30-min-automat/556.html&lt;/A&gt;&lt;BR /&gt;?</description>
    <pubDate>Sun, 01 Feb 2009 16:59:18 GMT</pubDate>
    <dc:creator>Joseph Huber_1</dc:creator>
    <dc:date>2009-02-01T16:59:18Z</dc:date>
    <item>
      <title>Script problem for automatic execution</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/script-problem-for-automatic-execution/m-p/4349049#M45141</link>
      <description>&lt;!--!*#--&gt;Hello friends..&lt;BR /&gt;i am new to openVMS and i want to build a copy.com file to execute every half hour. I have tried as below&lt;BR /&gt;&lt;BR /&gt;$ THIS=F$ENVIRONMENT("PROCEDURE")&lt;BR /&gt;$ THIS=THIS-F$PARSE(THIS,,,"VERSION")&lt;BR /&gt;$ QNAME=F$GETQUI("DISPLAY_QUEUE","QUEUE_NAME","*","THIS_JOB")&lt;BR /&gt;$ SHOW SYM QNAME&lt;BR /&gt;$ SUBMIT 'THIS'/QUE='QNAME'/AFTER=("F$TIME()'+00:30")&lt;BR /&gt;$ NEXT_NOW=F$CVTIME("","ABSOLUTE")&lt;BR /&gt;$ SHOW SYMBOL NEXT_NOW&lt;BR /&gt;! copy.com commands&lt;BR /&gt;!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Output:&lt;BR /&gt;&lt;BR /&gt;QNAME = ""&lt;BR /&gt;%DCL-W-VALREQ, missing qualifier or keyword value - supply all required values&lt;BR /&gt;NEXT_NOW = "29-JAN-2009 10:10:57.78"&lt;BR /&gt;&lt;BR /&gt;Here the mode is interactive (i.e. by F$MODE)&lt;BR /&gt;i know that i have to run this script in batch mode but how to run it in batch mode that i dont know or some thing i am forgot to execute..Please guide me&lt;BR /&gt;Here queue is also not created when submitting directly in prompt directly By submit command.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 01 Feb 2009 11:01:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/script-problem-for-automatic-execution/m-p/4349049#M45141</guid>
      <dc:creator>Gajendra</dc:creator>
      <dc:date>2009-02-01T11:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: Script problem for automatic execution</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/script-problem-for-automatic-execution/m-p/4349050#M45142</link>
      <description>Compliments on a good start for a newbie!&lt;BR /&gt;(Good google skills and/or excellent learning skills :-)&lt;BR /&gt;&lt;BR /&gt;If you run this script online, as @script_name, then there is no job, and thus no quename. So instead of running it with @, just submit it manually a first time, on te target queue: $SUBM/QUE=some_queue_name script_name&lt;BR /&gt;&lt;BR /&gt;Alternatively, do some defensive coding.&lt;BR /&gt;After the QNAME=F$GETQUI... the srcipt SHOULD test for a return value. If empty it can choose to bail out, or provide an alternative. So either&lt;BR /&gt;&lt;BR /&gt;$IF qname .EQS. "" THEN qname = "some_queue_name"&lt;BR /&gt;&lt;BR /&gt;Or...&lt;BR /&gt;&lt;BR /&gt;$IF qname .EQS. "" THEN GOTO no_queue&lt;BR /&gt;:&lt;BR /&gt;:&lt;BR /&gt;$no_queue:&lt;BR /&gt;$WRITE SYS$OUTPUT "Could not get QUEUE NAME, Please submit on desired queue"&lt;BR /&gt;$EXIT 16&lt;BR /&gt;&lt;BR /&gt;Enjoy,&lt;BR /&gt;Hein&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 01 Feb 2009 13:21:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/script-problem-for-automatic-execution/m-p/4349050#M45142</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-02-01T13:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: Script problem for automatic execution</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/script-problem-for-automatic-execution/m-p/4349051#M45143</link>
      <description>&lt;!--!*#--&gt;&amp;gt; [...] how to run it in batch mode that i&lt;BR /&gt;&amp;gt; dont know [...]&lt;BR /&gt;&lt;BR /&gt;"HELP SUBMIT"?  Do what's in the procedure,&lt;BR /&gt;but without the "/AFTER=xxx"?&lt;BR /&gt;&lt;BR /&gt;&amp;gt; $ THIS=THIS-F$PARSE(THIS,,,"VERSION")&lt;BR /&gt;&lt;BR /&gt;I might do:&lt;BR /&gt;&lt;BR /&gt;this = f$parse( ";", this, , , "SYNTAX_ONLY")&lt;BR /&gt;&lt;BR /&gt;&amp;gt; $ SUBMIT 'THIS'/QUE='QNAME'/AFTER=("F$TIME()'+00:30")&lt;BR /&gt;&amp;gt; $ NEXT_NOW=F$CVTIME("","ABSOLUTE")&lt;BR /&gt;&lt;BR /&gt;Were you trying to do something like this?&lt;BR /&gt;&lt;BR /&gt;NEXT_NOW = F$CVTIME( "''F$TIME()'+00:30", "ABSOLUTE")&lt;BR /&gt;SUBMIT 'THIS' /QUE = 'QNAME' AFTER = "''NEXT_NOW'"&lt;BR /&gt;&lt;BR /&gt;Are you writing this procedure fresh, or are&lt;BR /&gt;you trying to modify an existing procedure?&lt;BR /&gt;&lt;BR /&gt;A Forum search for keywords like&lt;BR /&gt;      batch resubmit&lt;BR /&gt;should find many old examples.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Here queue is also not created when&lt;BR /&gt;&amp;gt; submitting directly in prompt directly By&lt;BR /&gt;&amp;gt; submit command.&lt;BR /&gt;&lt;BR /&gt;SUBMIT does not create a queue, it submits a&lt;BR /&gt;job to a queue.&lt;BR /&gt;&lt;BR /&gt;We can't see your "submit command", so it's&lt;BR /&gt;hard to say much about it. Showing actual&lt;BR /&gt;commands with their actual output can be more&lt;BR /&gt;helpful than a vague description.</description>
      <pubDate>Sun, 01 Feb 2009 13:40:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/script-problem-for-automatic-execution/m-p/4349051#M45143</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2009-02-01T13:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: Script problem for automatic execution</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/script-problem-for-automatic-execution/m-p/4349052#M45144</link>
      <description>The following doesn't target your specific question, but rather how to get to the answer of your specific question.&lt;BR /&gt;&lt;BR /&gt;The DCL command SET VERIFY is your friend here when you're trying to figure out why some local DCL logic has gone weird.  &lt;BR /&gt;&lt;BR /&gt;Typical DCL debugging is comparatively primitive and "bread-crumb" style debugging, using WRITE SYS$OUTPUT and SET VERIFY (or f$verify()) to diagnose and debug.&lt;BR /&gt;&lt;BR /&gt;As for the root goal, your approach will work, but I'd suggest looking at Kronos or other package; there's a Kronos update around, and there are other scheduling packages for OpenVMS such as cron.  And there are various commercial packages.  The downfall of your approach (and most of us use or have used your approach at one time or another; I have) is around error processing and error handling.  When the jobs go weird or the queues go weird or the node crashes while active, or...&lt;BR /&gt;&lt;BR /&gt;Links to Kronos and cron tools for OpenVMS and related are here:&lt;BR /&gt;&lt;A href="http://64.223.189.234/node/97" target="_blank"&gt;http://64.223.189.234/node/97&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;And guessing at what you're using COPY for here, here's an approach that is ancient and effective, but little-known:&lt;BR /&gt;&lt;A href="http://64.223.189.234/node/136" target="_blank"&gt;http://64.223.189.234/node/136&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 01 Feb 2009 13:48:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/script-problem-for-automatic-execution/m-p/4349052#M45144</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2009-02-01T13:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: Script problem for automatic execution</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/script-problem-for-automatic-execution/m-p/4349053#M45145</link>
      <description>Gajendra, is it just coincidence, or are You the alter ego of GP1 on &lt;BR /&gt; &lt;A href="http://www.computing.net/answers/openvms/how-to-run-script-at-30-min-automat/556.html" target="_blank"&gt;http://www.computing.net/answers/openvms/how-to-run-script-at-30-min-automat/556.html&lt;/A&gt;&lt;BR /&gt;?</description>
      <pubDate>Sun, 01 Feb 2009 16:59:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/script-problem-for-automatic-execution/m-p/4349053#M45145</guid>
      <dc:creator>Joseph Huber_1</dc:creator>
      <dc:date>2009-02-01T16:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: Script problem for automatic execution</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/script-problem-for-automatic-execution/m-p/4349054#M45146</link>
      <description>Gajendra,&lt;BR /&gt;&lt;BR /&gt;(some more DCL coding opinions...)&lt;BR /&gt;&lt;BR /&gt;$ THIS=F$ENVIRONMENT("PROCEDURE")&lt;BR /&gt;$ THIS=THIS-F$PARSE(THIS,,,"VERSION")&lt;BR /&gt;&lt;BR /&gt;Here's a neater way to get the same result:&lt;BR /&gt;&lt;BR /&gt;$ THIS=F$PARSE(";",F$ENVIRONMENT("PROCEDURE"))&lt;BR /&gt;&lt;BR /&gt;This is arguably "more correct" as all the parsing and manipulation is being done by RMS. There may be pathological ODS-5 file specifications that may not work correctly with the string subtraction.&lt;BR /&gt;&lt;BR /&gt;$ QNAME=F$GETQUI("DISPLAY_QUEUE","QUEUE_NAME","*","THIS_JOB")&lt;BR /&gt;&lt;BR /&gt;Although it probably doesn't make much difference, I tend to leave out the "*". I worry about GETQUI wildcard context.&lt;BR /&gt;&lt;BR /&gt;$ QNAME=F$GETQUI("DISPLAY_QUEUE","QUEUE_NAME",,"THIS_JOB")&lt;BR /&gt;&lt;BR /&gt;The problem here is QNAME will be blank if this procedure is executed in any mode other than batch. You then need to decide which queue you want in that situation. If you want to specify a default queue, something like:&lt;BR /&gt;&lt;BR /&gt;$ IF QNAME.EQS."" THEN QNAME="defaultname" &lt;BR /&gt;$ SUBMIT/QUEUE='QNAME' ...&lt;BR /&gt;&lt;BR /&gt;or you could just take the process default&lt;BR /&gt;&lt;BR /&gt;$ IF QNAME.NES."" THEN QNAME="/QUEUE="+QNAME&lt;BR /&gt;$ SUBMIT 'qname' ...&lt;BR /&gt;&lt;BR /&gt;For the time, you can use:&lt;BR /&gt;&lt;BR /&gt;/AFTER="''F$CVTIME("+0:30","ABSOLUTE")'"&lt;BR /&gt;</description>
      <pubDate>Sun, 01 Feb 2009 22:04:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/script-problem-for-automatic-execution/m-p/4349054#M45146</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2009-02-01T22:04:41Z</dc:date>
    </item>
  </channel>
</rss>

