- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Running a VMS batch job three times a day
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2005 09:49 PM
12-13-2005 09:49 PM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2005 10:32 PM
12-13-2005 10:32 PM
Re: Running a VMS batch job three times a day
! BRAD_ONCALL.COM - Schedule to change value of ONCALL for WATCHDOG
! notifications.
! BJH/JNZ - 07-AUG-2003
!
$!
$ weekday=f$cvtime("today",,"Weekday")
$ time=f$cvtime("","absolute","time")
$!
$ if time .gts. "00:00:00.00" .and. time .lts. "07:00:00.00"
$ then
$ define/sys oncall "@sys$manager:notify_brad.dis"
$ define/table=rampage$logicals oncall "@sys$rampage:notify_brad.dis"
$ submit/nolog/restart/after=07:00 brad_oncall.com
$ exit
$!
$ else
$ if time .gts. "07:00:00.00" .and. time .lts. "17:00:00.00"
$ then
$ define/sys oncall "@sys$manager:notify_day.dis"
$ define/table=rampage$logicals oncall "@sys$rampage:notify_day.dis"
$ submit/nolog/restart/after=17:00 brad_oncall.com
$ exit
$!
$ else
$ if weekday .eqs. "Friday"
$ then
$ submit/nolog/restart/after="tod+3-07:00" brad_oncall.com
$ define/sys oncall "@sys$manager:notify_brad.dis"
$ define/table=rampage$logicals oncall "@sys$rampage:notify_brad.dis"
$ else
$ if weekday .eqs. "Monday"
$ then
$ submit/nolog/restart/after="tod+8-07:00" brad_oncall.com
$ define/sys oncall "@sys$manager:notify_brad.dis"
$ define/table=rampage$logicals oncall "@sys$rampage:notify_brad.dis"
$ else
$ submit/nolog/restart/after="tod+1-07:00" brad_oncall.com
$ define/sys oncall "@sys$manager:notify_brad.dis"
$ define/table=rampage$logicals oncall "@sys$rampage:notify_brad.dis"
$ endif
$!
$ endif
$!
$ endif
$!
$ exit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2005 11:21 PM
12-13-2005 11:21 PM
SolutionYour specific case can be done shortly:
$ time=f$cvtime("","absolute","time")
$ after=""
$ if time.lts."23:30:00.00" then after="TODAY+23:30"
$ if time.lts."16:30:00.00" then after="TODAY+16:30"
$ if time.lts."09:30:00.00" then after="TODAY+09:30"
$ if after.eqs."" then after="TOMORROW+09:30"
$ submit/after="''after'" thisfile
The 3rd time comparison can be omitted if You submit the job at 9:30 the first time.
For general scheduling without rewriting every single command-file, look for "cron" implementations for VMS earlier in this forum.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2005 07:23 PM
12-14-2005 07:23 PM
Re: Running a VMS batch job three times a day
$!
$! Submit myself again for the next time
$!
$ CALL SUBMITJOB "09:30,16:30,22:30" MYJOBNAME THISJOB.COM SYS$BATCH
$!
$!
$! Do your stuff
$!
$ EXIT
$!
$!============================================================
$ SUBMITJOB:
$ SUBROUTINE
$! Subroutine te reschedule the job at the next time in the schedule.
$! The schedule is given in P1 as a comma seperated list of times
$!
$ COUNT = 0
$! Look for the next time in P1 after the current time.
$ PARAMLOOP:
$ P1 = F$EDIT(P1,"COLLAPSE")
$ NEXT_TIME = F$ELEMENT(COUNT, ",", P1)
$ IF NEXT_TIME .EQS. "," THEN GOTO NEXT_DAY
$ NEXT_TIME_COMP = F$CVTIME(NEXT_TIME)
$ NOW = F$CVTIME()
$ IF NEXT_TIME_COMP .LES. NOW
$ THEN
$ COUNT = COUNT + 1
$ GOTO PARAMLOOP
$ ENDIF
$ GOTO SUBMIT_IT
$!
$ NEXT_DAY:
$! Last time in P1, so another day has gone. So use first time next day.
$ NEXT_TIME = "TOMORROW + ''F$ELEMENT(0,",",P1)'"
$!
$ SUBMIT_IT:
$ SUBMIT/NOTIFY/NOPRINT/RESTART/LOG=CRIS$LOG:'P2'.LOG -
/AFTER="''F$CVTIME(NEXT_TIME, "ABSOLUTE")'" -
/QUEUE='P4' -
'P3'
$ EXIT
$ ENDSUBROUTINE
Have fun,
Hans
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2005 10:10 PM
12-14-2005 10:10 PM