Operating System - OpenVMS
1753797 Members
7067 Online
108799 Solutions
New Discussion юеВ

Re: How to control execution time of DCL commands

 
SOLVED
Go to solution
Robert Gezelter
Honored Contributor

Re: How to control execution time of DCL commands

Vijay,

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
Martin Vorlaender
Honored Contributor

Re: How to control execution time of DCL commands

Re: What is FEXIT?

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
Hoff
Honored Contributor

Re: How to control execution time of DCL commands

Not exiting on a timeout is either a bug in your procedure, or a bug in the ftp tool. If you're not using COPY /FTP, start there. The classic FTP utility interface is somewhat more difficult to script than is COPY /FTP.

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 );
Jess Goodman
Esteemed Contributor

Re: How to control execution time of DCL commands

Yes. "FEXIT" should be replaced with "STOP/IMAGE". Sorry about that, I didn't notice that. As Martin guessed FEXIT was our own implementation of STOP/IMAGE which was required before VMS 7.3.
I have one, but it's personal.
John Gillings
Honored Contributor

Re: How to control execution time of DCL commands

re: Bob:

>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.
A crucible of informative mistakes
Wim Van den Wyngaert
Honored Contributor

Re: How to control execution time of DCL commands

No f$uniq on my 7.3.

Wim
Wim
labadie_1
Honored Contributor

Re: How to control execution time of DCL commands

Wim

Let's say Vms 7.3-2 :-)