[Info-vax] how to write openvms commands in .sh file through openvms
George Cornelius
cornelius at encompasserve.org
Mon Apr 1 11:03:03 EDT 2013
Johnny Billquist wrote:
> Sure. You can submit batchjobs on remote DECnet machines.
> I don't remember the syntax under VMS, but under RSX you basically do:
>
> NFT node::filename/SB (MCR)
> SUB node::filename/REMOTE (DCL)
>
> Note that the filename needs to be on the remote machine. If you want to
> submit a batch job where the file is on you local machine, you should
> transfer the file first, and then submit it on the remote machine.
>
> As for doing it from Unix, I guess that depends on whether you Unix
> system have DECnet.
Suppose spool_lpc.com creates pseudodevice (P2) and assigns
print or batch queue (P1) to it (sample version supplied
below). You then do this on the vms node:
$ @mgr:spool_lpc sys$batch lpf7: ! Needs cmk,syslck
Then on your non-vms node you just drop your batch file onto
lpf7: via ftp.
Here's a test (using autologin via .netrc into a guest
account but ordinary ftp sessions work the same):
xxusr at gfc28:~$ # Create and send batch_temp.com to xxsrvc
xxusr at gfc28:~$ cat >batch_temp.com
$ ! batch_temp.com gfc 20130401 Test
$ if f$mode().nes."BATCH" then exit 4
$ copy nla0: junk_file.tmp
$ logout/full
^D
xxusr at gfc28:~$ echo "put batch_temp.com lpf7:"|ftp xxsrvc
Of course, this is not really linux specific. Anything that
has an ftp client should work.
Note that spool_lpc was developed for print queues but
happens to work fine for batch queues as well.
George
----------------------
Slightly simplified spool_lpc . If desired strip
down even further to just the $ MCR SYSMAN and $ SET
DEVICE/SPOOLED commands.
[BEGIN example]
$ dev=P2
$ queue=P1
$ spool_device:=sys$sysdevice:
$ if .not.f$getdvi(dev,"EXISTS")
$ then
$ if f$getsyi("ARCH_NAME").eqs."VAX"
$ then
$ mcr sysgen connect 'dev'/NOADAPTER/DRIVER=TTDRIVER
$ st=$status
$ else
$ mcr sysman io connect 'dev'/NOADAPTER/DRIVER=SYS$TTDRIVER
$ st=$status
$ endif
$ if .not.st then goto exii_final ! Exit if could not create device
$ endif
$ x:=FALSE ! Just in case next command fails to work..
$ x = f$getdvi(dev,"SPLDEVNAM").nes.""
$ if x
$ then
$ set device 'dev'/nospooled ! Despool device if already spooled
$ allocate 'dev' ! Workaround as per DSNLINK - avoid device being
$ deallocate 'dev' ! owned forever by nonexistend process
$ endif
$ set device 'dev'/spooled=('queue','spool_device')
[END example]
More information about the Info-vax
mailing list