Contents of the XSET1_41.DOC file
XSET 1.41 Documentation [911208-rf]
Communicating via DOS environment variables, XSET provides an
easily maintained table look-up mechanism which enhances the
usefulness of MS DOS batch language programs.
XSET compares the current value of a specified environment
variable with tabular entries in a simple ASCII text file, and
creates new environment variables with specific values based on
XSET finds particular utility in the determination and
initialization of arguments in support of background print
servers (RPRINTER, etc.), as well as establishing user
environment defaults (such as menus, redirected devices, eg.,
printers) in a local area network setting.
XSET has been recently enhanced to simplify its application in
NetWare LANs, but will work in any environment.
Syntax: XSET [table file name]
There are several ways of telling XSET what the table file name
is. The default file name is XSET.DAT. The default file extension
is .DAT. An alternate file name can be passed via command line or
via the DOS environment variable XSET.
Such as: SET XSET=FILE.LST
is equivalent to: XSET FILE.LST
A command line passed file name overrides an environment variable
passed file name.
XSET 1.41 Documentation [911208-rf] Page 2
Table File Structure
The file structure of an XSET table file is very simple, and was
designed with two goals in mind. Support for embedded comments,
and maintainability with any ASCII file editor, from EDLIN to
A table file consists of one or more tables.
A table has three sections:
Interspersed among these constructions can be comments, blank
spaces and blank lines.
Currently there are four valid command line variations. All are
flush left, strictly uppercase, and listed below:
The next three forms are equivalent in deed to special header
line formats. Their actions are discussion in later sections.
The occurrence of a valid command line signifies the start of a
table. The very next line in the table of the form
OLDVAR=[modifier] NEWVARi, NEWVARj, ....
... is called the HEADER LINE. OLDVAR is the name of an existing
DOS environment variable. NEWVARi,.. are names of additional DOS
environment variables, which need not exist prior to XSET
execution. The rules for the construction of DOS environment
variables can be found in an MS DOS manual.
Note: Comments can precede and follow the XSET command line as
long as the structure can not be confused with the header line
XSET 1.41 Documentation [911208-rf] Page 3
The header line can assume one of five formats:
The basic form is a=b,c,d,...
Where a,b,c,d,... are valid environment names. However, only
variable "a" need exist at execution time. Variables "b","c","d"
etc. are created by XSET.
There can be as many as ten variable names, comma delimited,
following the equal sign. The last variable in the list must not
be followed by a comma. Instead, it must be followed by an end
of line (spaces can be liberally introduced to enhance
reliability). The header can not contain comments. Comment
lines can, of course, precede or follow.
a==b,c,d,... (ERASE "a" after table look up)
A==B,C or A=B,C
The "old variable" ("A" in the example) is removed (erased) from
the DOS environment after it is used for table look up.
a=~b,c,d,... (TRUNCATE "a" before table look up)
The current value of the "old variable" is stripped of leading
zeros before it is used for table look up. This is most useful in
ARCNet node tables.
XSET 1.41 Documentation [911208-rf] Page 4
a=|b,c,d,... (PURGE environment - header variables
are "don't cares")
The Purge Environment command provides a quick way for clearing
out environment clutter. The XSET table structure is maintained
but only the data lines are significant, and only the item
preceding the = sign on the data line is used. The structure is:
= or =|
VAR2= VAR2= etc.
This results in ALL variables in the environment to be erased
except VAR1, VAR2, ... .
This command is particularly useful in environments where users
are logging into the network with a varying and uncertain degree
of environment space clutter. To guarantee availability of
environment space for network applications, and a consistent mode
of entry, it is sometimes useful to eliminate stuff from the DOS
Would cause all but PROMPT, COMSPEC and PATH variables to be
deleted from the DOS environment.
a1+a2=b,c,d,... (concatenate "a1" to "a2" prior to table
XSET 1.41 Documentation [911208-rf] Page 5
One or more data lines follow the header line. Data lines refer
to the current table. The occurrence of another XSET command
line or end-of-file signifies the end of the data section for a
particular table. There are a few variations of data line syntax,
mentioned below. The basic structure is:
Only the number of fields designated in the header line of the
current table are significant. Thus comments can be appended to
the data line beyond the last significant field.
A=B,C ASCII File called ABC.DAT
SET A=A1 Batch program fragment
Upon execution, the variable "A" is compared to the table. Since
the value of "A" is "A1", a match occurs on the second data line.
The variable "B" is created in the parent environment, and given
the Value "B1". The Variable "C" is created with value "C1".
Variable A is left intact in the environment.
If A=A4, XSET would process the table match "A4= =,C4". The
equals sign (=) holding the place of a "new variable" value is an
instruction to XSET to NOT CREATE THE NEW VARIABLE. Thus, the
variable "B" would not be created, but the variable "C" would be
initialized with the value "C4".
If A=A5, the table match with the entry "A5= =,=" would cause
neither "B" nor "C" to be created.
If A=A7, the table match with the entry "A7=B7, " would result in
a new variable "B" to be set to "B7" and an new variable "C" to
be set to "C6". This is because a null field place holder causes
XSET to scan backwards in that column of the table for a valid
entry. The previous line (A6=B6,C6) happens to have a valid entry
for the "C" column.
Finally, the last data line of an XSET table is called the
default data line. It is selected if no prior match occurs. In
the above example, "A=A8" would cause a match on the last line.
However, so would "A= [anything other than A1,A2,A3,A4,A5,A6 or
A7]", such as "A=ELEPHANT".
XSET 1.41 Documentation [911208-rf] Page 6
NetWare specific features:
If the header line existing variable is one of the following, the
NetWare current value is used for table look up, instead of an
environment variable value:
Standard Netware Login Script Objects:
%LOGIN_NAME - user login name
%P_STATION - physical station address (12 digit hex node id)
%STATION - logical station (2 hex digit connection number)
%NETWORK_ADDRESS - Network number of the cabling system (8 hex digits)
"New and/or improved" Netware Objects (peculiar to XSET):
%P_STATION_Z - %P_STATION with leading zeros stripped away
%STATION_Z - %STATION with leading zeros stripped off
%NETWORK_ADDRESS_Z - %NETWORK_ADDRESS with leading zeros stripped off
As in (table):
Batch program fragment:
IF NOT "%PHOST"=="" RPRINTER %PHOST,%PNUM
The Physical Station (node id), less leading zeros, is used to
locate Rprinter arguments.
XSET locates the DOS environment by tracing the software vector
02Eh. If for some reason it is of interest to trace an alternate
vector, set the environment variable XSETV=new vector in hex.
For example, DOS created copies of the environment for every task
it launches. If it is desirable to cause XSET to manipulate the
child environment, try SET XSETV=22. An alternative way to set
the trace vector to 22h specifically is to invoke XSET with a
command line switch of "/V", as in:
This can be useful in a batch interface between applications.
For example, menu selections launches an application. The
environment of the application is to be modified, but not the
parent environment (which exists upon exit from the menu
Note: In all cases, standard DOS rules for allocation and
availability of environment space apply.
XSET 1.41 Documentation [911208-rf] Page 7
Installation Hints and Error Messages
File not found
SMODE XSET.EXE 5 on NetWare environment when the table file is to
be located on a search PATH.
Cannot process XSET - Variable XXX not found
The Environment block does not contain the variable specified in
an XSET header line.
Out Of Environment Space:
If manipulating primary E-block (usually PSP=2E, the default
value), consult your MS-DOS manual for instructions. Most
versions of MS-DOS support SHELL=COMMAND.COM /E:XXX /P in
CONFIG.SYS (where XXX is desired environment size).
If manipulating secondary E-block (usually PSP=22, by setting
XSETV=22 in environment before running XSET or invoking XSET with
the /V switch (as in XSET [optional table file name] /V), then
try creating a dummy variable in the parent environment, and then
deleting it prior to running XSET in the child environment.
of what is allocated (by SHELL=COMMAND.COM /E:, etc. - or
SET JUNK= <--- causes space consumed by 'JUNK' to be released
XSET is compiled with Microsoft BASIC PDS 7.0.
XSET wish list (things to come?)
Make it work faster!
Table file encryption - (better security)
Indexed table file (faster processing)
Table file maintenance application/front end
Rewrite in more efficient language
XSET 1.41 Documentation [911208-rf] Page 8
V1.41 12/91 fix minor bugs - also, first shareware
Add /V command line arg - same as
SET XSETV=22 in environment prior to invoking
V1.4 10/91 (add Network Variables Support: %LOGIN_NAME,
%P_STATION, %P_STATION_Z, %STATION,
%STATION_Z, %INTERNET, %INTERNET_Z)
(misc performance enhancers - parse for
needed fields only. Also, more efficient ng$
XSET command line args - to set
This renders XSET1.4 data files not backwards
compatible although old data files work just
fine. SYNTAX is XSET-ERASE XSET-PURGE
ERASE-deletes oldvar from eblk
PURGE-ignores key or header line - field 1
vars retained in eblk, all others deleted
(future may support wildcards)
TRUNCATE-causes environment var value to be
truncated before comparison
XSET-ERASE-TRUNCATE will do both
note: TRUNCATE not functional with NetVars -
use _Z vars instead
V1.31F 6/90 (improve performance of data line parse
V1.31 1/90 (fix minor bugs; add truncate command)
V1.3 12/89 (default file is cmd line arg, or env var
XSET, or XSET.DAT)
(PSP tracking vector override by E-var XSETV
- default 2E)
(concatenation in KEY var statement)
V1.2 8/89 (add purge environment command 8/21/89)
V1.1 6/89 (filter out unprintable <20H chars)
V1.0 4/89 Major redesign of PROFILE.EXE
XSET 1.41 Documentation [911208-rf] Page 9
This product is licensed for use by FBN Consulting, Las Cruces,
N.M. to integrators, users and sites at the discretion of the
licensor or author, who can be contacted on Compuserve at
XSET development started out (like much software) as an act of
desperation, but is now occasionally viewed with more affection.
If you like XSET and would like (1) support via Compuserve or US
MAIL, and/or (2) would like access to new releases of product,
documentation, etc. - please register your possession of the
product by sending $25 to FBN Consulting at the following
PO BOX 6427
Las Cruces, N.M. 88006