- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Script problem for automatic execution
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
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
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
тАО02-01-2009 03:01 AM
тАО02-01-2009 03:01 AM
Script problem for automatic execution
i am new to openVMS and i want to build a copy.com file to execute every half hour. I have tried as below
$ THIS=F$ENVIRONMENT("PROCEDURE")
$ THIS=THIS-F$PARSE(THIS,,,"VERSION")
$ QNAME=F$GETQUI("DISPLAY_QUEUE","QUEUE_NAME","*","THIS_JOB")
$ SHOW SYM QNAME
$ SUBMIT 'THIS'/QUE='QNAME'/AFTER=("F$TIME()'+00:30")
$ NEXT_NOW=F$CVTIME("","ABSOLUTE")
$ SHOW SYMBOL NEXT_NOW
! copy.com commands
!
Output:
QNAME = ""
%DCL-W-VALREQ, missing qualifier or keyword value - supply all required values
NEXT_NOW = "29-JAN-2009 10:10:57.78"
Here the mode is interactive (i.e. by F$MODE)
i know that i have to run this script in batch mode but how to run it in batch mode that i dont know or some thing i am forgot to execute..Please guide me
Here queue is also not created when submitting directly in prompt directly By submit command.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-01-2009 05:21 AM
тАО02-01-2009 05:21 AM
Re: Script problem for automatic execution
(Good google skills and/or excellent learning skills :-)
If you run this script online, as @script_name, then there is no job, and thus no quename. So instead of running it with @, just submit it manually a first time, on te target queue: $SUBM/QUE=some_queue_name script_name
Alternatively, do some defensive coding.
After the QNAME=F$GETQUI... the srcipt SHOULD test for a return value. If empty it can choose to bail out, or provide an alternative. So either
$IF qname .EQS. "" THEN qname = "some_queue_name"
Or...
$IF qname .EQS. "" THEN GOTO no_queue
:
:
$no_queue:
$WRITE SYS$OUTPUT "Could not get QUEUE NAME, Please submit on desired queue"
$EXIT 16
Enjoy,
Hein
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-01-2009 05:40 AM
тАО02-01-2009 05:40 AM
Re: Script problem for automatic execution
> dont know [...]
"HELP SUBMIT"? Do what's in the procedure,
but without the "/AFTER=xxx"?
> $ THIS=THIS-F$PARSE(THIS,,,"VERSION")
I might do:
this = f$parse( ";", this, , , "SYNTAX_ONLY")
> $ SUBMIT 'THIS'/QUE='QNAME'/AFTER=("F$TIME()'+00:30")
> $ NEXT_NOW=F$CVTIME("","ABSOLUTE")
Were you trying to do something like this?
NEXT_NOW = F$CVTIME( "''F$TIME()'+00:30", "ABSOLUTE")
SUBMIT 'THIS' /QUE = 'QNAME' AFTER = "''NEXT_NOW'"
Are you writing this procedure fresh, or are
you trying to modify an existing procedure?
A Forum search for keywords like
batch resubmit
should find many old examples.
> Here queue is also not created when
> submitting directly in prompt directly By
> submit command.
SUBMIT does not create a queue, it submits a
job to a queue.
We can't see your "submit command", so it's
hard to say much about it. Showing actual
commands with their actual output can be more
helpful than a vague description.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-01-2009 05:48 AM
тАО02-01-2009 05:48 AM
Re: Script problem for automatic execution
The DCL command SET VERIFY is your friend here when you're trying to figure out why some local DCL logic has gone weird.
Typical DCL debugging is comparatively primitive and "bread-crumb" style debugging, using WRITE SYS$OUTPUT and SET VERIFY (or f$verify()) to diagnose and debug.
As for the root goal, your approach will work, but I'd suggest looking at Kronos or other package; there's a Kronos update around, and there are other scheduling packages for OpenVMS such as cron. And there are various commercial packages. The downfall of your approach (and most of us use or have used your approach at one time or another; I have) is around error processing and error handling. When the jobs go weird or the queues go weird or the node crashes while active, or...
Links to Kronos and cron tools for OpenVMS and related are here:
http://64.223.189.234/node/97
And guessing at what you're using COPY for here, here's an approach that is ancient and effective, but little-known:
http://64.223.189.234/node/136
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-01-2009 08:59 AM
тАО02-01-2009 08:59 AM
Re: Script problem for automatic execution
http://www.computing.net/answers/openvms/how-to-run-script-at-30-min-automat/556.html
?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-01-2009 02:04 PM
тАО02-01-2009 02:04 PM
Re: Script problem for automatic execution
(some more DCL coding opinions...)
$ THIS=F$ENVIRONMENT("PROCEDURE")
$ THIS=THIS-F$PARSE(THIS,,,"VERSION")
Here's a neater way to get the same result:
$ THIS=F$PARSE(";",F$ENVIRONMENT("PROCEDURE"))
This is arguably "more correct" as all the parsing and manipulation is being done by RMS. There may be pathological ODS-5 file specifications that may not work correctly with the string subtraction.
$ QNAME=F$GETQUI("DISPLAY_QUEUE","QUEUE_NAME","*","THIS_JOB")
Although it probably doesn't make much difference, I tend to leave out the "*". I worry about GETQUI wildcard context.
$ QNAME=F$GETQUI("DISPLAY_QUEUE","QUEUE_NAME",,"THIS_JOB")
The problem here is QNAME will be blank if this procedure is executed in any mode other than batch. You then need to decide which queue you want in that situation. If you want to specify a default queue, something like:
$ IF QNAME.EQS."" THEN QNAME="defaultname"
$ SUBMIT/QUEUE='QNAME' ...
or you could just take the process default
$ IF QNAME.NES."" THEN QNAME="/QUEUE="+QNAME
$ SUBMIT 'qname' ...
For the time, you can use:
/AFTER="''F$CVTIME("+0:30","ABSOLUTE")'"