1 TSCON 
Terminal Server Connection Utility.

Connects to a DECserver 100 or 200 (should also work with a 500 but
this hasn't been tested).

Format:

	TSCON == "$<dir>TSCON"

	TSCON  node  file  command

This reads commands from one or more of SYS$INPUT, SYS$COMMAND, a specified
file and the command line and sends them to the terminal server.

2 Input
The order of processing the various possible sources of input.
The scheme is a bit complicated but is intended to make TSCON as
flexible as possible.

If a file is given on the command line:

	SYS$INPUT if not a terminal and different from input file.
	Input file.
	Any command specified on the command line.

Otherwise if a command was specified on the command line:

	SYS$INPUT if not a terminal and different from SYS$COMMAND.
	Command specified on the command line.

Otherwise:
	SYS$INPUT if not a terminal and different from SYS$COMMAND.
	SYS$COMMAND.

2 Parameters
Node

	DECnet node name for terminal server, as set up by DSVCONFIG.

File

	Input script file.

	The default file spec. is the translation of the logical name
	TSCON_DEFAULT_FILE_SPEC (= TSCON.TSC at Anglia College),
	or TSCON.DAT if that does not exist.

Command

	A line of input to be sent to the terminal server -
	typically a local-mode command.

	If SYS$COMMAND is a terminal, an interactive dialogue
	is started (the local terminal is set /PASTHRU - it's
	similar to doing SET HOST).

	Before reading SYS$COMMAND, if SYS$INPUT is different
	it is used for input until end-of-file. This can
	be used to store server login passwords (& usernames)
	in a suitably protected file rather than typing them in.
	The same file can be invoked from scripts via "@".

2 Qualifiers
/DIAGNOSTICS

	Prints various counters at the end of a run of TSCON.

/LOG

	/LOG [=file-spec]

	Specifies that the data from the terminal server be logged
	in a file (default file spec TSCON.DAT). Note that
	this includes the echoing of local-mode commands.

	If /LOG is NOT given but the logical name TSCON_TS_LOG
	exists, then data is logged to that file.

/POLL

	/POLL=centisecs		D=10 (terminal), 2 (batch)

	Specifies the keyboard polling rate in centisecs
	(minimum value is 1, maximum is 100).

	This should not normally be changed.

	/POLL=0 means "use default value".

2 Example_procedures
An example of using SYS$INPUT for a password (& username) file.

  $ tscon = "$<dir>tscon"
  $ if p1 .eqs. "" then goto do_it	! Let TSCON do prompting
  $ file = f$search(f$parse(p2,".tsc"))
  $ pw_file = f$search("<pw-dir>''p1'_access.dat")
  $ if file .eqs. "" then -
        if pw_file .nes. "" then define/user sys$input 'pw_file'
  $do_it:
  $ tscon 'p1' 'file'

A more complicated example, allowing for a script file
and/or a command.

  $ tscon = "$<dir>tscon"
  $ if p1 .eqs. "" then goto do_it
  $ file = p2
  $ if file .nes. "" then file = f$parse(p2,"<management-dir>.tsc")
  $ pw_file = f$search("<pw-dir>''node'_access.tsc")
  $ if file .eqs. "" then -
        if pw_file .nes. "" then define/user sys$input 'pw_file'
  $ if file .eqs. "" then file = """"""
  $do_it:
  $ tscon 'p1' 'file' 'p3 'p4 'p5 'p6 'p7 'p8

2 Script_files
DECserver commands can be stored in files.

E.g.
	access		! login password, always needed
	system		! username
	set priv
	system		! privileged-mode password
	define server name ts101
	define server identification "CAD/CAM Room"
	define port all preferred service mech

Special characters:

	!	starts a comment

	!!	passes "!" to the server

	@<file-spec>  "@" must be the first character on a line,
		the default file spec. is as for the input file on
		the command line.

SMG keyboards are used for reading input (SMG$READ_STRING routine).
