Operating System - OpenVMS
1827929 Members
1712 Online
109973 Solutions
New Discussion

Capturing SYS$OUTPUT remotely

 
SOLVED
Go to solution
Mainak
Advisor

Capturing SYS$OUTPUT remotely

Hi ,

I am trying to capture the SYS$OUTPUT of a remote node using RSH command and then trying to log the output of a exe file as a part of one new DCL program –

$Rsh define/user_mode sys$output temp_file.tmp
and getting the following error –
INTERnet ACP AUXS failure Status = %CLI-W-UNDFILcheck logical name

But the command is working fine within the same node. Could you please help on this? If sys$output logical of the remote node cannot be captured remotely by RSH any suggestion how can I capture this by some other means ( using TCPIP will be the first preference).

Thanks
Mainak
8 REPLIES 8
Joseph Huber_1
Honored Contributor

Re: Capturing SYS$OUTPUT remotely


The following works (ignoring that show/output would be better :-) :

rsh node pipe define/user sys$output tmp.log ; show process

For more complicated command-sequences, put the commands preceeded by define/user sys$output into a command file, then execute it:
rsh node @tmp.com

http://www.mpp.mpg.de/~huber
Joseph Huber_1
Honored Contributor

Re: Capturing SYS$OUTPUT remotely

To add a bit explanation to why
rsh node define/user sys$output somefile
is returning this error (omitting the discussion about what sense should it make to issue such a command):

rsh on the remote node executes under a command-file TCPIP$SYSTEM:TCPIP$RSH_RUN.COM,
which executes the command, and issues as next command a WRITE SYS$OUTPUT "" .
Now try locally this sequence:
define/user sys$output somefile
write sys$output ""
and get the same error as with rsh:
%DCL-W-UNDFIL, file has not been opened by DCL - check logical name

It does not work because a define/user sys$output opens the new sys$output only for the next image invocation, but a DCL WRITE is DCL internal, not an image invocation.

The behaviour for rsh may be different for multinet or tcpware though.
http://www.mpp.mpg.de/~huber
Mainak
Advisor

Re: Capturing SYS$OUTPUT remotely

rsh node pipe define/user sys$output tmp.log ; show process - is giving :
" %DCL-W-MAXPARM, too many parameters "

rsh node pipe define/user sys$output tmp.log ;dir - is returning the same error -

" %CLI-W-UNDFILcheck logical name "
Joseph Huber_1
Honored Contributor

Re: Capturing SYS$OUTPUT remotely

In what You report here I can't see precisely what You really did: is there a space before the ";" ? if not, the ";" is not seen as the pipe delimiter, but as a part of the output filename, and the following are seen as parameters to the define command, therefore the error message.
http://www.mpp.mpg.de/~huber
Joseph Huber_1
Honored Contributor

Re: Capturing SYS$OUTPUT remotely

To summarize:

You can't do a single "define/user sys$output" command remotely (at least it is useless and the resulting error is confusing You).

You have to do at least 1 command following the define.

This can be done in 2 ways:

Put the command(s) in a (temporary) DCL command-file, then execute the command-file like "rsh @myscript/output=capture_file"

or

Use the PIPE command to chain the define/user and the command to capture:
"rsh pipe define/user sys$output capture_file ; command"

Observe the space between capture_file and the ";" following !
http://www.mpp.mpg.de/~huber
Mainak
Advisor

Re: Capturing SYS$OUTPUT remotely

Please find the small script that I am trying to run remotely using RSH -

TGHU01_SYSTEM> rsh tgdv12 @procr/output=file.tmp
$
$ !
$ ! Force any output to the standard output socket.
$ !
$ WRITE SYS$OUTPUT ""

$
$ EXIT:
TGHU01_SYSTEM> ty tgdv12::sys$manager:file.tmp
$ node = f$getsyi("nodename")
$! define/user_mode sys$output sys$manager:MCS_'node'.tmp
$! run mc$img:mcstat
$ pipe define/user sys$output sys$manager:mcs_TGDV12.tmp ; run mc$img:mcstat
$ open/read/error=oh_dear mcs sys$manager:mcs_TGDV12.tmp
$oh_dear:
$ if f$trnlnm("mcs") .nes. "" then $ close mcs
$ if f$trnlnm("mcs_output") .nes. "" then $ close mcs_output
$ write sys$output "Error in mcs files"
Error in mcs files
$!
$ EXITError in mcs files

but it is working fine on the local node -

TGDV12_SYSTEM> @procr
$ node = f$getsyi("nodename")
$! define/user_mode sys$output sys$manager:MCS_'node'.tmp
$! run mc$img:mcstat
$ pipe define/user sys$output sys$manager:mcs_TGDV12.tmp ; run mc$img:mcstat
$ open/read/error=oh_dear mcs sys$manager:mcs_TGDV12.tmp
$ read/end_of_file=oh_dear mcs record
$ read/end_of_file=oh_dear mcs record
$ read/end_of_file=oh_dear mcs record
$ read/end_of_file=oh_dear mcs record
$ read/end_of_file=oh_dear mcs record
$ mcstat = f$extract(35,8,record)
$! sh sym mcstat
$ SNS$STAT == "ISDEVL"
$ WRITE SYS$OUTPUT MCSTAT
ISDEVL
$!
$! Tidy up the temporary files
$!
$ close mcs
$ delete/NOlog/noconfirm sys$manager:mcs_TGDV12.tmp;*
$ EXIT
Joseph Huber_1
Honored Contributor
Solution

Re: Capturing SYS$OUTPUT remotely


Now we are coming nearer to the error, You see the define/user sys$output is not the problem.

Something inhibits the program to write to the file.
Does it work when running as a batch job (in a queue at the remote node) ? If You see the same problem, then I think something makes the program mc$img:mcstat failing silently when not running interactive.
http://www.mpp.mpg.de/~huber
Mainak
Advisor

Re: Capturing SYS$OUTPUT remotely

Thanks Joseph,

It was really helpful.

Mainak