home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
500-599
/
ff594.lzh
/
AnalyRimSrc
/
AnaRimSrcDoc.Zoo
/
helptxt.dat
< prev
next >
Wrap
Text File
|
1991-10-01
|
74KB
|
2,054 lines
HEL
HELP
HELP Command
---- -------
The HELP command provides the capability to obtain a description
of the available RIM commands, a discussion of the general command
syntax, a summary of all available commands, and general news
about the RIM system. HELP is available at any time during
execution except when in the interactive dialog (menu) mode.
To receive help when in the command mode enter:
. HELP [{command name}]
. RIM
. WHERE
. SORT
. SYNTAX
. INPUT FORMAT
. SUMMARY
. NEWS
1
HELP Command
---- -------
You will then enter the HELP submodule and receive explanation
of the selected option as:
. OPTION EXPLANATION
. ------ -----------
. HELP previous command and syntax or, if first
. command identical to HELP RIM
. HELP command name indicated command and syntax
. HELP RIM list of commands for which help is
. available
. HELP SYNTAX description of the RIM command input
. format, basic syntax and data
. genration facilities
. HELP INPUT FORMAT an in-depth description of free-field
. input format and data generation
. facilities available in RIM
. HELP WHERE the RIM where clauses
. HELP SORT the RIM sort clause
. HELP SUMMARY summary of all available RIM commands
. HELP NEWS general news about the RIM system
1
HELP Command
---- -------
You will remain in the HELP submodule until you enter an END
command which will return you to the command mode. The commands
available inside the HELP submodule are identical to the HELP
commands except that the keyword HELP is omitted. The HELP
submodule displays information one screen at a time. After each
screen you will have the option to continue displaying the text or
to return to the HELP submodule by entering QUIT.
ENDC
OPE
OPEN
OPEN Command
---- -------
The OPEN command is required whenever an existing data base is to
be used. You specify the name of the data base. RIM uses the
name of the data base to form the names of the three local files
which contain the data base.
. OPEN dbname
Only one RIM data base may be open at one time (if you don't
CLOSE the present data base before opening a new one, RIM
will automatically close the present data base). The OPEN command
must be issued before any commands that require data from the data
base can be processed.
ENDC
CLO
CLOSE
CLOSE Command
----- -------
The CLOSE command permits you to close a RIM data base without
leaving RIM. The reason for doing this is to close one data base,
then open or define a different one all within one RIM session.
This command is not needed if only one RIM data base is accessed
during a RIM session. This command results in data needed by the
data base being copied from its incore working areas to the local
data base files.
. CLOSE
Note: the current data base will be closed for you when you leave
RIM by issuing an EXIT command
ENDC
USE
USER
USER Command
---- -------
This command is used to identify your password to RIM. Your
password is used to check against read and modify passwords
specified for the relations. Each time this command is issued,
the new password replaces the current password. The default
password is the word NONE.
. USER password
ENDC
INP
INPUT
INPUT Command
----- -------
This command causes RIM to read subsequent commands and/or
data from a specified file. When RIM detects an end-of-file mark
on the indicated file, RIM will return to the terminal
or batch input file, as apppropriate, and continue to read
input and/or data. The use of this command allows the
user to define command procedures on file and then have RIM
execute a set of commands without user interaction.
. INPUT filename
A more explicit way to control return of input to your ter-
minal or batch input file is to use INPUT INPUT as the last com-
mand which returns input, as appropriate, to the batch input file
or user terminal. As an alternative, INPUT TERMINAL may be used.
1
INPUT Command
----- -------
A more general use of this command is possible by causing
a second alternate input file to be used from the first alter-
nate file by use of the INPUT command. This nesting of alter-
nate input files can be done to any depth. It should be noted
that you must provide explicit returns on these alternate
files using the INPUT command since the default is to return
to your input file (terminal if applicable).
ENDC
OUT
OUTPUT
OUTPUT Command
------ -------
This command is used to specify the name of the output file.
Specifying a file other than OUTPUT will result in the output from
the RIM commands to be placed on a local file with the specified
file name. The output file name may be changed as often as
desired. The use of this command allows the user to get offline
hardcopy output from RIM.
. OUTPUT filename
OUTPUT TERMINAL will return the output to the user's terminal.
ENDC
ECH
ECHO
ECHO Command
---- -------
This command is used to control printing of your input commands
on the output file. The default is for echo to be off in
interactive execution and on in batch. To activate echo
print you enter:
. ECHO
ENDC
NOE
NOECHO
NOECHO Command
------ -------
The NOECHO command turns off the echo printing.
. NOECHO
ENDC
TOL
TOLERANCE
TOLERANCE Command
--------- -------
For real and double precision attributes and for real and double
precision vectors and matrices as well as for individual
elements of such vectors and matrices, you may want to use a
tolerance in qualifying equality, non equality and order. The
tolerance applies to any real or double precision number you use
in a WHERE clause. If A is an attribute with value a and r is a
user specified number used in a WHERE clause and t a tolerance
(positive, zero or negative), the following are true conditions:
. A EQ r if and only if r-t le a le r+t
. A NE r if and only if a lt r-t or a gt r+t
. A GT r if and only if a gt r-t
. A GE r if and only if a ge r-t
. A LT r if and only if a lt r+t
. A LE r if and only if a le r+t
For real and double precision attributes of length greater than 1
and for real and double precision vectors and matrices, the
above formulas are applied to the comparison of each element.
1
TOLERANCE Command
--------- -------
If t is a percentage tolerance, t is to be replaced with t x r/100
in the above expressions to define true conditions for percentage
tolerances.
TOLERANCE tol [PERCENT]
where tol is the tolerance and the presence or absence of the
keyword PERCENT indicates whether tol is a percentage tolerance or
or not. The TOLERANCE command can be used as many
times as desired to reset the tolerance. A tolerance stays in
effect for a session until a new tolerance is specified. The
default value for tolerance is 0.
ENDC
NOC
NOCHECK
NOCHECK Command
------- -------
Rule checking applies to the CHANGE command and LOAD command to
load or modify data. The default is that rules, if defined, are
enforced. The NOCHECK command suppresses the rule checking.
. NOCHECK [RULES]
ENDC
CHE
CHECK
CHECK Command
----- -------
The CHECK command turns on rule checking. The CHECK and NOCHECK
commands may be issued as many times as required anywhere in the
input stream while in command mode.
CHECK [RULES]
ENDC
EXI
EXIT
EXIT Command
---- -------
To leave the RIM system you issue the command:
. {EXIT}
. QUIT
This command closes your current data base. Data needed by
your data bases are copied from the incore working areas to
the files whose names were determined by the OPEN command or
by the schema name designated in the DEFINE submodule.
ENDC
QUI
QUIT
QUIT Command
---- -------
To leave the RIM system you issue the command:
. {QUIT}
. EXIT
This command closes your current data base. Data needed by
your data bases are copied from the incore working areas to
the files whose names were determined by the OPEN command or
by the schema name designated in the DEFINE submodule.
ENDC
REL
RELOAD
RELOAD Command
------ -------
The RELOAD command is used whenever you want to rebuild the data
files of your data base to recover unused space created by row
deletions, certain attribute changes and relation removals.
When a row is deleted, one of its variable length attributes
changed so that it length increases, or when a relation is
removed, the vacated space is not reused until you issue this
command. If your data base has any KEY attributes, then the
access pointer files maintainted for those attributes are also
rebuilt. The syntax for this command is:
. RELOAD
ENDC
DEF
DEFINE
DEFINE Command
------ -------
The define submodule commands are used for defining the structure
of the data base. The definition of the data base is called the
schema and the schema name is the name of the data base and forms
the essential part of the names of the local files used for the
data base. Attributes, relations, passwords, and constraints
(rules) are defined using this submodule. To access this
submodule you enter:
. DEFINE dbname
You must identify the name of the data base whose definition you
are going to create or expand by specifying the schema name. This
name is used to form the name of the local files used to store the
data base tables and must when augmented with a single number be a
legal local filename. For an example, see help for DEFINE EXAMPLE.
ENDC
OWN
OWNER
OWNER Command
----- -------
The OWNER command specifies the owner of the data base. The OWNER
has permision to read or modify all data and the schema.
. OWNER password
If the data base already exists and you want to define additional
attributes or relations, password is checked against the
existing owner password.
ENDC
ATT
ATTRIBUTES
ATTRIBUTES Command
---------- -------
. ATTRIBUTES
. attname type1 [{length}] [KEY]
. VAR
. attname type2 [{row, col}] [KEY]
. row, VAR
. VAR, VAR
. .
. .
. .
The attribute definitions are ended when you specify one of the
keywords RELATIONS, PASSWORDS or RULES which start the other
sections in the DEFINE submodule.
1
ATTRIBUTES Command
---------- -------
Type1 attributes:
RIM supports seven data types of type1: floating point (real),
integer, text, double precision, real vectors, integer vectors and
double precision vectors. You must enter REAL, INT, TEXT, DOUB,
RVEC, IVEC or DVEC for type1. The default length is one value
except for TEXT for which it is 8 characters. The length is
specified in number of values and characters respectively. VAR
indicates variable length. The optional KEY specification causes
an index file to be built for the attribute which is used by RIM to
find qualifying rows for retrievals and updates. Under certain
conditions, such an index file will make retrievals and updates
considerably faster than if no index file is used. See WHERE
clause definitions for a specific discussion. The default is
that such an index file is not built (non-key attribute). You
should consider the cost of building and storing index file data
versus the benefits you will obtain from quicker retrievals when
deciding if a KEY declaration should be used or not. No specific
rules can be given here, experience should be used to judge. An
1
ATTRIBUTES Command
---------- -------
attribute can be changed from KEY to non-key or vice-versa later
using the BUILD KEY and DELETE KEY commands.
. For larger data bases (more than 1, 000 rows), experience
has shown that it is most efficient not to specify a KEY in the
define submodule but rather to load the data without keys and to
later cause index files to be built using the BUILD KEY command.
The greater the number of keys the more efficient this method is.
Type2 attributes:
. RIM supports three data types of type2: real matrices, integer
matrices or double precision matrices. You must enter RMAT, IMAT
or DMAT for type2. The matrices can be of fixed size, have
variable column dimension or variable row and column dimensions.
You enter the row dimension first, followed by the column
dimension. Default dimension is 1, 1 . The key-word KEY has the
same meaning as for type1 attributes.
ENDC
REL
RELATIONS
RELATIONS Command
--------- -------
To define relations enter:
. RELATIONS
. relname WITH attname1 [attname2 ...]
. .
. .
. .
The relation definitions are ended by specifying one of the
keywords ATTRIBUTES, PASSWORDS, RULES, or END which start the
other sections of the DEFINE submodule or finishes the schema
definition. The attributes must be listed in the order in which
they are to appear in the relation. No attributes can be used
which have not been previously defined, either in the current
DEFINE submodule execution or in previous definition of this
data base. Attributes which are defined but not included in
a relation will not become part of the RIM schema.
A RIM data base must have attributes and relations defined.
Passwords and constraint rules are optional.
ENDC
PAS
PASSWORDS
PASSWORDS Command
--------- -------
. If read or modify passwords are desired, you enter:
. PASSWORDS
. {READ PASSWORD} FOR relname IS password
. RPW
. {MODIFY PASSWORD} FOR relname IS password
. MPW
. .
. .
The password definitions are ended by specifying one of the
keywords ATTRIBUTES, RELATIONS, RULES, or END which start the
other sections of the DEFINE submodule or finishes the data base
definition. Passwords can be any string of characters up to 8
characters long. When you are doing queries, loads, or
modifications, the current password is specified by the USER
command. If this password does not match one of the read,
modify or owner passwords for a relation you cannot query that
relation. If this password does not match one of the modify or
owner passwords, you cannot load or modify the given relation.
ENDC
RUL
RULES
RULES Command
----- -------
Constraint rules are another optional section of the DEFINE
submodule. If rules are specified, they are used during the
loading process or during CHANGE commands to screen out rows which
do not meet the constraint rules. Rules are specified by relation.
At most 10 rules may be specified for a single relation. There are
several options available in the rule definition section. To define
constraint rules you enter:
. RULES
. attname [IN relname] {EQ} value [{AND} attname ... ]
. NE OR
. GT
. GE
. LT
. LE
1
RULES Command
----- -------
. or
. attname1 IN relname {EQA} attname2 IN relname [{AND} ... ]
. NEA OR
. GTA
. GEA
. LTA
. LEA
where: EQ = Equals
. NE = Not equal to
. GT = Greater than
. GE = Greater than or equal to
. LT = Less than
. LE = Less than or equal to
. EQA = Equals attribute
. NEA = Not equal to attribute
. GTA = Greater than attribute
. LTA = Less than attribute
. LEA = Less than or equal to attribute
1
RULES Command
----- -------
The rule definitions are ended by specifying one of the keywords
ATTRIBUTES, RELATIONS, PASSWORDS, or END which start the other
sections of the DEFINE submodule or finishes the schema
definition. Attributes referenced in the rule definitions must
have been previously defined. By specifying rules, you can
restrict an attribute to a range of values or require that the
value of an attribute in one relation have a specified relationship
to the values of an attribute in the same or a different relation.
The compare operators ending in A (EQA etc.) are used when the
comparison is to existing attribute values rather than to a
specified constant. A rule expression may contain no more
than 10 compare operators (9 Boolean operators).
The method used for constraint checking is that the first
attribute mentioned in the rule is taken from the input (LOAD or
CHANGE command) data and checked against the remainder of the rule
expression using existing values in the database.
ENDC
END
END
END Command
--- -------
To finish the schema definition you enter the following keyword
and leave the DEFINE submodule:
. END
The END command also terminates the LOAD process.
ENDC
DEX
DEFINE EXAMPLE
DEFINE EXAMPLE
------ -------
Example of define submodule commands:
. DEFINE RIMDB
. OWNER ME
. ATTRIBUTES
. MODEL TEXT KEY
. WEIGHT REAL
. NUMPASS INT
. CARRIER TEXT 16
. FLIGHTNO INT
. NAME TEXT KEY
. AGE INT
. RELATIONS
. AIRPLANE WITH MODEL WEIGHT NUMPASS
. FLIGHTS WITH CARRIER FLIGHTNO MODEL
. PEOPLE WITH NAME AGE
1
DEFINE EXAMPLE
------ -------
. PASSWORDS
. MPW FOR AIRLINES IS AGENT
. RPW FOR PEOPLE IS BLUE
. RULES
. MODEL IN FLIGHTS EQA MODEL IN AIRPLANE
. AGE GT 21 AND AGE LT 65
. NUMPASS IN AIRPLANE LE 350
. END
ENDC
LOA
LOAD
LOAD Command
---- -------
The load submodule commands are used to add data to a newly
defined relation or to add data to a relation which already
contains data. To access this submodule enter:
. LOAD relname
You may now load data in the relation, one row per command, by
entering data values in a one to one correspondence with the
attributes:
. value1 value2 ... valuen
Valuei takes the form described in the following table:
1
LOAD Command
---- -------
. Attribute
.Type Length or Valuei Remark
. Dimension
REAL, INT n n.gt.1 (val1 ... valn) Parentheses optional
DOUB, RVEC
IVEC, DVEC
REAL, INT VAR (val1 val2 ...) Parentheses required
DOUB, RVEC
IVEC, DVEC
TEXT any "text string" In special cases
. " " is optional
. (see INPUT FORMAT)
RMAT, IMAT m, n ((r1c1...rmc1)(r1c2...) + Columnwise
DMAT ...rmcn)) Parentheses optional
RMAT, IMAT m, VAR ((r1c1...)(r1c2...)...)) Columnwise
DMAT or Parentheses required
. VAR, VAR
1
LOAD Command
---- -------
To finish data loading you enter:
. END
Multiple relations may be loaded from within the load submodule by
re-entering the LOAD command instead of the END command. For an
example of data loading, see LOAD EXAMPLE.
ENDC
LOX
LOAD EXAMPLE
LOAD EXAMPLE
---- -------
Example of load submodule commands:
. LOAD AIRPLANE
. DC9 87000. 110
. 747SP 200000. 350
. LOAD PEOPLE
. BOB 30
. JOE 32
. ALICE 29
. END
If the value for an attribute is missing, you enter the characters
-0- for the missing value or use two successive commas.
. L1011 -0- 250
. L1011, , 250
These two records have identical meaning.
ENDC
SEL
SELECT
SELECT Command
------ -------
The SELECT command is used for displaying or printing data from
one relation. It has many options. To print all data from a
relation:
. SELECT ALL FROM relname
To print selected attribute values from all rows in a relation:
. SELECT attname1 [ attname2 ... attnamen ] FROM relname
The above form will print up to 20 attributes in any order.
However the number of attributes is limited by space available in
the line. As a rule of thumb, 7 attributes may be selected when
running at an interactive terminal and 11 when running in batch
mode or at an 132 character terminal.
For variable length attributes or for attributes of fixed length
that would otherwise not fit on a line alone or together with
other attributes, you may format the output using the optional
field width control:
1
SELECT Command
------ -------
. SELECT attname1 [ =fw1 ] [ attname2 [ =fw2 ] ... ] +
. FROM relname
fwi is the output field width for attnamei. For a text type
attribute, fwi is the width of the output paragraph in number of
characters, for other attribute types it is the number of values.
When the field width option is used, RIM will use for each row as
many output lines as required by the most critical attribute.
Defaults are rather complex. For a fixed length attribute, no
paragraphing is attempted. The system will use the field width
required to display the value(s) of the attribute. For a variable
length attribute of type TEXT, the default is display of a maximum
of 40 characters with truncation of remaining text, if any. For
variable length attributes of types REAL, INT, DOUB, the default
is 4 values with truncation. For variable length vector type
attributes, the default is 4 values with paragraphing (no
truncation). For variable length matrix attributes the default is
4 values with paragraphing (no truncation). A row starts on a new
line.
1
SELECT Command
------ -------
Whether field width is specified or not, the system will display
the dimension of variable length vectors and matrices using one of
the output value positions. However, should the user specify a
width of only one value for such an attribute, the row and column
dimensions will not be displayed.
Further information about line width, no of lines per page,
defaults and user specification is given under the WIDTH and
LINES commands.
. When paragraphing TEXT type attributes, RIM will identify con-
sequtive substrings of text separated by blanks and place such a
substring on the line, if there is space available, or if the current
current line contains less than four characters in which case the
number of characters that fit on the line are removed from (the front
of) the substring and put on the line (without hyphen). If there is
not room on a line filled with more than four characters, the
(first part of the) substring will be placed on the next line.
1
SELECT Command
------ -------
Examples of SELECT command:
SELECT ivecvar FROM rel1
. DIM IVECVAR
. ----------------------------
. 7 1 2 3
. 4 5 6
. 7
. 1 10
SELECT imatvv FROM rel1
. ROW COL IMATVV
. -----------------------------
. 2 5 11 12 13
. 14 15
. 21 22 23
. 24 25
. 1 1 11
1
SELECT Command
------ -------
SELECT textv=9 FROM rel1
TEXTV
---------
THIS IS
AN EXAMPL
E OF
WRAPAROUN
D OF TEXT
THIS IS
ANOTHER
EXAMPLE
OF TEXT
1
SELECT Command
------ -------
The attribute name (attnamei) may be replaced by an attribute
number (attnumi). It may also be a specific element of a vector
or a mtrix. Thus the general form of the unconditional SELECT
command is:
.SELECT {attname1 [ =fw1 ] } [attname2 [=fw2] ... ] +
. attnum1 [ =fw1 ]
. attname1(i)
. attname1(i, j)
. ALL
FROM relname
To print all attributes from a relation where certain conditions
are met:
. SELECT ALL FROM relname WHERE condition1 [{AND} condition2 ... ]
. OR
For help for the where clause, see the WHERE entry.
For help for the sorted by clause, see the SORT entry.
For examples, see SELECT EXAMPLES.
ENDC
WHE
WHERE
WHERE Clause
----- ------
Up to ten conditions may be combined using the Boolean operators
of AND and OR. The conditions are combined from left to right.
Each condition may be one of the following forms:
. attname EXISTS
. attname FAILS
. attname EQ MAX
. attname EQ MIN
. attname EQ value
. attname EQS value
. attname NE value
. attname GT value
. attname GE value
. attname LT value
. attname LE value
. attname EQ list
. attname NE list
. attname1 EQA attname2
. attname1 NEA attname2
. attname1 GTA attname2
. attname1 GEA attname2
. attname1 LTA attname2
. attname1 LEA attname2
1
WHERE Clause
----- ------
. ROWS EQ rownumber
. ROWS NE rownumber
. ROWS LT rownumber
. ROWS LE rownumber
. ROWS GE rownumber
. ROWS GT rownumber
. ROWS EQ list
. ROWS NE list
. LIMIT EQ number
. where: EQ = Equals
. EQS = Contains the text string
. NE = Not equals
. GT = Greater than
. GE = Greater than or equal to
. LT = Less than
. LE = Less than or equal to
1
WHERE Clause
----- ------
. EQA = Equals attribute
. NEA = Not equals attribute
. GTA = Greater than attribute
. GEA = Greater than or equal to attribute
. LTA = Less than attribute
. LEA = Less than or equal to attribute
. MAX = Maximum value
. MIN = Minimum value
Attname, attname1, attname2 may refer to an element of a vector or
a matrix.
When an attribute has been assigned a value, then EXISTS will
qualify those attributes. If an attribute has not been assigned a
value, but was loaded with -0-, then FAILS will qualify those
attributes.
1
WHERE Clause
----- ------
MAX and MIN comparison can only be made for integer, real and
double precision attributes of fixed length equal to 1.
Value in comparison statement must follow the rules of the LOAD
command for vectors and matrices, i.e. if the attribute is of
variable length or dimension, parentheses must be used to input a
vector or a matrix value or a list of vector and matrix values.
EQS applies to text strings only. In such a comparison, value is
a text string and the comparison is true if value is found as a
substring anywhere within the attribute for which comparison is
requested.
NE comparison when applied to matrices or vectors is true if the
length or dimension is different from the length or dimension of
the user specified comparison vector or matrix or if any vector or
matrix elements differs.
1
WHERE Clause
----- ------
GT and LT comparisons for vector and matrix attributes are
lexicographical, i.e. a comparison is made element by element
(columnwise for matrices) and continued until a true or false
condition is detected. If no such condition is detected after the
last element is checked, a false condition is assumed. Comparison
is made only for vectors and matrices of the same size as
comparison data.
GE and LE comparisons for vector and matrix attributes are similar
to GT and LT comparisons except it continues if an equal condition
is detected and if no condition is detected after the last element
is checked, a true condition is assumed.
Comparison rules for vector attributes apply also to real, integer
and double precision attributes of fixed or variable length.
A list is a simple list a1, a2, a3, ..., an of values where a value
may be a vector or matrix.
1
WHERE Clause
----- ------
The comparison key words ending in A are used when comparing the
value of one attribute to the value of another attribute in the
same row of the relation.
ROWS refer to row numbers in a relation. Note that a relation is
loaded in input row order but that subsequent operations (changes)
to the data base may cause the order of the rows to change.
When the LIMIT clause is used, only the first LIMIT number of the
rows that otherwise would qualify will actually qualify.
Processing the WHERE condition can be speeded up greatly if index
processing is used. Index processing involves using the indices
created for KEY attributes rather than looking at each row of a
relation to find the rows qualified by the WHERE conditions.
Index processing will be used when the following are all true:
. 1) The last condition uses an attribute which is KEY
. 2) The last condition uses EQ
. 3) The last condition is not combined by OR with the other
. conditions.
ENDC
SOR
SORT
SORTED BY
------ --
The output can be sorted by specifying sorting attributes. The
sorting order is user specified with default low to high.
. SELECT ... FROM relname +
. SORTED BY attname1 [{=A} ] [ attname2 [={A} ] ... ] +
. D D
. [ WHERE ... ]
A and D stands for ascending and descending order respectively.
If a sort on more than one attribute is requested, the output will
first be ordered according to the first mentioned attribute. In
case there are duplicates for the first sort attribute, these will
be ordered by the second sort attribute, duplicates within this by
the third and so on. A maximum of 5 sort attributes may be
specified. When multiple attributes are used, ascending
and descending order may be used in any combination. A maximum
of five sort attributes may be specified. Variable
length attributes may not be used as sort attributes. When fixed
length attributes are used as sort attributes, only the first 20
characters and the first value is used for sort.
ENDC
TAL
TALLY
TALLY Command
----- -------
The TALLY command prints a tally for an attribute giving each
unique value and the number of times it occurs in a relation. The
tally is ordered ascending or descending per user input. Default
is ascending. The WHERE clause is optional. For a description
of the WHERE clause see HELP WHERE.
.TALLY attname [{=A}] FROM relname [ WHERE ... ]
. D
For examples of SELECT and TALLY, see SELECT EXAMPLES.
ENDC
SEL
SELECT EXAMPLES
SELECT EXAMPLES
------ --------
Examples of SELECT and TALLY commands:
. SELECT ALL FROM AIRPLANE
. SELECT MODEL FROM AIRPLANE
. SELECT ALL FROM AIRPLANE WHERE WEIGHT GT 100000.
. *8 AND NUMPASS LT 200
. SELECT AGE FROM PEOPLE WHERE NAME EQ BOB
. SELECT ALL FROM AIRPLANE SORTED BY MODEL=D
. TALLY MODEL FROM FLIGHTS
. TALLY MODEL FROM FLIGHTS WHERE CARRIER EQ UNITED
. SELECT ALL FROM DIMENS WHERE HEIGHT GTA WIDTH
. SELECT FILE TITLE=4 OWNER FROM PFDATA
ENDC
LIS
LISTREL
LISTREL Command
------- -------
The purpose of LISTREL is to provide you with information about
the relations in your data base.
There are three formats for the LISTREL command. The first
consists of simply entering:
. LISTREL
Using LISTREL in this fashion provides you with a list of all
relations currently defined in your data base. If you wish to
display the definition of a specific relation, then the syntax is:
. LISTREL relname
The use of LISTREL in this manner also provides a count of the
number of defined rows for the specified relation.
. LISTREL ALL
This command will display the definitions of all relations in the
data base, including counts of number of defined rows in each
relation.
ENDC
EXH
EXHIBIT
EXHIBIT Command
------- -------
The purpose of the EXHIBIT command is to allow you to query the
RIM dictionary to obtain the names of all relations having a
specific set of attributes. For example, if you want to know
which relations contain the attribute attname you would enter:
. EXHIBIT attname
You would then obtain either a list of the relations having this
attribute, or a message indicating that this attribute was not
found in any relations in the data base.
In other cases, you may wish to know which relations contain a
list of attributes. This request is handled in a similar manner.
Suppose that you wanted to know which relations contain both
attname1 and attname2. The command would than be:
. EXHIBIT attname1 attname2
In general, the syntax of this command is:
. EXHIBIT attname1 [attname2 ... attnamen]
ENDC
PRI
PRINT RULES
PRINT RULES Command
----- ----- -------
This command can be used by the person whose current password
matches the owner of the data base definition to obtain a complete
list of all constraint rules.
. PRINT RULES
ENDC
COM
COMPUTE
COMPUTE Command
------- -------
The COMPUTE command is used to compute simple functional values
for an attribute. A WHERE clause is optional and uses the same
syntax as is used in the SELECT command.
. COMPUTE {COUNT} attname FROM relname [WHERE ... ]
. MIN
. MAX
. AVE
. SUM
There are some restrictions as to the type and word length of the
attribute when using these computed functions. All of these
functions exclude any -0- values when making their computations.
1
COMPUTE Command
------- -------
The following table describes the attribute type and length
restrictions for each function:
. FUNCTION ATTRIBUTE TYPE ATTRIBUTE LENGTH
. -------- -------------- ----------------
. COUNT any any
. MIN any 1 (20 chars for text)
. MAX any 1 (20 chars for text)
. AVE any except TEXT 1
. SUM any except TEXT 1
.
.Examples of COMPUTE command:
. COMPUTE AVE NUMPASS FROM FLIGHTS
. COMPUTE MAX WEIGHT FROM FLIGHTS WHERE NUMPASS LT 100
. COMPUTE COUNT NAME FROM PEOPLE WHERE AGE GT 30
ENDC
CHA
CHANGE
CHANGE Command
------ -------
The CHANGE command is used to change the value of an attribute in
a relation where certain conditions are met.
. CHANGE {attname1} TO attname2 [IN relname] WHERE ...
. attname(i)
. attname(i, j)
Value has the same form as descried in the LOAD command. The WHERE
clause is required and and is described in the WHERE entry.
If the relation name is not specified, the attribute is
changed in all relations where the attribute is found and the
conditions are met. For relations in which the change attribute is
is present but in which one or more of the attributes used
in the where clause are missing, an error message will be
issued.
ENDC
DEL
DELETE
DELETE Command
------ -------
The delete command removes data from the data base. For a
more precise description see:
. DELETE DUPLICATES
. DELETE ROW
. DELETE KEY
ENDC
DER
DELETE ROW
DELETE ROW Command
------ --- -------
The DELETE ROW command is used to delete selected rows in a
relation.
. DELETE ROW FROM relname WHERE ...
The name of the relation must be specified as well as a WHERE
clause. The syntax for the WHERE clause is described in the
WHERE entry.
ENDC
DED
DELETE DUPLICATES
DELETE DUPLICATES Command
------ ---------- -------
This command is used to remove any duplicate rows from a relation.
It is useful to use on new relations which have been created by
any of the relational algebra commands (JOIN, INTERSECT, SUBTRACT,
or PROJECT). The syntax for this command is:
. DELETE DUPLICATES [attname1, attname2, ...] from relname
Duplicates are checked only for the specified (combination of)
attribute(s). Default is to check for complete row (all
attributes).
ENDC
REM
REMOVE
REMOVE Command
------ -------
The REMOVE command is used to remove a relation definition and its
data from the data base.
. REMOVE relname
ENDC
CHA
CHANGE OWNER
CHANGE OWNER Command
------ ----- -------
The CHANGE OWNER command is used to change the name of the data
base owner password. Only a person whose password
matches the curent owner password may use this command.
priviledge.
. CHANGE OWNER TO newowner
ENDC
REN
RENAME
RENAME Command
------ -------
For detailed information on the RENAME command see:
. RENAME ATTRIBUTE
. RENAME RELATIONS
ENDC
REA
RENAME ATTRIBUTE
RENAME ATTRIBUTE Command
------ --------- -------
The RENAME attribute command is used to change the name of an
attribute in the definition (schema) of the data base.
. RENAME [ATTRIBUTE] attname1 TO attname2 [ IN relname ]
The old name is attname1 and the new name is attname2. If the
name of the relation is not specified, the name change takes
place in every relation that contains the old name. If relname is
specified and attname1 is duplicate (or more), the first occurance
will be changed.
RULES and KEY defined for attname1 will automatically be redefined
to apply for attname2.
Examples of RENAME command:
. RENAME MODEL TO VERSION IN AIRPLANES
. RENAME NUMPASS TO CAPACITY
ENDC
BUI
BUILD KEY
BUILD KEY Command
----- --- -------
This command is used to change an attribute from non-key to KEY. An
index is built from existing data values by making a pass through
current rows of the specified relation. This index is then used
and maintained just as if the attribute had been declared to be
KEY in the original data base definition.
. BUILD KEY FOR attname IN relname
ENDC
DEK
DELETE KEY
DELETE KEY Command
------ --- -------
This command is used to change an attribute from KEY to non-key.
The index file for that attribute is inactivated and no longer
maintained or used once the attribute has been changed to non-key
with this command.
. DELETE KEY FOR attname IN relname
ENDC
CHP
CHANGE PASSWORD
CHANGE PASSWORD Command
------ -------- -------
If you are the data base owner, you may change the read or modify
passwords by the following command
. CHANGE {RPW} TO newpass FOR relname
. MPW
ENDC
RER
RENAME RELATION
RENAME RELATION Command
------ -------- -------
You may change the name of a relation by the following command
. RENAME RELATION relname TO newname
Note: RULES and KEYs applying to relname will aumatically apply
to newname.
ENDC
INT
INTERSECT
INTERSECT Command
--------- -------
The INTERSECT command allows you to combine the rows of two rela-
tions into a third relation based on equality of values within
a common set of attributes identified from a set of specified
attributes. The syntax of the INTERSECT command is:
. INTERSECT relname1 WITH relname2 FORMING relname3 +
. [USING attname1 [attname2 ... attnamen]]
The USING clause identifies which attributes that are included
in the resulting relation. Common attributes used in the
intersect process are identified within these.
As an example, assume that you have the following two relations
defined:
. REL-1 REL-2
. NAME DEPT JOB DEPT JOB PAY
. ---------------------- --------------------
. BOB A ENGR A ENGR 800
. JIM C SUPR B ENGR 450
. BOB B ENGR C ENGR 750
. RAY C ENGR
1
INTERSECT Command
--------- -------
. You may INTERSECT two relations restricted to specific sets of
attributes (the USING clause) or use all attributes of both
relations. In either case RIM will identify the common
attributes.
In the first case, suppose you wish to INTERSECT the two relations
using attributes DEPT, NAME and JOB. The command for this would be:
. INTERSECT REL-1 WITH REL-2 FORMING REL-3 USING DEPT NAME JOB
The result would be the new relation REL-3 shown below:
. REL-3
. DEPT NAME JOB
. -----------------------
. A BOB ENGR
. B BOB ENGR
. C RAY ENGR
1
INTERSECT Command
--------- -------
In this example there are no duplicate rows in REL-3. It is
possible that the INTERSECT command will create duplicate rows.
In general duplicate rows are not desired in a relation. Duplicates
are not removed by the INTERSECT command but can be removed with
the DELETE DUPLICATES command. Note also that by specifying which
attributes the INTERSECT is using, you restrict the number of
attributes in the resulting relation to only those specified in
the USING clause.
In another case, you may want RIM to use all the attributes in the
two relations. In this instance, you would enter:
. INTERSECT REL-1 WITH REL-2 FORMING REL-4
The result would be REL-4 consisting of the attributes NAME, DEPT,
JOB, and PAY, shown below with the resulting rows:
. REL-4
.
. NAME DEPT JOB PAY
. ----------------------------------
. BOB A ENGR 800
. BOB B ENGR 450
. RAY C ENGR 750
ENDC
JOI
JOIN
JOIN Command
---- -------
The JOIN command is a function operating on two relations to form
a third relation. The purpose of the JOIN is to juxtapose two
relations based on a specified attribute from each.
The result is a third relation containing all the attributes
from both relations. Rows are generated into the new relation
based upon a specified comparison between the two JOIN
attributes. In general a row from the first relation may
generate zero, one or more rows depending upon how many
rows in the second relation have the desired match. The
syntax of the JOIN command is:
. JOIN relname1 USING attname1 WITH relname2 USING attname2 +
. FORMING relname3 [WHERE {EQ}]
. NE
. GT
. GE
. LT
. LE
1
JOIN Command
---- -------
The conditional clause is different from the WHERE clause of
select. In JOIN it applies only to the comparison of the two
attributes upon which JOIN is based. If the WHERE clause is
omitted (default), EQ is used. The comparisons involving
order (GT etc.) refer to attname1 GT attname2 etc.. The
comparison of the two single attributes follow the
(lexicographical) rules of the where clause of select.
1
JOIN Command
---- -------
As an example, consider the relations REL1 and REL2:
. REL1 REL2
. A B C D E
.----------------------------- ------------------------
. 1 2 3 3 1
. 4 5 6 6 2
. 7 8 9
The following JOIN command
. JOIN REL1 USING B WITH REL2 USING D +
. FORMING REL3 WHERE B LT D
would produce:
. REL3
. A B C D E
. --------------------------------------------------------
. 1 2 3 3 1
. 1 2 3 6 2
. 4 5 6 6 2
1
JOIN Command
---- -------
The JOIN will function correctly on any comparison providing that
you compare attributes of the same data type. All attribute names
in the resultant relation must be unique for you to obtain
accurate results when using SELECT or CHANGE commands on the
relation. Any duplicate attribute names should be changed using
the RENAME command before doing queries or updates to the new
relation. In the case of duplicate attribute names, RENAME when
applied to a specific relation will change the first attribute
name.
Note that if the constituient relations have no duplicate
rows, the relation formed with JOIN will also have no
duplicate rows.
ENDC
PRO
PROJECT
PROJECT Command
------- -------
The function of a PROJECT command is to create a new relation as a
subset of an existing relation. You may want to create the new
relation from the old one by removing attributes, removing rows,
or both. The syntax for the PROJECT command is:
. PROJECT relname1 FROM relname2 USING {attname1 ... attnamen} +
. ALL
. [WHERE ...]
The WHERE clause is optional but if specified it has the same
syntax as specified in the WHERE entry. You are required to specify
which attributes are to be retained in the new relation. The old
relation is relname2 and the new relation is relname1.
As an example consider the following relation:
1
PROJECT Command
------- -------
. PEOPLE
. EMPNUM EMPNAME BOSS POSITION GROUP
. --------------------------------------------------
. 2181 JONES SMITH MANAGER AADE
. 3964 ERICKSON BUSS APPL-MGR ACC
. 6543 GRAY PARKER ASST-MGR PHOTO
. 2233 SCHMITZ BUSS APPL-MGR ACC
. --------------------------------------------------
To create a new relation with EMPNAME and GROUP as the only
attributes where no rows contains PARKER as BOSS enter the
command:
. PROJECT TEMP1 FROM PEOPLE USING EMPNAME GROUP +
. WHERE BOSS NE PARKER
. TEMP1
. EMPNAME GROUP
. -------------------
. JONES AADE
. ERICKSON ACC
. SCHMITZ ACC
1
PROJECT Command
------- -------
The PROJECT command is useful to reduce the size of a
relation when only a subset of the data is
needed. RIM will not eliminate any duplicate rows formed in the
new relation. You must do that yourself with the DELETE
DUPLICATES command.
ENDC
SUB
SUBTRACT
SUBTRACT Command
-------- -------
The SUBTRACT command is similar to the PROJECT command in that a
new relation is formed from an existing relation, but rows are
selected based upon the data of two relations rather than a WHERE
clause within a single relation. Where the INTERSECT command
looked for rows of two relations which matched up, the SUBTRACT
does just the opposite. It looks for rows on in relation which do
not match with any rows in the other relation. The syntax for the
SUBTRACT command is:
. SUBTRACT relname1 FROM relname2 FORMING relname3 +
. [USING attname1 [attname2 ... attnamen]]
All rows in the new relation will come from relname2. If the
USING clause is not specified, then all attributes of relname2
will be attributes of relname3. relname1 is the relation that
rows of relname2 are checked against for matches.
1
SUBTRACT Command
-------- -------
As an example consider these two example relations:
. EMPDATA BOSSDATA
. EMPNUM EMPNAME BOSS BOSS POSITION GROUP
.------------------------------ -----------------------------
. 2181 JONES SMITH SMITH MANGER AADE
. 3964 ERICKSON BUSS PARKER ASST-MGR PHOTO
. 6543 GRAY PARKER BUSS APPL-MGR ACC
. 8461 BROWN WHITE
. 2233 SCHMITZ BUSS
The following command will produce a new relation from EMPDATA:
. SUBTRACT BOSSDATA FROM EMPDATA FORMING TEMP USING EMPNAME BOSS
The resulting relation TEMP would contain only one row:
. TEMP
. EMPNAME BOSS
. --------------------
. BROWN WHITE
ENDC
NEW
NEWPAGE
NEWPAGE Command
------- -------
This command causes a new page to be issued. It applies to batch
output only. The command is:
. NEWPAGE
ENDC
BLA
BLANK
BLANK Command
----- -------
Blank lines can be output by using the command:
. BLANK n
where n is the number of blank lines written.
ENDC
TIT
TITLE
TITLE Command
----- -------
The command:
. TITLE "titlestring"
causes the text "titlestring" to be printed, centered on the line.
If the length of "titlestring" is longer than current lines width,
it will be truncated and a warning issued.
ENDC
DAT
DATE
DATE Command
---- -------
The command:
. DATE
will cause the current date to be printed, centered on the line.
ENDC
LIN
LINES
LINES Command
----- -------
This command controls the number of lines per page (exclusive of
title). The command:
. LINES n
will establish page size to n lines. Default is 56.
ENDC
WID
WIDTH
WIDTH Command
----- -------
This command controls the width of a printed line. The command:
. WIDTH n
will establish a line width of n characters. Default is 78 if
output is to a terminal, 132 if output is to a batch printer.
ENDC
INF
INPUT FORMAT
INPUT FORMAT
----- ------
. Entering input through LXLREC
. -------- ----- ------- ------
. LXLREC is a free-field input routine which separates
. user input into items which are grouped into records.
.
. Terminology
. -----------
. line - one line of information with a maximum of 80
. characters. A line corresponds to a card (for
. those old enough to remember card input).
.
. item - one piece of information. An item may be a real
. number, an integer or text. Items are delimited
. by blanks or commas. Multiple blanks count as a
. single blank. Multiple commas generate null items (see
. section on multiple commas).
.
. record - a collection or list of up to 100 items which is
. in response to a single request for data by the
. calling program.
.
1
INPUT FORMAT
----- ------
. integer- all characters must be numeric except the first one
. which may be + or -. For example: -1 23 +10000
.
. real - an item of the form i1.i2ei3 where i1 and i3 may be
. signed integers and i2 is an unsigned integer. The
. entire form is not necessary but at least one digit
. and either the . Or the e must be present.
. for example: 1. E-3 -2.7E+4 .0
.
. text - any single item which is not an integer or real. If
. a text item looks like an integer or real or if it
. contains blanks or commas, it must be enclosed in
. quotes (").
.
. Composing records
. --------- -------
. Ordinarily records consist of one line. However, multiple
. records may be put on one line by separating them with
. dollars or semi-colons. Alternatively, a record may span
. several lines by ending all but the last line with a plus.
. In general items must be wholly contained on one line with the
. exception of quoted text items and comments.
1
. INPUT FORMAT
..----- ------
.
. Special items - =, (, )
. ------- ----- -----
. Equals and left and right parentheses are treated as single
. items unless enclosed in quoted text items. Thus a=3. Is
. 3 items (two text and one real) rather than one item.
. "a=3." is one text item. This allows more convenient parsing
. of many commands.
.
. Multiple commas
. -------- ------
. If more than one comma separates two items, each additional comma
. will generate a text item with Three characters "-0-". Thus,
. , , abc, , 2.5 is equivalent to -0-, abc, -0-, 2.5.
.
1
INPUT FORMAT
----- ------
. Rules for text items
. ----- --- ---- -----
. A quoted text item is terminated by a record separator (dollar
. or semi-colon). Quoted text items may be continued on multiple
. lines. If the trailing quote is omitted on the last item in a
. record, the quoted item is terminated at either the record
. separator, if any, or the last non-blank character on the line.
. Quotes may be included in quoted text items by doubling
. the quotes (e.g. "a, ""b" yields a, "b as a text string).
. The total number of characters for all text items in a
. record is limited to 2000.
.
. Some examples
. ---- --------
. 1, 2. ABC "2."
. This record has four items - integer, real and two text
.
. 1 $ 2
. This line is two records - each one integer
.
. 1 +
. 2
. This is one record on two lines with two integers
.
1
INPUT FORMAT
----- ------
. Comments
. --------
. Comments may be included anywhere in the input stream by
. enclosing them between *( and ). For example *( this is a comment).
. comments are completely ignored by LXLREC. Empty lines between
. records are also ignored and may be used to paragraph input.
. An alternative form of comment is */..../ where slashes replace
. the parentheses. This may be used if parentheses are needed in
. the comment.
.
. Short cuts - data generation
. ----- ---- ---- ----------
. Activities such as entering large volumes of data, repeating
. similiar records and reentering mis-typed records can be eased
. by using the LXLREC data generation facilities.
1
INPUT FORMAT
----- ------
.
. Repeating items on previous record - *n, **, *
. --------- ----- -- -------- ------ -------
. A data item of the form *n where n is an unsigned integer
. indicates that the next n items in that record are identical
. to the corresponding n items in the preceeding record. An
. isolated * is treated as *1. Double asterisks (**) indicate
. that the remaining items in the previous record are to be
. copied into the current record.
.
.
. Repeating an item in the current record - *=n *=n+step
. --------- -- ---- -- --- ------- ------ --- --------
. An item of the form *=n, where n is an unsigned integer,
. indicates that the next n items are identical to the
. immediately preceding item. An item of the form *=n+step
. or *=n-step where step is an unsigned real or integer,
. indicates that the next n items are to be generated by
. consecutively incrementing the immediately preceding item.
1
.INPUT FORMAT
.----- ------
.
. Generating multiple records - *+n
. ---------- -------- ------- ---
. A record beginning with *+n where n is an unsigned integer
. indicates that the next n records are to be generated from
. the preceding record. Each item of the generated record
. is formed by adding an item of the *+n record to the
. corresponding item of the immediately preceding input or
. generated record. A zero (integer) item should be inserted
. in an *+n record for text items in the preceding record.
. The number of items after the *+n must match the number
. in the preceding record.
1
INPUT FORMAT
----- ------
.
. Note on generating items
. ---- -- ---------- -----
. When increments are specified, either on the *+n record or
. as step on an *=n+step item they must match the item they
. are incrementing in type. It should be noted that the *+n
. record generation option is based on the expanded
. representation of the previous record. The generation does
. not operate on the card image of the preceding record if it
. contains data generation items. Therefore, it is not possible
. to repeat or increment an asterisk-type item.
1
INPUT FORMAT
----- ------
.
. Examples
. --------
. Consider the following seven input records to illustrate the
. data generation features.
. 1 2 3 4 5 6 7 8 9 10 11 12
. 2 1 *2 4 *=2 1 *=2+2 **
. *+1 0 *=3 0 *=5 **
. *+1 0 *=11
. *+1 *12
. *+1 **
. **
.
. Twelve data items are defined by each of these records. Each
. of the last six records is translated into the same internal
. record which is: 2 1 3 4 4 4 4 1 3 5 11 12
.
. Note - the last five records could be replaced by the single
. record: *+5 **
1
INPUT FORMAT
----- ------
.
. Changing special characters
. -------- ------- ----------
. It is possible to change the special characters LXLREC uses to
. break apart records. These special characters may either be
. changed to another character or set to null so that they are
. ignored. This is useful for reading specially formatted files
. or to allow special characters to be input as text items.
. to change special characters enter the following special
. comment as the only entry on a line between records.
.
. *(set keyword=newvalue)
.
. where keyword can be DOLLAR
. SEMI
. QUOTES
. BLANK
. PLUS
. COMMA
1
INPUT FORMAT
----- ------
.
. and newvalue is either the word null or the new special character.
. For example, if one wanted to use dollars to delimit items
. rather than records and to not have commas delimit items,
. the following two lines could be entered.
.
. *(SET DOLLAR=NULL)
. *(SET COMMA=$)
.
. Note that commas could now be used in unquoted text strings
. and dollars could now be included in quoted text strings.
. Also, note that it is really the function that is being
. altered, not the character. Changing plus only changes the
. line continuation character, not the representation of real
. numbers. To restore the original condition after the above
. example, the following could be entered.
1
INPUT FORMAT
----- ------
.
. *(SET DOLLAR=$)
. *(SET COMMA=, )
.
. Warning - using the same character for multiple functions
. will produce undefined results...(undefined means even the
. author wouldn't want to guess what will happen).
.
. Echo
. ----
. LXLREC will echo the input line as the default. Either the
. user or the calling program can switch echo on or off. The
. user accomplishes this by entering
. *(SET ECHO=ON) or
. *(SET ECHO=OFF)
. in the same manner as setting special characters.
.
.
ENDC
SYN
SYNTAX
Input Format, Data Generation and Syntax
----- ------ ---- ---------- --- ------
RIM is used by entering commands in response to input prompts.
The input prompts vary with RIM submodule used. The commands
always begin with a RIM keyword and may contain adiitional
keywords and other text and numerical items.
Keywords are described using capital letters. Three of the
commands (DEFINE, HELP and LOAD) are used to enter submodules
which have their own set of commands and prompts for defining
a data base, for providing on-line help to the interactive
user and for loading a data base. In describing commands, the
following conventions are used:
1
Input Format, Data Generation and Syntax
----- ------ ---- ---------- --- ------
.
. relname
. or name of a relation(s)
. relname1, relname2, ...
.
. attname
. or name of an attribute(s)
. attname1, attname2, ...
.
. value actual value(s)
. or (value may be a text string,
. value1, value2, ... scalar, vector or matrix)
.
All relation and attribute names must contain at least 1 and
no more than 8 alphanumeric characters.
1
Input Format, Data Generation and Syntax
----- ------ ---- ---------- --- ------
.
Many of the RIM commands have optional parts. These optional
parts are enclosed in square brackets.
. [THIS IS OPTIONAL]
Sometimes, a keyword is selected from a list of acceptable
keywords. In this case the acceptable keywords are listed
vertically with the first choice enclosed in brackets.
. {CHOOSE}
. ONE
. OF
. THESE
RIM command keywords may be abbreviated. At least the first
3 characters in a keyword are required.
1
Input Format, Data Generation and Syntax
----- ------ ---- ---------- --- ------
The following 3 set of keywords are equivalent:
. 1) SELECT, FROM, WHERE DELETE DUPLICATES
. 2) SELEC FRO WHER DELET DUPL
. 3) SEL, FRO WHE, DEL DUP
Commands in RIM are entered in a free-field format with
blanks and commas as separators. RIM also provides
powerful data repetition and data generation facilities.
The following provides a short and non complete description
of RIM conventions and data generation facilities. A more
extensive description, intended for the more experienced
RIM user, is contained in section INPUT FORMAT.
1
Input Format, Data Generation and Syntax
----- ------ ---- ---------- --- ------
.
Keywords and data values are separated by blanks and commas.
If a command is too long for one 80 character line, it may be
continued on succeeding line(s) by entering "+" as the last
character on the line(s). RIM remembers the previous command.
This enables you to re-use all or part of the previous command.
This is done by using an asterisk to indicate which items of
the previous command are to be re-used. A single asterisk
means re-use thee corrosponding single item of th previous
record. An asterisk followed by a number n means re-use
the next n corresponding items. Two asterisks mean re-use
all remaining corresponding items.
1
Input Format, Data Generation and Syntax
----- ------ ---- ---------- --- ------
.
The following are all equivalent:
.
. 1) THIS IS A COMMOND
.
. 2) THIS +
. IS+
. A +
. COMMAND
.
. 3) * IS, A COMMAND
.
. 4) THIS *2 COMMAND
.
. 5) THIS **
1
Input Format, Data Generation and Syntax
----- ------ ---- ---------- --- ------
.
Multiple commands may be entered on one line separated by a
semicolon or a dollar sign .
.
THIS IS FIRST ; THIS IS SECOND $ THIS IS THIRD
.
Comments may be placed anywhere within a command by enclosing
the comment between the characters *( and ).
.
. *(THIS IS A COMMENT) THIS IS NOT
.
When numeric data is to be interpreted as text (alphanumeric)
data, the numerals must be enclosed by quotation marks.
. "1234"
1
Input Format, Data Generation and Syntax
----- ------ ---- ---------- --- ------
.
When entering text strings which contain embedded blanks or
commas, the entire string must be enclosed by quotation
marks.
. "THIS IS A TEXT STRING"
A text string may require continuation on additional line(s).
The + sign convention can then be used within the quotation
marks.
. "THIS IS+
. A TEXT +
. STRING"
It recommended as good practice not to use leading blanks in
text strings. (The precise number of leading blanks in a
string must be used when it is referenced)
. "THIS IS GOOD PRACTICE" " THIS IS NOT"
1
Input Format, Data Generation and Syntax
----- ------ ---- ---------- --- ------
Integer data are input as a string of digits without a
decimal point. A sign may precede the digits
.
. 123 , -63, +56, 0
.
Real (floating point) numbers must include a decimal point
or E for exponent. If a decimal point is not precent
the E must be preceded by an integer.
. 1.3, .005, 0., 6.E-1, 6E-1, 0.60, -23.45
.
The absolute value of real number is limited to the
range 1.0E-38 to 1.0e+38
ENDC
SUM
SUMMARY
SUMMARY
-------
. DEFINING A DATABASE SCHEMA
.
. DEFINE dbname
. OWNER password
. ATTRIBUTES
. attname {REAL} [{length}] [KEY]
. INT VAR
. TEXT
. DOUB
. RVEC
. IVEC
. DVEC
.
. attname {RMAT} {row, col} [KEY]
. IMAT row, VAR
. DMAT VAR, VAR
.
1
SUMMARY
-------
. RELATIONS
. relname WITH attname1 [attname2 ... attnameN]
. PASSWORDS
. {READ PASSWORD} FOR {relname} IS PASSWORD
. RPW ALL
. {MODIFY PASSWORD} FOR {relname} IS PASSWORD
. MPW ALL
. RULES
. attname [IN relname] {EQ} value [{AND} ...]
. NE OR
. GT
. GE
. LT
. LE
. attname IN relname {EQA} attname IN relname [{AND} ...
. NEA OR
. GTA
. GEA
. LTA
. LEA
. END
.
1
SUMMARY
-------
. LOADING A RELATION
.
. LOAD relname
. value1 value2 ... valueN
. END
. value : SCALARS val1
. TEXT "text string"
. VECTOR (val1, val2, ...)
. MATRIX ((r1c1, r2c1, ...), (r1c2, r2c2, ...), ...)
.
.
1
SUMMARY
-------
. QUERYING A RELATION
.
. SELECT {attname1 [=fld1], attname2 [=fld2], ...} FROM relname +
. attnum1 [=fld1], ...
. attname1(i), ...
. attname1(i, j), ...
. ALL
. [SORTED BY attname1 [={A}], [attname2 [={A}], ...]] +
. D D
. [WHERE ...]
. TALLY attname [={A}] FROM relname [WHERE ...]
. D
.
1
SUMMARY
-------
. WHERE CLAUSE :
.
. WHERE attname {EXISTS} [{AND} ...]
. FAILS OR
. EQ {value}
. EQS MAX
. NE MIN
. GT
. LT
. LE
.
. WHERE attname {EQA} attname [{AND} ...]
. NEA OR
. GTA
. GEA
. LTA
. LEA
.
. WHERE ROWS {EQ} rownumber [{AND} ...]
. NE OR
. LT
. LE
. GE
. GT
.
1
SUMMARY
-------
. WHERE {attname} {EQ} list [{AND} ...]
. ROWS NE OR
.
. WHERE LIMIT EQ number [{AND} ...]
.
. COMPUTATION COMMANDS
.
. COMPUTE {COUNT} attname FROM relname [WHERE ...]
. MIN
. MAX
. AVE
. SUM
.
1
SUMMARY
-------
. MODIFICATION COMMANDS
.
. CHANGE {attname} TO value [IN relname] WHERE ...
. attname(i)
. attname(i, j)
. CHANGE {RPW} TO newpass FOR relname
. MPW
. CHANGE OWNER TO newowner
. DELETE ROWS FROM relname WHERE ...
. DELETE DUPLICATES [attname1, attname2, ...] FROM relname
. DELETE RULE rulenumber
. RENAME ATTRIBUTE attname TO newname [IN relname]
. RENAME RELATION relname TO newname
. REMOVE relname
.
1
SUMMARY
-------
. RELATIONAL ALGEBRA COMMANDS
.
. INTERSECT relname1 WITH relname2 FORMING relname3 +
. [USING attname1 [attname2, ...]]
.
. JOIN relname1 USING attname1 WITH relname2 USING attname2 +
. FORMING relname3 [WHERE {EQ}]
. NE
. GT
. GE
. LT
. LE
.
. SUBTRACT relname1 FROM relname2 FORMING relname3 +
. [USING attname1 [attname2, ...]]
.
. PROJECT relname1 FROM relname2 USING +
. {attname1, [attname2, ...]} [WHERE ...]
. ALL
.
1
SUMMARY
-------
. QUERYING THE SCHEMA
.
. LISTREL [relname]
. ALL
. EXHIBIT attname [attname ...]
. PRINT RULES
.
. REPORT COMMANDS
.
. NEWPAGE
. BLANK n
. TITLE "title"
. DATE
. LINES n
. WIDTH n
.
. KEY COMMANDS
.
. BUILD KEY FOR attname IN relname
. DELETE KEY FOR attname IN relname
.
1
SUMMARY
-------
. RIM-TO-RIM COMMANDS
.
. UNLOAD [dbname [=newdbname]] {SCHEMA} [relname1 [=mpw] +
. DATA
. ALL
. [relname2 [=mpw], ...]
.
. MISCELLANEOUS COMMANDS
.
. OPEN dbname
. CLOSE
. INPUT {filename}
. TERMINAL
. OUTPUT {filename}
. TERMINAL
. EXIT
. QUIT
. MENU
1
SUMMARY
-------
. HELP [command name]
. USER password
. ECHO
. NOECHO
. CHECK
. NOCHECK
. TOLERANCE xx.xx [PERCENT]
. RELOAD
.
.
ENDC
NWS
NEWS
NEWS
----
November 24,1981 -- UD20 -- was implemented.
UD20 traps bad user data and corrects several errors as follows:
. 1 correct error message in data loading
. 2 print error message if zero length attribute
. 3 correct several errors in RELOAD
. 4 trap bad pointers for var length attributes in appl interface
. 5 correct bad pointer increment by RMDEL
. 6 correct sort problem with already sorted data
. 7 correct rules problem in UNLOAD
. 8 trap use of list for other than EQ,NE and EQS
. 9 correct problem with rules not recognizing keyword ATTR
.10 trap rule checking for non-scalars and text
.11 correct the trapping of more than 10 rules per relation
.12 remove message DB FILES ARE LOCAL for a define
.13 correct UNLOAD problem with vectors etc.
.14 put trap in PROJECT to assure that only valid attributes are used
.UD20 makes the following enhancement:
. 1 add EQS list to SELECT WHERE clause
1
NEWS
----
December 3,1981 -- UD21 -- was implemented.
UD21 corrects several errors as follows:
. 1 put blank line from ECHO on proper file
. 2 trap case when RULES section entered w/o defining constraints
. 3 trap error in RULES when attribute name is a RIM keyword
. 4 correct B-tree error during appl prog load when KEYs defined
. 5 deactivate UNLOAD of RULES until UNLOAD can be reworked
UD21 makes the following code enhancement:
. 1 make code more portable by softcoding file unit numbers
ENDC
RIM
RIM
RIM
---
. RIM is a relational data base management system. RIM commands
. allow you to define, load, query and modify a data base. RIM
. supports the following commands:
.
. BLANK BUILD KEY CHANGE CLOSE COMPUTE
. DATE DEFINE DELETE KEY DELETE ECHO
. EXHIBIT EXIT INPUT INTERSECT JOIN
. LISTREL LOAD NEWPAGE NOECHO OPEN
. OUTPUT PRINT PROJECT QUIT RELOAD
. REMOVE RENAME SELECT SUBTRACT TALLY
. TITLE USER
.
. The DEFINE command and the LOAD command are used to enter
. submodules where commands known only to those submodules
. are processed.
.
1
RIM
.---
.
. The DEFINE submodule supports the following commands:
.
. DEFINE
. ELEMENTS
. RELATIONS
. PASSWORDS
. RPW (READ PASSWORD)
. MPW (MODIFY PASSWORD)
. RULES
. END
.
. The LOAD submodule supports the following commands:
.
. LOAD
. CHECK
. NOCHECK
. END
.
1
RIM
---
.
. For a description of the general command syntax used by RIM
. enter SYNTAX. For a summary of the syntax for the current
. RIM command enter SUMMARY. For a description of the RIM
. WHERE clauses enter WHERE.
.
ENDC
MEN
MENU
MENU Command
---- -------
The MENU command places the user in menu mode. It may be entered
at any point when in command mode except when in the DEFINE or LOAD
modules. Menu mode is particulary useful for schema definition and
data loading.
ENDC
UNL
UNLOAD
UNLOAD Command
------ -------
The UNLOAD command permits you to off-load a portion or all
of your dOata base onto a previously designated file (see OUTPUT
command). The file will contain 80 character text records and will
be readable by RIM on the same or on a different computer using the
INPUT command. Default file name is OUTPUT. The syntax of this
command is:
.
. UNLOAD [ dbname = newname ] (ALL ) +
. SCHEMA
. DATA
. [ relname1 [ = mpw1 ] relname2 [ = mpw2 ] ...]
.
The mandatory part offers a choice between ALL, DATA and SCHEMA.
Specifying SCHEMA will off-load the schema of your data base,
DATA will off-load the data of your data base and ALL will
off-load both schema and data.
1
UNLOAD Command
------ -------
Optionally you may rename your data base by entering
dbname = newname where dbname is the name of the currently
open data base. By specifying relation names, you will
only off-load data and/or schemas for the specific relations.
The password associated with a relation name must be
specified if your current user password does not allow you
modify access to the relation.
There are implicit password restrictions to the unload
command as follows:
If you are the data base owner, you may off-load any data
and/or schema. If you are not the owner, you may off-load
data and or schema for the relations for which you have
modify access permission. Your password becomes the owner
of the off-loaded data base. Rules, if any, will only be
off-loaded if you are the owner of the data base and you
have used the option ALL.
h
ENDD