HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: --com file --
Operating System - OpenVMS
1828767
Members
2407
Online
109985
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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-21-2006 07:54 PM
12-21-2006 07:54 PM
pls. send me com file by which i a batch job automatically run every day in a week at 1:00 hrs
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2006 08:04 PM
12-21-2006 08:04 PM
Solution
Hi mrityunioy
Hope the following code helps
$ sav_ver=F$VERIFY(0)
$ debug=0
$ IF F$TRNLNM("command_debug") THEN debug=1
$ IF debug THEN SET VERIFY
$! ----------------------------------------------------------------------------------------------
$! Title: Resubmit.com
$! Author: Heinz Genhart
$! Creation Date: 11-SEP-1995
$! Modification Date: .
$!
$! Description: This Commandfile is a framework for submitting a periodical Job
$! .
$! ----------------------------------------------------------------------------------------------
$ ON CONTROL_Y THEN GOTO clean_up
$ ON WARNING THEN GOTO clean_up
$ sts=1
$ sav_def=F$ENVIRONMENT("DEFAULT")
$ sav_mes=F$ENVIRONMENT("MESSAGE")
$ this_user=F$GETJPI("","USERNAME")
$ this_node=F$GETSYI("NODENAME")
$ this_proc=F$ENVIRONMENT("PROCEDURE")
$ mode=F$MODE()
$! ----------------------------------------------------------------------------------------------
$ SET NOON
$! ----------------------------------------------------------------------------------------------
$ job_name = "''F$PARSE(F$ENVIRONMENT("PROCEDURE"),,,"NAME")'" ! Name of Job
$ WRITE SYS$OUTPUT job_name
$ que_name = "SYS$BATCH" ! Name of Queue
$ interval = "+06:00:00.00" ! every 6 hours
$ interval = "TOMORROW+01:00:00.00" ! Ã very morning at 01:00
$! ----------------------------------------------------------------------------------------------
$!
$!
$! Delete Job if it already exists
$!
$ temp = F$GETQUI("")
$ this_entry = F$GETQUI("DISPLAY_JOB","ENTRY_NUMBER",,"THIS_JOB")
$ temp = F$GETQUI("")
$qloop:
$ qname = F$GETQUI("DISPLAY_QUEUE","QUEUE_NAME","*")
$ IF qname .EQS. "" THEN GOTO clean
$jloop:
$ noaccess = F$GETQUI("DISPLAY_JOB","JOB_INACCESSIBLE",,"ALL_JOBS")
$ IF noaccess .EQS. "TRUE" THEN GOTO jloop
$ IF noaccess .EQS. "" THEN GOTO qloop
$ jname = F$GETQUI("DISPLAY_JOB","JOB_NAME",,"FREEZE_CONTEXT,ALL_JOBS")
$ IF jname .EQS. "''job_name'"
$ THEN
$ entry = F$GETQUI("DISPLAY_JOB","ENTRY_NUMBER",,"FREEZE_CONTEXT,ALL_JOBS")
$ IF entry .NE. this_entry THEN DELETE/ENTRY='entry'
$ ENDIF
$ GOTO jloop
$clean:
$!
$! Then Submit the Job
$!
$ SUBMIT/NOLOG/NOPRINT/QUEUE='que_name'/NAME="''job_name'"/AFTER="''interval'" 'this_proc'
$!
$!
$! ----------------------------------------------------------------------------------------------
$!
$! #### Do here, what you want to do #####
$!
$! ----------------------------------------------------------------------------------------------
$clean_up:
$ SET DEFAULT 'sav_def'
$ SET MESSAGE 'sav_mes'
$ sav_ver=F$VERIFY(sav_ver)
$ EXIT 'sts'
Regards
Heinz
Hope the following code helps
$ sav_ver=F$VERIFY(0)
$ debug=0
$ IF F$TRNLNM("command_debug") THEN debug=1
$ IF debug THEN SET VERIFY
$! ----------------------------------------------------------------------------------------------
$! Title: Resubmit.com
$! Author: Heinz Genhart
$! Creation Date: 11-SEP-1995
$! Modification Date: .
$!
$! Description: This Commandfile is a framework for submitting a periodical Job
$! .
$! ----------------------------------------------------------------------------------------------
$ ON CONTROL_Y THEN GOTO clean_up
$ ON WARNING THEN GOTO clean_up
$ sts=1
$ sav_def=F$ENVIRONMENT("DEFAULT")
$ sav_mes=F$ENVIRONMENT("MESSAGE")
$ this_user=F$GETJPI("","USERNAME")
$ this_node=F$GETSYI("NODENAME")
$ this_proc=F$ENVIRONMENT("PROCEDURE")
$ mode=F$MODE()
$! ----------------------------------------------------------------------------------------------
$ SET NOON
$! ----------------------------------------------------------------------------------------------
$ job_name = "''F$PARSE(F$ENVIRONMENT("PROCEDURE"),,,"NAME")'" ! Name of Job
$ WRITE SYS$OUTPUT job_name
$ que_name = "SYS$BATCH" ! Name of Queue
$ interval = "+06:00:00.00" ! every 6 hours
$ interval = "TOMORROW+01:00:00.00" ! Ã very morning at 01:00
$! ----------------------------------------------------------------------------------------------
$!
$!
$! Delete Job if it already exists
$!
$ temp = F$GETQUI("")
$ this_entry = F$GETQUI("DISPLAY_JOB","ENTRY_NUMBER",,"THIS_JOB")
$ temp = F$GETQUI("")
$qloop:
$ qname = F$GETQUI("DISPLAY_QUEUE","QUEUE_NAME","*")
$ IF qname .EQS. "" THEN GOTO clean
$jloop:
$ noaccess = F$GETQUI("DISPLAY_JOB","JOB_INACCESSIBLE",,"ALL_JOBS")
$ IF noaccess .EQS. "TRUE" THEN GOTO jloop
$ IF noaccess .EQS. "" THEN GOTO qloop
$ jname = F$GETQUI("DISPLAY_JOB","JOB_NAME",,"FREEZE_CONTEXT,ALL_JOBS")
$ IF jname .EQS. "''job_name'"
$ THEN
$ entry = F$GETQUI("DISPLAY_JOB","ENTRY_NUMBER",,"FREEZE_CONTEXT,ALL_JOBS")
$ IF entry .NE. this_entry THEN DELETE/ENTRY='entry'
$ ENDIF
$ GOTO jloop
$clean:
$!
$! Then Submit the Job
$!
$ SUBMIT/NOLOG/NOPRINT/QUEUE='que_name'/NAME="''job_name'"/AFTER="''interval'" 'this_proc'
$!
$!
$! ----------------------------------------------------------------------------------------------
$!
$! #### Do here, what you want to do #####
$!
$! ----------------------------------------------------------------------------------------------
$clean_up:
$ SET DEFAULT 'sav_def'
$ SET MESSAGE 'sav_mes'
$ sav_ver=F$VERIFY(sav_ver)
$ EXIT 'sts'
Regards
Heinz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2006 02:06 AM
12-22-2006 02:06 AM
Re: --com file --
'every day in a week' for me is the same a 'every day'. Best I know there are no days outside a week.
Did you mean every day?
Did you mean 'every day for this week'?
Did you mean 'every work day in this week' ?
What is a work day in your locale?
If you happen to mean every day excluding Saturday and Sunday, then you can try the simple example below. It is easily changed to 'every day' by dropping the lines testing for a day starting with "S" in the (English) name (In the Netherlands test for "Z", for other places.. oh well).
Be sure to check the nice, robust, code Heinz already posted. Try to understand it, and you may find that you really should put all the checks in place.
But if you just need a quick hack, try...
$this_file = f$environment("PROCEDURE")
$file = f$element(0,";",this_file) ! Drop specific version
$next = f$cvtim("tomorrow + 1:0:0","ABSOLUTE")
$if "S".eqs.f$ext(0,1,f$cvtime(next,,"WEEKDAY")) then next = f$cvtime(next + " +1-","ABSOLUTE")
$if "S".eqs.f$ext(0,1,f$cvtime(next,,"WEEKDAY")) then next = f$cvtime(next + " +1-","ABSOLUTE")
$submit/after="''next'" 'file ! Resubmit to default queue
$
$! Work starts here
$ show time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2006 09:22 AM
12-26-2006 09:22 AM
Re: --com file --
Hein,
>$this_file = f$environment("PROCEDURE")
>$file = f$element(0,";",this_file) ! Drop specific version
I've done it for years that way, but just recently realised it could be done "properly" like this:
$ this_file= F$PARSE(";",F$ENVIRONMENT("PROCEDURE"))
For a daily job that varies according to the weekends, I prefer this construct:
$ ! Resubmit for next day regardless
$ SUBMIT/AFTER="TOMORROW+0-1:0" F$PARSE(";",F$ENVIRONMENT("PROCEDURE"))
$ !
$ ! Commands to execute every day here
$ !
$ ! Dispatch to per-day
$ GOTO 'F$CVTIME(,,"WEEKDAY")
$
$ Saturday:
$ Sunday:
$ !
$ ! Commands to execute on weekend here
$ !
$ EXIT
$
$ Monday:
$ Tuesday:
$ Wednesday:
$ Thursday:
$ Friday:
$ !
$ ! Commands to execute on weekdays here
$ !
$ EXIT
Very easy to modify for specific things to be done on a particular weekday, and very obvious how it works.
(Hein's "S" tests are very clever, but it takes a minute or so to work out what it's doing and how it works).
>$this_file = f$environment("PROCEDURE")
>$file = f$element(0,";",this_file) ! Drop specific version
I've done it for years that way, but just recently realised it could be done "properly" like this:
$ this_file= F$PARSE(";",F$ENVIRONMENT("PROCEDURE"))
For a daily job that varies according to the weekends, I prefer this construct:
$ ! Resubmit for next day regardless
$ SUBMIT/AFTER="TOMORROW+0-1:0" F$PARSE(";",F$ENVIRONMENT("PROCEDURE"))
$ !
$ ! Commands to execute every day here
$ !
$ ! Dispatch to per-day
$ GOTO 'F$CVTIME(,,"WEEKDAY")
$
$ Saturday:
$ Sunday:
$ !
$ ! Commands to execute on weekend here
$ !
$ EXIT
$
$ Monday:
$ Tuesday:
$ Wednesday:
$ Thursday:
$ Friday:
$ !
$ ! Commands to execute on weekdays here
$ !
$ EXIT
Very easy to modify for specific things to be done on a particular weekday, and very obvious how it works.
(Hein's "S" tests are very clever, but it takes a minute or so to work out what it's doing and how it works).
A crucible of informative mistakes
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP