- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- How to control execution time of DCL commands
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
09-11-2008 10:08 PM
09-11-2008 10:08 PM
I am using Open VMS version 7.3-2.
I have a problem executing a command procedure with FTP commands in it. Sometimes the FTP command does not exit due to slow connections. In such a case a manual CTRL+Y needs to be done but instead i want to abort and continue with the remaining execution automatically. How can i run the command procedure for certain duration of time so that it terminates irrespective of whether the FTP commands have been executed or not?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2008 10:19 PM
09-11-2008 10:19 PM
Re: How to control execution time of DCL commands
regards Kalle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2008 12:13 AM
09-12-2008 12:13 AM
Re: How to control execution time of DCL commands
Thanks a lot for your suggestion. I'll try it out.
Regards,
VIjay.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2008 01:43 AM
09-12-2008 01:43 AM
Re: How to control execution time of DCL commands
Another alternative is to use the batch queues, although there is no guarantee that the job starts immediately (the queue may be busy or stopped).
In either case, be very careful that it is possible to tell the difference between a completed and uncompleted task. It is all too easy to find that ftp has transferred less than a complete file, and have later stages of the application become confused by processing a truncated file.
- Bob Gezelter, http://www.rlgsc.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2008 01:52 AM
09-12-2008 01:52 AM
Re: How to control execution time of DCL commands
Thanks a lot for the reply. Will try to implement.
I have another question. Can the same command procedure be invoked simultaneously by different processes passing different parameters (like FTP address and file names) ? something like multithreading..In such a case where each request to that command procedure is processed seperately (and simultaneously) using NOWAIT will be easier..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2008 01:56 AM
09-12-2008 01:56 AM
Re: How to control execution time of DCL commands
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2008 04:41 AM
09-12-2008 04:41 AM
Re: How to control execution time of DCL commands
> invoked simultaneously by different
> processes [...]
Normally, yes (unless your command procedure
does something inappropriate, like, say, use
a fixed name for a temporary file).
> [...] something like multithreading [...]
More like multiprocessing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2008 08:08 AM
09-12-2008 08:08 AM
Re: How to control execution time of DCL commands
$ PID = F$GETJPI(0,PID)
$ SPAWN /PROCESS=SUB_'PID' -
@PROCESS_WATCHER 'PID' 00:05:00
$ COPY/FTP ...
$ STATUS = $STATUS
$ STOP SUB_'PID'
$ IF (.NOT.STATUS) THEN ...
$!----------PROCESS_WATCHER.COM--------
$ SET NOON
$ WATCHED_PID := 'P1' !Pass process ID in as P1
$ IF (WATCHED_PID .EQS. "") THEN WATCHED_PID = F$GETJPI(0,"MASTER_PID")
$ P2 = P2-"+" !Pass max wait time in as P2 w or w/o +
$ IF (P2 .EQS. "") THEN P2 = "00:02:00"
$ END_CTIME = F$CVTIME("+''P2'")
$ IF (.NOT.$STATUS) THEN END_CTIME = F$CVTIME("+00:02:00")
$ INTERVAL := 'P3' !Interval between checking for new I/O
$ IF (INTERVAL .EQS. "") THEN INTERNVAL := 00:00:30
$!----------------
$! PRIME DATA
$!-----------
$ CURBIO = F$GETJPI(WATCHED_PID,"BUFIO")
$ IF (.NOT.$STATUS) THEN EXIT
$ CURDIO = F$GETJPI(WATCHED_PID,"DIRIO")
$LOOP:
$ LASTBIO = CURBIO
$ LASTDIO = CURDIO
$ WAIT 'INTERVAL'
$!--------------------
$! CHECK CURRENT INFO
$!--------------------
$ CURDIO = F$GETJPI(WATCHED_PID,"DIRIO")
$ CURBIO = F$GETJPI(WATCHED_PID,"BUFIO")
$ DIO = CURDIO - LASTDIO
$ BIO = CURBIO - LASTBIO
$! If no I/O occured or if this has been going on too long kill our master.
$ IF ( (DIO.GT.0 .OR. BIO.GT.0) .AND. -
F$CVTIME() .LTS. END_CTIME ) THEN GOTO LOOP
$ FEXIT /ID='WATCHED_PID'
$ EXIT
$! this process is spawned from a command procedure that
$! is doing an inline COPY/FTP or another FTP process.
$! it could be any process really.
$! it will wait the time in P2 and FEXIT the process ID in P1
$! passed in as p2 if wait time is reached or no I/O in any P3 interval.
$!----------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2008 09:52 PM
09-14-2008 09:52 PM
Re: How to control execution time of DCL commands
I have tried out your solution. Actually am new to DCL coding.
I'm getting the following error after executing the above command procedure.
$ FEXIT /ID=00036D43
%DCL-W-IVVERB, unrecognized command verb - check validity and spelling
\FEXIT\
Thanks in advance for the help.
Regards,
Vijay.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2008 12:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2008 12:28 AM
09-15-2008 12:28 AM
Re: How to control execution time of DCL commands
As I believe Steve has already commented, the answer is that multiple processes (and as a result, batch jobs) can execute the same command file simultaneously. This presumes that the command file does not use a fixed, fully qualified filename in a way that precludes simultaneous execution.
If a command procedure uses a temporary file TEMPORARY.TMP, then two sessions on the same account will be trying to use the same file. A solution to this is to dynamically create file names using the F$GETJPI lexical function an the PID argument.
The same is true for logical names outside of the process-context.
- Bob Gezelter, http://www.rlgsc.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2008 02:07 AM
09-15-2008 02:07 AM
Re: How to control execution time of DCL commands
I'd think it's a Forced Exit - so it'd be a STOP/IMAGE - rather than a DELPRC, a STOP.
Since STOP/IMAGE wasn't implemented for a long time (pre 7.3-2?), everyone had his own image that called $FORCEX.
$FORCEX would be the right choice IMHO, since the intent is to kill the blocking image runningin the master process, rather than the master process itself.
cu,
Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2008 06:41 AM
09-15-2008 06:41 AM
Re: How to control execution time of DCL commands
I don't remember off-hand if COPY /FTP has a qualifier with a timeout specifier; that would be a reasonable enhancement, if not.
Is OpenVMS a prerequisite here or are add-ons permissible? There are hosts that deal with this sort of file transfer operation better (either with built-in tools or with some widely-available add-on software) and that can run parallel and partial-restart ftp transfers. (I'd expect Perl or another existing library has some options here, too. LWP::UserAgent and Net::FTP from libnet come to mind.) Here's a libnet set-up for ftp with a 100 second timeout specified.
use Net::FTP;
my $ftp = new Net::FTP( hostname, Timeout => 100 );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2008 07:59 AM
09-16-2008 07:59 AM
Re: How to control execution time of DCL commands
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2008 05:16 PM
09-22-2008 05:16 PM
Re: How to control execution time of DCL commands
>If a command procedure uses a temporary
>file TEMPORARY.TMP, then two sessions on
>the same account will be trying to use the
>same file. A solution to this is to
>dynamically create file names using the
>F$GETJPI lexical function an the PID
>argument.
Even better, if you're V7.3 or higher, use F$UNIQUE.
$ myfile=F$PARSE(F$UNIQUE(), "SYS$SCRATCH:.TMP;")
Even better than that is to use PIPE and avoid temporary files altogether.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2008 12:43 AM
09-23-2008 12:43 AM
Re: How to control execution time of DCL commands
Wim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2008 01:20 AM
09-23-2008 01:20 AM
Re: How to control execution time of DCL commands
Let's say Vms 7.3-2 :-)