<?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: Need to write DCL script and submit in batch queue on weekly basis in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/need-to-write-dcl-script-and-submit-in-batch-queue-on-weekly/m-p/6436312#M37313</link>
    <description>&lt;P&gt;Through the years I've found a number of ways (which I will check what I have), but I quickly found this:&lt;/P&gt;&lt;P&gt;The simplest way to resubmit a periodic job is to use a combination&lt;BR /&gt;&amp;nbsp; time. For example:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ SUBMIT/AFTER="+7-"&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; This will resubmit the job exactly 7 days after the current time.&lt;BR /&gt;&amp;nbsp; The only drawback is the time the job executes will tend to drift&lt;BR /&gt;&amp;nbsp; forward, especially if you wait until the end of the procedure to&lt;BR /&gt;&amp;nbsp; resubmit the job.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; If you really want 7 days from now at 7 am, you can use some DCL to&lt;BR /&gt;&amp;nbsp; derive the absolute time string:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ day=F$CVTIME("+7-","ABSOLUTE","DATE")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ SUBMIT/AFTER="''day' 07:00"&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; or somewhat more briefly (using a combination time), you could use:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ SUBMIT/AFTER="TODAY+7-07:00"&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; The only drawback here is if your job is delayed until the next day,&lt;BR /&gt;&amp;nbsp; you'll end up getting out of synch. So, if you really must find the&lt;BR /&gt;&amp;nbsp; next Friday to execute, you can use a loop:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ NextDay="TODAY"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ DayLoop: NextDay = F$CVTIME("''NextDay'+1-","ABSOLUTE","DATE")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ Today = F$EDIT(F$CVTIME(NextDay,,"WEEKDAY"),"UPCASE,COLLAPSE")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ IF Today .NES. "FRIDAY" THEN GOTO DayLoop&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ procname = F$ENVIRONMENT("PROCEDURE")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ SUBMIT/AFTER="''nextday'+07:00" 'procname'&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; Jobs often resubmit themselves as part of the initial processing&lt;BR /&gt;&amp;nbsp; within the batch job.&amp;nbsp; The batch job can itself use lexical calls&lt;BR /&gt;&amp;nbsp; such as f$environment("PROCEDURE") to acquire the name of the&lt;BR /&gt;&amp;nbsp; currently-executing procedure, and then pass this in as part of&lt;BR /&gt;&amp;nbsp; the SUBMIT command.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; Another approach simply causes the job to resubmit itself daily at a&lt;BR /&gt;&amp;nbsp; specified time, and the job itself then decides to execute the full&lt;BR /&gt;&amp;nbsp; processing (only) if the current day of the week is (say) Thursday.&lt;BR /&gt;&amp;nbsp; (This is logically rather similar to the above-mentioned approach.)&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ procname = F$ENVIRONMENT("PROCEDURE")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ SUBMIT/AFTER="TOMORROW+07:00" 'procname'&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ Today = F$EDIT(F$CVTIME(NextDay,,"WEEKDAY"),"UPCASE,COLLAPSE")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ IF Today .NES. "FRIDAY" THEN EXIT&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; For information on specifying the date and time, please see the HELP&lt;BR /&gt;&amp;nbsp; DCL_Tips Date_Time area in recent HELP libraries, or the similar HELP&lt;BR /&gt;&amp;nbsp; Specify area in older HELP libraries.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; On the other hand, you could use one of the many scheduling products&lt;BR /&gt;&amp;nbsp; available to solve this, and many other scheduling issues.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 03 Apr 2014 14:01:02 GMT</pubDate>
    <dc:creator>James T Horn</dc:creator>
    <dc:date>2014-04-03T14:01:02Z</dc:date>
    <item>
      <title>Need to write DCL script and submit in batch queue on weekly basis</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/need-to-write-dcl-script-and-submit-in-batch-queue-on-weekly/m-p/6435726#M37312</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please suggest what needs to be corrected/added to execute job on every Friday at 20:00&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Script attached below&lt;/P&gt;&lt;P&gt;************************************&lt;/P&gt;&lt;P&gt;$set noon&lt;BR /&gt;$backup/ignore=inter SMSC$ROOT:[BIN]*.*;* SMSC_TRC0:[RDB_BCK.BIN]&lt;BR /&gt;$backup/ignore=inter SMSC$ROOT:[DATA]*.*;* SMSC_TRC0:[RDB_BCK.DATA]&lt;BR /&gt;$RMU/BACKUP/ONLINE SMSC_DB_SDB SMSC_TRC0:[RDB_BCK.RBFBKP]CMPLT_DB_BACKUP.RBF&lt;BR /&gt;$backup/ignore=inter SMSC$ROOT:[LOG]*.txt;* SMSC_TRC0:[RDB_BCK.ccabackup]&lt;BR /&gt;$define/exec SYS$output SMSC_TRC0:[RDB_BCk.netconfig_bkp]netconfig.txt&lt;BR /&gt;$ucx sh route&lt;BR /&gt;$ucx sh route/perm&lt;BR /&gt;$netstat –rn&lt;BR /&gt;$ifconfig -a&lt;BR /&gt;$deassign sys$output&lt;BR /&gt;$submit/noprint/notify/user=system/queue=sys$batch/log=$1$DGA100:[omniscripts]srcbackup.log $1$DGA100:[omniscripts]srcbackup.COM/AFTER="today+7-"/keep&lt;/P&gt;&lt;P&gt;*************************************************************&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;SK Mishra&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2014 05:36:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/need-to-write-dcl-script-and-submit-in-batch-queue-on-weekly/m-p/6435726#M37312</guid>
      <dc:creator>Sumant M Kumar</dc:creator>
      <dc:date>2014-04-03T05:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: Need to write DCL script and submit in batch queue on weekly basis</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/need-to-write-dcl-script-and-submit-in-batch-queue-on-weekly/m-p/6436312#M37313</link>
      <description>&lt;P&gt;Through the years I've found a number of ways (which I will check what I have), but I quickly found this:&lt;/P&gt;&lt;P&gt;The simplest way to resubmit a periodic job is to use a combination&lt;BR /&gt;&amp;nbsp; time. For example:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ SUBMIT/AFTER="+7-"&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; This will resubmit the job exactly 7 days after the current time.&lt;BR /&gt;&amp;nbsp; The only drawback is the time the job executes will tend to drift&lt;BR /&gt;&amp;nbsp; forward, especially if you wait until the end of the procedure to&lt;BR /&gt;&amp;nbsp; resubmit the job.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; If you really want 7 days from now at 7 am, you can use some DCL to&lt;BR /&gt;&amp;nbsp; derive the absolute time string:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ day=F$CVTIME("+7-","ABSOLUTE","DATE")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ SUBMIT/AFTER="''day' 07:00"&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; or somewhat more briefly (using a combination time), you could use:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ SUBMIT/AFTER="TODAY+7-07:00"&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; The only drawback here is if your job is delayed until the next day,&lt;BR /&gt;&amp;nbsp; you'll end up getting out of synch. So, if you really must find the&lt;BR /&gt;&amp;nbsp; next Friday to execute, you can use a loop:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ NextDay="TODAY"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ DayLoop: NextDay = F$CVTIME("''NextDay'+1-","ABSOLUTE","DATE")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ Today = F$EDIT(F$CVTIME(NextDay,,"WEEKDAY"),"UPCASE,COLLAPSE")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ IF Today .NES. "FRIDAY" THEN GOTO DayLoop&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ procname = F$ENVIRONMENT("PROCEDURE")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ SUBMIT/AFTER="''nextday'+07:00" 'procname'&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; Jobs often resubmit themselves as part of the initial processing&lt;BR /&gt;&amp;nbsp; within the batch job.&amp;nbsp; The batch job can itself use lexical calls&lt;BR /&gt;&amp;nbsp; such as f$environment("PROCEDURE") to acquire the name of the&lt;BR /&gt;&amp;nbsp; currently-executing procedure, and then pass this in as part of&lt;BR /&gt;&amp;nbsp; the SUBMIT command.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; Another approach simply causes the job to resubmit itself daily at a&lt;BR /&gt;&amp;nbsp; specified time, and the job itself then decides to execute the full&lt;BR /&gt;&amp;nbsp; processing (only) if the current day of the week is (say) Thursday.&lt;BR /&gt;&amp;nbsp; (This is logically rather similar to the above-mentioned approach.)&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ procname = F$ENVIRONMENT("PROCEDURE")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ SUBMIT/AFTER="TOMORROW+07:00" 'procname'&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ Today = F$EDIT(F$CVTIME(NextDay,,"WEEKDAY"),"UPCASE,COLLAPSE")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ IF Today .NES. "FRIDAY" THEN EXIT&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; For information on specifying the date and time, please see the HELP&lt;BR /&gt;&amp;nbsp; DCL_Tips Date_Time area in recent HELP libraries, or the similar HELP&lt;BR /&gt;&amp;nbsp; Specify area in older HELP libraries.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; On the other hand, you could use one of the many scheduling products&lt;BR /&gt;&amp;nbsp; available to solve this, and many other scheduling issues.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2014 14:01:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/need-to-write-dcl-script-and-submit-in-batch-queue-on-weekly/m-p/6436312#M37313</guid>
      <dc:creator>James T Horn</dc:creator>
      <dc:date>2014-04-03T14:01:02Z</dc:date>
    </item>
  </channel>
</rss>

