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