| There is a program called dw_net in the examples notes file. It uses a client/
server setup over a task 0 object. Or the below com file which requires no
instalation or any special setup.
________________________________________________________________________________
$ goto top
$!
$ ! remsub.com
$ ! created to get around using DECnet 0 tasks for
$ ! corporate security reasons!
$ ! executed on your workstation
$ !Features:
$ ! 1. Uses submit/remote to keep the net police happy.
$ ! 2. Run's /detatched to free up the batch queue slot.
$ ! 3. Takes node-name, command
$ ! 4. Runs from the workstation.
$ ! modified 1/12/89 to optionally accept process_name and general cleanup
$ ! == ken miller ==
$ ! modified 3/89 to allow more defaults and cmd line input and help
$ ! modified 2/90 to make it come up on the select node on a cluster
$ ! or in the sys$batch if its the cluster name
$ !
$ !
$TOP:
$! set these to what ever defaults you want?
$ def_node = "DSTEG2" ! node if not specifid
$ def_run_opt = "VERB" ! function if not specifid
$ def_prog = "create/terminal" ! application if not specifid
$!
$!
$ ext_cnt=0 ! extra cmd parameter counter
$ ecmd1 := ! extra commands
$ run_opt := ! run option (@,MCR) for remote system
$ node := ! node to go to
$ node_access := ! combine node/password
$ password :=
$ prog := ! program to be run
$ user :=
$!
$ file_num = 0
$ func = "func" ! part of file name
$ short_func = "s_func" ! part of for proc name
$ temp_name := ! general var
$ tell = "write sys$output"
$ IF F$MODE() .EQS. "BATCH" THEN tell = "!"
$ file = "write temp"
$ run_opts = "MCR/MC/M//RUN/R/$/@/VERB/V/" ! this is whats allowed now
$ no_run_opt = "VERB/" ! no command opts needed
$ sel_opts = "NODE/PROGRAM/PROG/" ! this is whats allowed now
$ ext_opts = "SU/SETUP/</./" ! set up commands
$ parm :=
$ parm1 :=
$ x=0 ! parameter counter
$!
$NOINPUT: ! no parameters
$ if p1 .NES. "" then goto start
$ inquire p1 "Command? [""''def_run_opt'""] "
$ if p1 .eqs. "" then p1 = def_run_opt
$ inquire p2 "Application? [""''def_prog'""] "
$ if p2 .eqs. "" then p2 = def_prog
$ inquire p3 "Remote Node? [''def_node'] "
$ if p3 .eqs. "" then p3 = def_node
$ Goto start
$!
$HELP:
$ TYPE SYS$INPUT:
Remote run an object and display it on the local node.
Run Modes are as follows:
Mode1 - to select: type:
Node NODE name
Command MCR, VERB, RUN or @
Program PROG filespec
Setup commands run prior
to initial Command SETUP (or '<', '.') spec
(SETUP must be the last parameters on the cmd line)
i.e. $ RUN NODE foo PROG CMS/DECW EXT SET DEF [.DEV]
Mode2 - (@, RUN, VERB or MCR) NODE::FILESPEC < set def [.doc]
Mode3 - (@, RUN, VERB or MCR) node filespec SETUP set def [-]
Password: To use a password include it as normal with the node name except
use ""|"" around the user name and password instead of space and
quotes.
NODE|user|password|::
Note: To run a program with parameters put the command and the parameters
in quots
$ EXIT
$START:
$DO_PARM:
$ x=x+1
$ if x .GT. 8 then goto run
$ p'x' = f$edit(p'x', "UPCASE,COMPRESS,TRIM")
$ parm = p'x'
$ if parm .EQS. "" then goto run
$ if parm .eqs. "HELP" then goto help
$ IF (F$LOCATE(f$element(0," ",parm)+"/",RUN_OPTS) .NE. F$LENGTH(RUN_OPTS)) -
.OR. (F$LOCATE(f$element(0," ",parm)+"/",NO_RUN_OPT) .NE. -
F$LENGTH(NO_RUN_OPT)) THEN goto run_opt
$ IF F$LOCATE(f$element(0," ",parm)+"/",SEL_OPTS) .NE. F$LENGTH(SEL_OPTS) THEN goto 'parm
$ IF F$LOCATE(f$element(0," ",parm)+"/",EXT_OPTS) .NE. F$LENGTH(EXT_OPTS) THEN goto ext
$ gosub options
$ goto do_parm
$!
$NODE: ! get the node name
$ x=x+1
$ if x .GT. 8 then goto do_parm
$ parm = p'x'
$NODE1:
$ node = f$extract(0,f$locate(":","''parm'"),"''parm'")
$ goto do_parm
$!
$RUN_OPT: ! get the node name
$ run_opt = f$element(0," ",parm)
$ if run_opt .EQS. "V" then run_opt := VERB
$ if run_opt .EQS. "R" .OR. run_opt .EQS. "$" then run_opt := RUN
$ if (run_opt .EQS. "M") .OR. (run_opt .EQS. "MC") then run_opt := MCR
$ parm = parm - f$element(0," ",parm)
$ if F$LENGTH(parm) .NE. 0 then gosub options
$ goto do_parm
$!
$EXT: ! extra commands
$ if ext_cnt .NE. 0 then x=x+1
$ if x .GT. 8 then goto do_parm
$ parm = p'x'
$ if parm .EQS. "" then goto do_parm
$ IF F$LOCATE(f$element(0," ",parm)+"/",EXT_OPTS) .NE. F$LENGTH(EXT_OPTS)
$ THEN ext_cnt = ext_cnt+1
$ ecmd'ext_cnt' :=
$ parm = parm - f$element(0," ",parm)
$ if F$LENGTH(parm) .EQ. 0 then goto ext
$ ENDIF
$ ecmd'ext_cnt' = ecmd'ext_cnt' + parm + " "
$ goto ext
$!
$!
$PROGRAM: ! get the program name
$PROG:
$ x=x+1
$ parm = f$edit(p'x', "UPCASE,COMPRESS,TRIM")
$PROG1:
$ prog = parm
$ if f$extract(0,1,prog) .EQS. "@"
$ then run_opt = f$extract(0,1,prog)
$ prog = prog - run_opt
$ endif
$PROG2:
$ if f$locate("::","''prog'") .EQ. f$length("''prog'") then goto prog3
$ parm = prog
$ node = f$element(0,":",parm)
$ if f$locate("|","''node'") .NE. f$length("''node'")
$ then user = f$element(1,"|",node)
$ password = f$element(2,"|",node)
$ node = f$element(0,"|",node)
$ endif
$ prog = f$extract(f$locate("::","''prog'")+2,f$length("''prog'"),"''prog'")
$PROG3:
$ goto do_parm
$!
$OPTIONS:
$ if prog .EQS. "" then goto PROG1
$ if node .EQS. "" then goto node1
$ return
$
$!
$RUN:
$! set defaults
$ if prog .EQS. "" then prog = def_prog
$ if node .EQS. "" then node = def_node
$ if run_opt .EQS. "" then run_opt = def_run_opt
$ IF F$LOCATE(run_opt+"/",NO_RUN_OPT) .NE. F$LENGTH(no_run_opt) .OR. -
f$locate("/","''prog'") .NE. f$length("''prog'") then run_opt :=
$!
$ WS_node = f$extract(0,f$locate(":",f$trnlnm("SYS$NODE")),f$trnlnm("SYS$NODE"))
$ if WS_node .eqs. node
$ then local_flag = "true"
$ else local_flag = "false"
$ endif
$!
$! strip down the function and give us a name
$ func = f$edit(prog, "UPCASE,COMPRESS,TRIM")
$ func = f$extract(0,f$locate("/","''func'"),"''func'")
$ if f$locate(":","''func'") .NE. f$length("''func'") then -
func = f$extract(f$locate(":","''func'")+1,f$length("''func'"),"''func'")
$ if f$locate("]","''func'") .NE. f$length("''func'") then -
func = f$extract(f$locate("]","''func'")+1,f$length("''func'"),"''func'")
$ if f$locate("$","''func'") .NE. f$length("''func'") then -
func = f$extract(f$locate("$","''func'")+1,f$length("''func'"),"''func'")
$ if f$locate(" ","''func'") .NE. f$length("''func'") then -
func = f$extract(0,f$locate(" ","''func'"),"''func'")
$ if f$locate(".","''func'") .NE. f$length("''func'") then -
func = f$extract(0,f$locate(".","''func'"),"''func'")
$ func = f$extract(0,f$locate("_","''func'"),"''func'")
$
$ short_func = func
$LEN_CHECK:
$ if f$length(f$edit( "''WS_node'$" + "''short_func'", "COLLAPSE")) .GT. 12
$ then short_func = f$extract(1,f$length(short_func ),"''short_func'")
$ goto len_check
$ endif
$!
$!
$!
$! This is the command file that will run the requested program
$!
$!
$!
$ on warning then EXIT
$ 'tell "Connecting to ''node'"
$! dir/out=nla0: 'node::
$NAME:
$!
$ gosub rename
$ on warning then goto got_name
$ node_access = node
$ if user .NES. "" then node_access = "''node'""''user' ''password'"""
$ dir/out=nla0: 'node_access::'WS_node'_'func'.com
$CNG_NAME:
$ goto NAME
$GOT_NAME:
$!
$ 'tell "Creating a command file on ''node' with"
$ x=0
$TELL_CMD:
$ if ext_cnt .NE. x
$ then
$ x=x+1
$ ecmd'x' = f$edit(ecmd'x', "COMPRESS,TRIM")
$ parm = ecmd'x'
$ 'tell " ""$''parm'"" "
$ goto tell_cmd
$ ENDIF
$ 'tell " ""$''run_opt' ''prog'"" displayed on ''WS_node' "
$!
$!
$! This is the batch file that will create the process and run the command
$!
$!
$ 'tell "Creating Batch File "
$
$ on ERROR then EXIT
$ if local_flag .nes. "true"
$ then open/write temp 'node_access::'WS_node'_'func'.com
$ else open/write temp sys$login:'WS_node'_'func'.com
$ endif
$ 'file "$ define sys$print nl:"
$! replaced with the following for cluster access by tim Paxton
$ 'file "$ if f$trnlnm("""sys$node""") .nes. ""''node'::"" "
$ 'file "$ then"
$ 'file "$ x = f$getqui(""DISPLAY_QUEUE"",""QUEUE_GENERIC"",""''node'$batch"") "
$ 'file "$ if x .NES."""" "
$ 'file "$ then submit/noprint/notify/que=''node'$batch ''WS_node'_''func'.com"
$ 'file "$ exit"
$ 'file "$ endif"
$ 'file "$ endif"
$! end of added
$ 'file "$ IF F$MODE() .NES. """BATCH""" THEN goto pass_2"
$ 'file "$ proc_num = 0"
$ 'file "$ user = F$EDIT(f$getjpi(0,""USERNAME""),""COLLAPSE"") "
$ 'file "$ proc_name = ""''WS_node'$"" + ""''short_func'"""
$!
$ 'file "$CHECK: "
$ 'file "$ save_pname = proc_name"
$ 'file "$ on warning then goto cont"
$ 'file "$ sho proc/nooutput 'proc_name "
$ 'file "$ gosub rename "
$ 'file "$ goto check "
$!
$ 'file "$CONT:"
$ 'file "$ on warning then proc_name = user "
$ 'file "$ sho proc/nooutput 'user "
$ 'file "$ on warning then goto try_again"
$!
$ 'file "$CONT1:"
$ 'file "$ set verify"
$ 'file "$ run/detached sys$system:loginout.exe -"
$ 'file " /input=''WS_node'_''func'.com -"
$ 'file " /error=''WS_node'_''func'.log -"
$ 'file " /output=''WS_node'_''func'.log -"
$ 'file " /proc='proc_name - "
$ 'file " /AUTHORIZE - "
$ 'file " /buffer_limit=30000/enqueue_limit=800/extent=10000 -"
$ 'file " /io_buffered=100/io_direct=100/maximum_working_set=2048 -"
$ 'file " /page_file=30000/authorize/file_limit=64/working_set=512"
$ 'file "$ exit"
$!
$ 'file "$TRY_AGAIN:"
$ 'file "$ on warning then goto end"
$ 'file "$ proc_name = save_pname"
$ 'file "$ goto cont1"
$!
$ 'file "$rename: "
$ 'file "$ proc_num = proc_num + 1 "
$ 'file "$ proc_name = f$extract(0,f$locate(""_"",proc_name),proc_name) + ""_"" + f$string(proc_num)
$ 'file "$ return "
$!
$ 'file "$PASS_2:
$ 'file "$ SET VER
$ if local_flag .nes. "true"
$ then
$ 'file "$ set display/create/node=''WS_node'"
$ else 'file "$ set display/create/transport=local"
$ endif
$ 'file "$ on warning then goto end"
$ x=0
$EXT_CMDS:
$ if ext_cnt .NE. x
$ then
$ x=x+1
$ parm = ecmd'x'
$ 'file "$ ''parm'"
$ goto ext_cmds
$ ENDIF
$ 'file "$ ''run_opt' ''prog'"
$!
$ 'file "$ END:"
$ 'file "$ on warning then CONTINUE"
$ 'file "$! purge ''WS_node'_''func'.log, ''WS_node'_''func'.com"
$ 'file "$ set display/noperm "
$!
$ close temp
$!
$ 'tell "Submitting Batch Command File..."
$ if local_flag .nes. "true"
$ then submit/remote/nonotify/noprint 'node_access::'WS_node'_'func'.com
$ else submit/notify/noprint sys$login:'WS_node'_'func'.com
$ endif
$ EXIT
$!
$rename:
$! if f$locate("_",func) .EQ.f$length(func) then
$ file_num = file_num + 1
$ func = f$extract(0,f$locate("_",func),func) + "_" + f$string(file_num)
$ return
|