<?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: batch queue in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/batch-queue/m-p/4865168#M20206</link>
    <description>Hello.&lt;BR /&gt;A possible solution is to use an auxiliar command file as (batch.com):&lt;BR /&gt;&lt;BR /&gt;$set noon&lt;BR /&gt;$io=f$cvtime("","absolute","day")&lt;BR /&gt;$if io .eqs. "1" .or. io .eqs. "15" then -&lt;BR /&gt;submit DSA1:[VODAFONE.TEST]bep1_backup_test.com&lt;BR /&gt;$submit/after="tomorrow +1" batch.com&lt;BR /&gt;$exit&lt;BR /&gt;&lt;BR /&gt;Best Regards.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 13 Oct 2004 08:37:09 GMT</pubDate>
    <dc:creator>Daniel Fernandez Illan</dc:creator>
    <dc:date>2004-10-13T08:37:09Z</dc:date>
    <item>
      <title>batch queue</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/batch-queue/m-p/4865165#M20203</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I have to create a job to run automatically every first and 15-th day of every month?&lt;BR /&gt;&lt;BR /&gt;For excecuting it every day at 01:00 I have created as below:&lt;BR /&gt;&lt;BR /&gt;submit/AFTER="TOMORROW +1" DSA1:[VODAFONE.TEST]bep1_backup_test.com</description>
      <pubDate>Wed, 13 Oct 2004 08:13:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/batch-queue/m-p/4865165#M20203</guid>
      <dc:creator>Taulant Shamo</dc:creator>
      <dc:date>2004-10-13T08:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: batch queue</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/batch-queue/m-p/4865166#M20204</link>
      <description>Hi,&lt;BR /&gt;if you submit in same month you can simply write:&lt;BR /&gt;$! Get today date in forma dd-mmm-yyyy hh:mm&lt;BR /&gt;$ MYDATE=F$CVTIME("","ABSOLUTE")&lt;BR /&gt;$! Change first 2 chars&lt;BR /&gt;$ MYDATE="15"+F$EXTRACT(2,9,MYDATE)&lt;BR /&gt;$! Submit command&lt;BR /&gt;$ SUBMIT/AFTER='MYDATE' DSA1:[VODAFONE ...&lt;BR /&gt; &lt;BR /&gt;Antonio Vigliotti&lt;BR /&gt;</description>
      <pubDate>Wed, 13 Oct 2004 08:22:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/batch-queue/m-p/4865166#M20204</guid>
      <dc:creator>Antoniov.</dc:creator>
      <dc:date>2004-10-13T08:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: batch queue</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/batch-queue/m-p/4865167#M20205</link>
      <description>Taulant,&lt;BR /&gt;As Antonio has illustrated make use of F$CVTIME() lexical. That will help you.&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;Mobeen&lt;BR /&gt;</description>
      <pubDate>Wed, 13 Oct 2004 08:29:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/batch-queue/m-p/4865167#M20205</guid>
      <dc:creator>Mobeen_1</dc:creator>
      <dc:date>2004-10-13T08:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: batch queue</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/batch-queue/m-p/4865168#M20206</link>
      <description>Hello.&lt;BR /&gt;A possible solution is to use an auxiliar command file as (batch.com):&lt;BR /&gt;&lt;BR /&gt;$set noon&lt;BR /&gt;$io=f$cvtime("","absolute","day")&lt;BR /&gt;$if io .eqs. "1" .or. io .eqs. "15" then -&lt;BR /&gt;submit DSA1:[VODAFONE.TEST]bep1_backup_test.com&lt;BR /&gt;$submit/after="tomorrow +1" batch.com&lt;BR /&gt;$exit&lt;BR /&gt;&lt;BR /&gt;Best Regards.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 13 Oct 2004 08:37:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/batch-queue/m-p/4865168#M20206</guid>
      <dc:creator>Daniel Fernandez Illan</dc:creator>
      <dc:date>2004-10-13T08:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: batch queue</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/batch-queue/m-p/4865169#M20207</link>
      <description>This works for a two-week schedule:&lt;BR /&gt;&lt;BR /&gt;$ submit/after="tomorrow +14-00:00:00.00" x.com&lt;BR /&gt;&lt;BR /&gt;otherwise, youi may have to calculate the next date to have it run. There are several ways to do this - attachted an example.</description>
      <pubDate>Wed, 13 Oct 2004 08:40:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/batch-queue/m-p/4865169#M20207</guid>
      <dc:creator>Willem Grooters</dc:creator>
      <dc:date>2004-10-13T08:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: batch queue</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/batch-queue/m-p/4865170#M20208</link>
      <description>In addition to the good suggestions so far - &lt;BR /&gt;A further point is to ensure you do the re-submitting at the beginning of your batch job incase of problems or delays. &lt;BR /&gt;</description>
      <pubDate>Wed, 13 Oct 2004 08:55:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/batch-queue/m-p/4865170#M20208</guid>
      <dc:creator>Ian Miller.</dc:creator>
      <dc:date>2004-10-13T08:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: batch queue</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/batch-queue/m-p/4865171#M20209</link>
      <description>&lt;BR /&gt;It may be helpful to know that DCL/VMS default all parts of a datespec to the current. So providing "15-" for a date will give the 15th of the current month.&lt;BR /&gt;Second, adding 31 days to a date give next month (and next year if needed). Combined this suggests the solution (in test file format):&lt;BR /&gt;&lt;BR /&gt;$if p1.eqs."" then p1 = f$cvtime("","absolute","day")&lt;BR /&gt;$if 'p1'.lt.15&lt;BR /&gt;$then&lt;BR /&gt;$ next = f$cvt("15-","absolute")&lt;BR /&gt;$else&lt;BR /&gt;$ next = "1-" + f$cvt("+31-","absolute","month") -&lt;BR /&gt;       + "-" +  f$cvt("+31-","absolute","year")&lt;BR /&gt;$endif&lt;BR /&gt;$show symb next&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 13 Oct 2004 09:36:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/batch-queue/m-p/4865171#M20209</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2004-10-13T09:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: batch queue</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/batch-queue/m-p/4865172#M20210</link>
      <description>Ach Hein,&lt;BR /&gt;&lt;BR /&gt;Zoals gezegd: er zijn meerdere wegen die naar Rome leiden, nietwaar? Ik hou alleen niet van die one-liners - ze hebben de neiging nogal obscuur te zijn (en dientengevolge niet te onderhouden).&lt;BR /&gt;&lt;BR /&gt;In English for thos that do not understand Ditch (cannot help Hein is Dutch like me...) &lt;BR /&gt;As said: there are more road leading to Rome. I just don't like one-liners - they tend to be rather obscure (and hance unmaintainable)&lt;BR /&gt;&lt;BR /&gt;Willem</description>
      <pubDate>Wed, 13 Oct 2004 13:26:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/batch-queue/m-p/4865172#M20210</guid>
      <dc:creator>Willem Grooters</dc:creator>
      <dc:date>2004-10-13T13:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: batch queue</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/batch-queue/m-p/4865173#M20211</link>
      <description>I think there's a couple of bugs in Hein's code (consider 31st Jan?). &lt;BR /&gt;&lt;BR /&gt;Finding the 1st and 15th of this month is easy:&lt;BR /&gt;&lt;BR /&gt;$ first=F$CVTIME("1-","ABSOLUTE")&lt;BR /&gt;$ fifteenth=F$CVTIME("15-","ABSOLUTE")&lt;BR /&gt;&lt;BR /&gt; To work out the 1st and 15th of next month regardless of the current date:&lt;BR /&gt;&lt;BR /&gt;$!   find a date in next month&lt;BR /&gt;$ next=F$CVTIME("1-+31-","ABSOLUTE")&lt;BR /&gt;$ nextmonth=-&lt;BR /&gt;    F$CVTIME(next,"ABSOLUTE","MONTH")+-&lt;BR /&gt;    "-"+F$CVTIME(next,,"YEAR")&lt;BR /&gt;$ first="1-"+nextmonth&lt;BR /&gt;$ fifteenth="15-"+nextmonth&lt;BR /&gt;&lt;BR /&gt;The compound time "1-+31-" breaks into two parts, "1-" means "first of this month", then "+31-" means add 31 days. This will always be a date in the following month.&lt;BR /&gt;(Hopefully this isn't too obscure for Willem?)&lt;BR /&gt;&lt;BR /&gt;Slight variation and generalisation- to find the next "Nth of the month", you need to consider the current date:&lt;BR /&gt;&lt;BR /&gt;$ N=15&lt;BR /&gt;$ IF F$CVTIME(,,"DAY").LT.N&lt;BR /&gt;$ THEN ! Nth of this month&lt;BR /&gt;$   nth=F$CVTIME("''N'-","ABSOLUTE")&lt;BR /&gt;$ ELSE ! Nth of next month&lt;BR /&gt;$   ! above code reduced to 1 liner&lt;BR /&gt;$   nth="''N'-"+-&lt;BR /&gt;    F$CVTIME("1-+31-","ABSOLUTE","MONTH")+-&lt;BR /&gt;    "-"+F$CVTIME("1-+31-",,"YEAR")&lt;BR /&gt;$ ENDIF &lt;BR /&gt;&lt;BR /&gt;To have a job that runs on 1st and 15th, you could either code up logic that alternates between 1st and 15th, or you could have two periodic jobs, one resubmitting itself for 1st and the other for the 15th, calling the same procedure to do the actual work. For example:&lt;BR /&gt;&lt;BR /&gt;NTH_OF_MONTH.COM&lt;BR /&gt;$!&lt;BR /&gt;$!  P1=day in month to execute job (D=1st)&lt;BR /&gt;$!  P2=procedure to execute (required)&lt;BR /&gt;$!  P3=extra SUBMIT qualifiers (optional)&lt;BR /&gt;$!&lt;BR /&gt;$ N=p1&lt;BR /&gt;$ IF N.EQS."" THEN N=1&lt;BR /&gt;$ IF F$CVTIME(,,"DAY").LT.N&lt;BR /&gt;$ THEN ! Nth of this month&lt;BR /&gt;$   nth=F$CVTIME("''N'-","ABSOLUTE")&lt;BR /&gt;$ ELSE ! Nth of next month&lt;BR /&gt;$   nth="''N'-"+-&lt;BR /&gt;    F$CVTIME("1-+31-","ABSOLUTE","MONTH")+-&lt;BR /&gt;    "-"+F$CVTIME("1-+31-",,"YEAR")&lt;BR /&gt;$ ENDIF&lt;BR /&gt;$&lt;BR /&gt;$ SUBMIT/AFTER="''nth'" 'p3' -&lt;BR /&gt;    'F$ENVIRONMENT("PROCEDURE") -&lt;BR /&gt;    /PARAM=("''p1'","''p2'","''p3'","DOIT")&lt;BR /&gt;$ IF p4.EQS."DOIT" THEN @'p2'&lt;BR /&gt;$ EXIT&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$ @NTH_OF_MONTH 1 MYJOB.COM "/QUEUE=MYQUEUE"&lt;BR /&gt;$ @NTH_OF_MONTH 15 MYJOB.COM &lt;BR /&gt;&lt;BR /&gt;  This easily generalises to any monthly schedule you like.</description>
      <pubDate>Wed, 13 Oct 2004 18:55:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/batch-queue/m-p/4865173#M20211</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2004-10-13T18:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: batch queue</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/batch-queue/m-p/4865174#M20212</link>
      <description>Ok... so add 16 or 20, just not 31. &lt;BR /&gt;(Since you are only adding after the 15th)&lt;BR /&gt;&lt;BR /&gt;I was just testing you guys...&lt;BR /&gt;&lt;BR /&gt;:-)&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Wed, 13 Oct 2004 20:00:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/batch-queue/m-p/4865174#M20212</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2004-10-13T20:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: batch queue</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/batch-queue/m-p/4865175#M20213</link>
      <description>Hi all!&lt;BR /&gt;&lt;BR /&gt;For several years now we have a general purpose routine GET_NEXT_DATUM which does this.&lt;BR /&gt;(and more: also gives answers like LAST WEDNESDAY (of month) or LAST MONDAY before n-th of the month).&lt;BR /&gt;Calculations are leapyear aware.&lt;BR /&gt;To make it useful to a wider public I translated the instructions and messages into English, and posted it to DCL.OPENVMS.ORG&lt;BR /&gt;When it will be published there, I post the URL as well.&lt;BR /&gt;&lt;BR /&gt;Hth&lt;BR /&gt;&lt;BR /&gt;Cheers.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Jan&lt;BR /&gt;</description>
      <pubDate>Fri, 15 Oct 2004 06:18:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/batch-queue/m-p/4865175#M20213</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2004-10-15T06:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: batch queue</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/batch-queue/m-p/4865176#M20214</link>
      <description>Okay,&lt;BR /&gt;&lt;BR /&gt;the procedure is at&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;Usage: eg&lt;BR /&gt;&lt;BR /&gt;@&lt;UTILITY-DIR&gt;:get_next_datum  LAST wednesday&lt;BR /&gt;or &lt;BR /&gt;@&lt;UTILITY-DIR&gt;:get_next_datum 12 sunday&lt;BR /&gt;&lt;BR /&gt;the first one should be clear.&lt;BR /&gt;&lt;BR /&gt;The second one returns 6, 7, ... 11, or 12;&lt;BR /&gt;whichever is sunday,&lt;BR /&gt;of THIS month if that is tomorrow or later, else of next month.&lt;BR /&gt;&lt;BR /&gt;And then eg.&lt;BR /&gt;$ submit /after="''next_datum'+1:23"&lt;BR /&gt;will mean at the specified day at 1:23.&lt;BR /&gt;&lt;BR /&gt;Until now _WE_ have not found it to be lacking. YMMV&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;&lt;BR /&gt;Have one on me&lt;BR /&gt;&lt;BR /&gt;Jan&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/UTILITY-DIR&gt;&lt;/UTILITY-DIR&gt;</description>
      <pubDate>Fri, 15 Oct 2004 07:19:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/batch-queue/m-p/4865176#M20214</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2004-10-15T07:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: batch queue</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/batch-queue/m-p/4865177#M20215</link>
      <description>Thank you all</description>
      <pubDate>Sat, 16 Oct 2004 01:47:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/batch-queue/m-p/4865177#M20215</guid>
      <dc:creator>Taulant Shamo</dc:creator>
      <dc:date>2004-10-16T01:47:55Z</dc:date>
    </item>
  </channel>
</rss>

