On 2013-01-17 13:17, Brian Schenkenberger, VAXman- wrote:
sampsa at
mac.com writes:
How come writing to SYS$NET doesn't send any output?
FOOBAR.COM is now:
$WRITE SYS$NET "Foobar"
$DIRECTORY/OUTPUT=SYS$NET
But I only get the directory listing.
Before you can WRITE to any device, and SYS$NET is, in essence here, a
device, you must first OPEN a channel to it. In DCL, the OPEN command
will create the channel and assign the channel to a logical name which
can subsequently be used in the WRITE. You cannot WRITE to a terminal
or a file without OPENing a channel either, for example:
$ SHOW LOGICAL TT
"TT" = "_FTA207:" (LNM$PROCESS_TABLE)
$ WRITE TT "Hello World!"
%DCL-W-UNDFIL, file has not been opened by DCL - check logical name
$ OPEN/WRITE MY_TERMINAL TT:
$ WRITE MY_TERMINAL "Hello World!"
Hello World!
$
WRITE will always return with error if the channel has not first been
OPENed.
The /OUTPUT=SYS$NET tells the DIRECTORY command to send its output to
SYS$NET. Internally, the DIRECTORY command issues an RMS $OPEN before
it issues any RMS $PUT to output the directory's listing. The channel
is implicitly $CLOSEd as part of image rundown.
Your channel to SYS$NET, since you don't explicitly issue a DCL CLOSE,
will be implicitly CLOSEd as a feature of process rundown.
How does that work when several processes want to open the device? For example, in this
case, if DCL opened SYS$NET, and then you run DIRECTORY with output directed to SYS$NET.
Can DIRECTORY be allowed to open the device, even though DCL already have it open?
Also, what happens at close. Is the connection terminated when SYS$NET is closed, or is
the connection still around until the process is terminated?
Can another open be done on the same SYS$NET, and you can continue exchanging data?
Johnny