<?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: Submit com proc to batch que to run once a week? in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/submit-com-proc-to-batch-que-to-run-once-a-week/m-p/4200662#M89879</link>
    <description>@Gerard Labadie (and others)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;But while some procedures can be released twice without harm, some can't.&lt;BR /&gt;&lt;BR /&gt;So after a modif in a .com file, we are still left with the 2 options:&lt;BR /&gt;1) delete/entry, followed by another submit of the new com file&lt;BR /&gt;2) copy/overlay my.com; my.com;-1&lt;BR /&gt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;&lt;BR /&gt;We usually use option 3):&lt;BR /&gt;&lt;BR /&gt;Begin the procedure with&lt;BR /&gt;&lt;BR /&gt;$ IF f$environment("procedure") .nes. f$parse(";0",f$environment("procedure")) &lt;BR /&gt;$ then&lt;BR /&gt;$   --execute resubmit ;0 version for NOW --&lt;BR /&gt;$   exit&lt;BR /&gt;$ endif&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;As for the original question: in 2004 I posted this to DCL.OPENVMS.ORG&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://dcl.openvms.org/stories.php?story=04/10/15/8590853" target="_blank"&gt;http://dcl.openvms.org/stories.php?story=04/10/15/8590853&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Instructions are in the procedure. It does exatly this, if given parameter "Sunday"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;hth&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>Wed, 21 May 2008 14:34:02 GMT</pubDate>
    <dc:creator>Jan van den Ende</dc:creator>
    <dc:date>2008-05-21T14:34:02Z</dc:date>
    <item>
      <title>Submit com proc to batch que to run once a week?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/submit-com-proc-to-batch-que-to-run-once-a-week/m-p/4200653#M89870</link>
      <description>What is the syntax to that accompanies the submit command to have a job run once a week?  I know how to do it on a daily basis, or hourly, but not how to limit it to once a week.</description>
      <pubDate>Mon, 19 May 2008 14:20:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/submit-com-proc-to-batch-que-to-run-once-a-week/m-p/4200653#M89870</guid>
      <dc:creator>Charles Holley_1</dc:creator>
      <dc:date>2008-05-19T14:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: Submit com proc to batch que to run once a week?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/submit-com-proc-to-batch-que-to-run-once-a-week/m-p/4200654#M89871</link>
      <description>Hello&lt;BR /&gt;&lt;BR /&gt;At the beginning of the procedure, a &lt;BR /&gt;$ subm 'f$env("procedure")/after="+7-0"/queue=xxx/...&lt;BR /&gt;&lt;BR /&gt;will do it</description>
      <pubDate>Mon, 19 May 2008 14:27:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/submit-com-proc-to-batch-que-to-run-once-a-week/m-p/4200654#M89871</guid>
      <dc:creator>labadie_1</dc:creator>
      <dc:date>2008-05-19T14:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: Submit com proc to batch que to run once a week?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/submit-com-proc-to-batch-que-to-run-once-a-week/m-p/4200655#M89872</link>
      <description>So you're familiar with queuing on a daily basis?  Ok.  The weekly sequence is basically the same SUBMIT /AFTER sequence.&lt;BR /&gt;&lt;BR /&gt;SUBMIT /AFTER=date or a delta or combination time or such.  (If you're not familiar with absolute, delta or combination times, take a look at the help library text for time.  There's usually a top-level time topic in the system help library, though IIRC the topic name has changed a few times over versions.)&lt;BR /&gt;&lt;BR /&gt;The "sneaky" approach is /AFTER=tomorrow or /AFTER="tomorrow+02:00" and have the stuff run daily, and do a test for the weekday.  I use this when I have a few jobs, and I let it run nightly.  If the batch job doesn't do anything, it requeues and exits.&lt;BR /&gt;&lt;BR /&gt;Here's some related introductory text:&lt;BR /&gt;&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;there are other examples around, run a few Google searches for this topic.&lt;BR /&gt;&lt;BR /&gt;Calculating the day of the week is a little bit of DCL-level math; there's no /AFTER=SUNDAY mechanism.  (Which might be a nice enhancement, but...)  I'm guessing this area may be the source of confusion.  And here, the primary lexical function here is f$cvtime.  It has most of what you need for the text weekday and numerics, etc.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 19 May 2008 14:41:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/submit-com-proc-to-batch-que-to-run-once-a-week/m-p/4200655#M89872</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2008-05-19T14:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: Submit com proc to batch que to run once a week?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/submit-com-proc-to-batch-que-to-run-once-a-week/m-p/4200656#M89873</link>
      <description>A trick I use to simplify daily or weekly processing is to have a job that runs at the same time every day, usually 1am or 2am. Have it resubmit itself:&lt;BR /&gt;&lt;BR /&gt;$ SUBMIT/AFTER="TOMORROW+01:00" 'self'&lt;BR /&gt;&lt;BR /&gt;Have this job search for and execute procedures based on their name. So, have a directory called [REGULAR_JOBS]. Anything to be run daily is called DAILY_name, for example&lt;BR /&gt;&lt;BR /&gt;DAILY_HOUSEKEEPING.COM&lt;BR /&gt;DAILY_DISK_CHECK.COM&lt;BR /&gt;&lt;BR /&gt;Execute them as:&lt;BR /&gt;&lt;BR /&gt;$ dailyloop: f=F$SEARCH("[REGULAR_JOBS]DAILY_*.COM")&lt;BR /&gt;$ IF f.NES.""&lt;BR /&gt;$ THEN&lt;BR /&gt;$   @'f'&lt;BR /&gt;$   GOTO dailyloop&lt;BR /&gt;$ ENDIF&lt;BR /&gt;&lt;BR /&gt;For weekly jobs, use the day name in the filename, WEEKLY_day_name. For example&lt;BR /&gt;&lt;BR /&gt;WEEKLY_SUNDAY_OPCOM_ROLLOVER.COM&lt;BR /&gt;WEEKLY_MONDAY_START_OF_WEEK_REPORT.COM&lt;BR /&gt;WEEKLY_SATURDAY_LOGOFF_USERS.COM&lt;BR /&gt;&lt;BR /&gt;$ day=F$CVTIME(,"ABSOLUTE","WEEKDAY")&lt;BR /&gt;$ weeklyloop: f=F$SEARCH("[REGULAR_JOBS]WEEKLY_''day'_*.COM")&lt;BR /&gt;$ IF f.NES.""&lt;BR /&gt;$ THEN&lt;BR /&gt;$   @'f'&lt;BR /&gt;$   GOTO weeklyloop&lt;BR /&gt;$ ENDIF&lt;BR /&gt;&lt;BR /&gt;It's very easy to enable, disable or reschedule jobs just by manipulating the filenames. It's also obvious when they run just by looking at a directory listing.&lt;BR /&gt;&lt;BR /&gt;Another trick for more complex processing is to run the procedure daily, but use the day name as a selector. For example, suppose we want something to run on Monday, Wednesday and Friday. Set it as a DAILY_ procedure as above, but in the procedure itself use:&lt;BR /&gt;&lt;BR /&gt;$ day=F$CVTIME(,"ABSOLUTE","WEEKDAY")&lt;BR /&gt;$ GOTO do_'day'&lt;BR /&gt;$&lt;BR /&gt;$ do_Sunday:&lt;BR /&gt;$ do_Tuesday:&lt;BR /&gt;$ do_Thursday:&lt;BR /&gt;$ do_Saturday:&lt;BR /&gt;$   ! do nothing&lt;BR /&gt;$ EXIT&lt;BR /&gt;$&lt;BR /&gt;$ do_Monday:&lt;BR /&gt;$ do_Wednesday:&lt;BR /&gt;$ do_Friday:&lt;BR /&gt;$   ! processing here&lt;BR /&gt;$ EXIT&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 19 May 2008 21:30:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/submit-com-proc-to-batch-que-to-run-once-a-week/m-p/4200656#M89873</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2008-05-19T21:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: Submit com proc to batch que to run once a week?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/submit-com-proc-to-batch-que-to-run-once-a-week/m-p/4200657#M89874</link>
      <description>oh, and a small improvement to Gerard's suggestion:&lt;BR /&gt;&lt;BR /&gt;&amp;gt;$ subm 'f$env("procedure")/after="+7-0"/queue=xxx/...&lt;BR /&gt;&lt;BR /&gt;Since F$ENVIRONMENT("PROCEDURE") includes the version number, this won't pick up a new version of the file.&lt;BR /&gt;Instead use:&lt;BR /&gt;&lt;BR /&gt;F$PARSE(";",F$ENVIRONMENT("PROCEDURE"))&lt;BR /&gt;&lt;BR /&gt;to request the latest version.</description>
      <pubDate>Mon, 19 May 2008 21:33:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/submit-com-proc-to-batch-que-to-run-once-a-week/m-p/4200657#M89874</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2008-05-19T21:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: Submit com proc to batch que to run once a week?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/submit-com-proc-to-batch-que-to-run-once-a-week/m-p/4200658#M89875</link>
      <description>Charles, All the suggestions above are great, also check out the "kronos" job scheduler on the freeware disk or search "vms kronos" should find it.  It can schedule periodic jobs on almost any schedule and they will survive reboots as well.  -Jim&lt;BR /&gt;</description>
      <pubDate>Tue, 20 May 2008 17:17:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/submit-com-proc-to-batch-que-to-run-once-a-week/m-p/4200658#M89875</guid>
      <dc:creator>James Cordill</dc:creator>
      <dc:date>2008-05-20T17:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: Submit com proc to batch que to run once a week?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/submit-com-proc-to-batch-que-to-run-once-a-week/m-p/4200659#M89876</link>
      <description>John&lt;BR /&gt;&lt;BR /&gt;Thanks for the tip.&lt;BR /&gt;&lt;BR /&gt;I think there is still a problem anyway: after a modif in the com file, your method will need 2 resubmits to use the new file, while mine will never use the new com file (or eventually fail will the well-known "error opening primary input file sys$input"...) if the file is purged.&lt;BR /&gt;&lt;BR /&gt;But while some procedures can be released twice without harm, some can't.&lt;BR /&gt;&lt;BR /&gt;So after a modif in a .com file, we are still left with the 2 options:&lt;BR /&gt;1) delete/entry, followed by another submit of the new com file&lt;BR /&gt;2) copy/overlay my.com; my.com;-1&lt;BR /&gt;&lt;BR /&gt;The option 2 has my preference, as I am sure not the forget/modify some parameter of the job (queue name, job name, log name, parameter P1 to P8, cputime...)&lt;BR /&gt;</description>
      <pubDate>Wed, 21 May 2008 12:32:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/submit-com-proc-to-batch-que-to-run-once-a-week/m-p/4200659#M89876</guid>
      <dc:creator>labadie_1</dc:creator>
      <dc:date>2008-05-21T12:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: Submit com proc to batch que to run once a week?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/submit-com-proc-to-batch-que-to-run-once-a-week/m-p/4200660#M89877</link>
      <description>If the procedure gets changed, then on the next execution the old procedure will be executed and the changed procedure will be executed for the first time on the next plus one execution.&lt;BR /&gt;&lt;BR /&gt;This can be avoided with the following construction:&lt;BR /&gt;&lt;BR /&gt;$ IF P1.EQS."1" THEN $GOTO START&lt;BR /&gt;$ @name-of-procedure.com "1"&lt;BR /&gt;$ EXIT&lt;BR /&gt;$START:&lt;BR /&gt;&lt;BR /&gt;at the beginning of the procedure</description>
      <pubDate>Wed, 21 May 2008 13:34:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/submit-com-proc-to-batch-que-to-run-once-a-week/m-p/4200660#M89877</guid>
      <dc:creator>Anton Walter</dc:creator>
      <dc:date>2008-05-21T13:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: Submit com proc to batch que to run once a week?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/submit-com-proc-to-batch-que-to-run-once-a-week/m-p/4200661#M89878</link>
      <description>Anton&lt;BR /&gt;&lt;BR /&gt;Nice trick !&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 May 2008 14:24:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/submit-com-proc-to-batch-que-to-run-once-a-week/m-p/4200661#M89878</guid>
      <dc:creator>labadie_1</dc:creator>
      <dc:date>2008-05-21T14:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: Submit com proc to batch que to run once a week?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/submit-com-proc-to-batch-que-to-run-once-a-week/m-p/4200662#M89879</link>
      <description>@Gerard Labadie (and others)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;But while some procedures can be released twice without harm, some can't.&lt;BR /&gt;&lt;BR /&gt;So after a modif in a .com file, we are still left with the 2 options:&lt;BR /&gt;1) delete/entry, followed by another submit of the new com file&lt;BR /&gt;2) copy/overlay my.com; my.com;-1&lt;BR /&gt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;&lt;BR /&gt;We usually use option 3):&lt;BR /&gt;&lt;BR /&gt;Begin the procedure with&lt;BR /&gt;&lt;BR /&gt;$ IF f$environment("procedure") .nes. f$parse(";0",f$environment("procedure")) &lt;BR /&gt;$ then&lt;BR /&gt;$   --execute resubmit ;0 version for NOW --&lt;BR /&gt;$   exit&lt;BR /&gt;$ endif&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;As for the original question: in 2004 I posted this to DCL.OPENVMS.ORG&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://dcl.openvms.org/stories.php?story=04/10/15/8590853" target="_blank"&gt;http://dcl.openvms.org/stories.php?story=04/10/15/8590853&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Instructions are in the procedure. It does exatly this, if given parameter "Sunday"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;hth&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>Wed, 21 May 2008 14:34:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/submit-com-proc-to-batch-que-to-run-once-a-week/m-p/4200662#M89879</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2008-05-21T14:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Submit com proc to batch que to run once a week?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/submit-com-proc-to-batch-que-to-run-once-a-week/m-p/4200663#M89880</link>
      <description>&lt;!--!*#--&gt;As to the easiest way to resubmit a batch job exactly as it was submitted before using the new version of the batch command procedure, may I recommend that you use my DISPLAY_JOBS.COM for this task.&lt;BR /&gt;&lt;BR /&gt;As documented in the help text output with&lt;BR /&gt;$ @DISPLAY_JOBS ?&lt;BR /&gt;&lt;SNIP&gt;&lt;BR /&gt;This one-liner will resubmit batch job entry 123 using a new version of its batch command procedure and kill the old job:&lt;BR /&gt;$ PIPE @DISPLAY_JOBS "" 123 * VERSION,KILL /CONF | @SYS$PIPE&lt;BR /&gt;&lt;BR /&gt;Now I realize that is a long line to type, but you can just use a 1 line RESUBMIT.COM that runs the above command using P1 for the entry number.&lt;BR /&gt;&lt;BR /&gt;Personally though I hate using one command procedure as a wrapper for another, so here is another method using some PIPE magic (this requires my newest version - attached to this post).  Define a symbol in your LOGIN.COM this way (use the full path for DISPLAY_JOBS.COM):&lt;BR /&gt;&lt;BR /&gt;$ RESUBMIT == "PIPE WRITE SYS$OUTPUT ""PIPE @DISPLAY_JOBS"+-&lt;BR /&gt;"+ 'P1' * KILL,VERSION/CONFIRM|@SYS$PIPE:"" | @SYS$PIPE:"&lt;BR /&gt;&lt;BR /&gt;$ SHOW SYMBOL RESUBMIT&lt;BR /&gt;RESUBMIT == "PIPE WRITE SYS$OUTPUT "PIPE @DISPLAY_JOBS+ 'P1' * KILL,VERSION/CONFIRM|@SYS$PIPE:" | @SYS$PIPE:"&lt;BR /&gt;&lt;BR /&gt;And then Bob's your uncle:&lt;BR /&gt;&lt;BR /&gt;$ SHOW ENTRY/FULL/USER=SYSTEM CLUSTER_NEW_DAY&lt;BR /&gt;  Entry  Jobname         Username     Blocks  Status&lt;BR /&gt;  -----  -------         --------     ------  ------&lt;BR /&gt;1002606  CLUSTER_NEW_DAY SYSTEM               Holding until 22-MAY-2008 00:00:00&lt;BR /&gt;         On idle batch queue ACCTIQ&lt;BR /&gt;         Submitted 21-MAY-2008 00:00:00 /KEEP /LOG=SLOG:[MAINT].LOG; /NOPRINT&lt;BR /&gt;         /PRIORITY=255 /RESTART=ACCTIQ&lt;BR /&gt;         File: _$1$DGA111:[DSKA.SYSCLOCK]CLUSTER_NEW_DAY.COM;3&lt;BR /&gt;&lt;BR /&gt;$ RESUBMIT 1002606&lt;BR /&gt;SUBMIT _$1$DGA111:[DSKA.SYSCLOCK]CLUSTER_NEW_DAY.COM;4 ? [N]: Y&lt;BR /&gt;Job CLUSTER_NEW_DAY (queue ACCTIQ, entry 158) holding until 22-MAY-2008 00:00&lt;BR /&gt;%DELETE-I-DELETED, entry 1002606 aborting or deleted&lt;BR /&gt;&lt;BR /&gt;$ SHOW ENTRY/FULL/USER=SYSTEM CLUSTER_NEW_DAY&lt;BR /&gt;  Entry  Jobname         Username     Blocks  Status&lt;BR /&gt;  -----  -------         --------     ------  ------&lt;BR /&gt;    158  CLUSTER_NEW_DAY SYSTEM               Holding until 22-MAY-2008 00:00:00&lt;BR /&gt;         On idle batch queue ACCTIQ&lt;BR /&gt;         Submitted 21-MAY-2008 16:26:12 /KEEP /LOG=$1$DGA115:[SLOG.][MAINT].LOG;&lt;BR /&gt;         /NOPRINT /PRIORITY=255 /RESTART=ACCTIQ&lt;BR /&gt;         File: _$1$DGA111:[DSKA.SYSCLOCK]CLUSTER_NEW_DAY.COM;4&lt;BR /&gt;&lt;/SNIP&gt;</description>
      <pubDate>Wed, 21 May 2008 15:31:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/submit-com-proc-to-batch-que-to-run-once-a-week/m-p/4200663#M89880</guid>
      <dc:creator>Jess Goodman</dc:creator>
      <dc:date>2008-05-21T15:31:51Z</dc:date>
    </item>
  </channel>
</rss>

