********************************************* * Help database source for RIM vers 1.0 * * * * by Jim Fox * * updated January 6, 1989 for UNIX * ********************************************* * * Help text template * +----------------------------------------------------------------------+ | XXXXXX |this|or|that|required| + | | | | | | | +----------------------------------------------------------------------+ Commentary. * end of the template * * * Macros * &syntax Conventions used in the command syntax display: - UPPER case must be typed asis. (3 char substring ok) - lower case is replaced with your specific choice - { required phrase } - < optional phrase > - | delimits multiple choices; e.g., choice1 | choice2 means you may enter choice1 OR choice2 - ... indicates the preceding phrase may be repeated &fmt Column formats Valid format specifications are: Text columns: An (where: n = field width, Integers: rIn.d d = decimal places, Reals: rRn.d r = items per line) Dates: text text may be any reasonable combination of mm, mmm, dd, yy, and yyyy. (dd optional) eg. 'mm/dd/yy', 'mmm dd, yyyy' Times: text text may be any reasonable combination of hh, mm, ss. (ss optional) eg. 'hh:mm:ss', 'hh:mm' * &where Where clause +----------------------------------------------------------------------+ | WHERE <(> column_comparison <|AND|OR| column_comparison> <)> ... | | | | column_comparison = column operator value | | column operator column | | column <|EXISTS|FAILS> | +----------------------------------------------------------------------+ Operators are: LT, LE, EQ, GE, GT, NE, LIKE or: < <= = >= > <> The where clause selects only those rows that satisfy the logical conditions of the clause. Parentheses may be used to indicate the precedence of the logical operators. String comparison may be either sensitive or insensitive to case. The command SET CASE controls this option. Case sensitivity defaults. The value string for the 'LIKE' comparison may contain 'wild-card' characters. A '?' will match any single character, while an '*' will match any number of characters. The 'wild-card' characters may be changed with the SET ARBCHAR command. 'LIKE' may be used only with a value---'column LIKE column' is not valid. * &sort Sort clause +----------------------------------------------------------------------+ | SORT column1<|=A|=D|> column2<=A|=D> ... | +----------------------------------------------------------------------+ The sort qualifier =A specifies ascending; =D descending. * &to To clause +----------------------------------------------------------------------+ | TO filename | +----------------------------------------------------------------------+ Output will be written to the specified file, rather than to the terminal. If the filename contains spaces, commas, or other RIM delimiters you must enclose it in quotes. * ************************************************************************ * * Beginning of command help text * * Generic help . RIM is a powerful, yet modest, relational database manager available on all ACS mainframe computers. A relational database consists of tables The tables consist of columns and rows. SQL style commands let you define database tables and load and retrieve data. In addition you can create new tables from existing ones using relational algebra. Type 'HELP command' to get help for a particular command. For example, HELP SELECT will show you how to use the SELECT command. There is also HELP TYPING which explains how to enter RIM commands. +----------------------------------------------------------------------+ These are the RIM commands: Accessing a database OPEN Opens a database for access by other commands CLOSE Closes the database USER Identifies the user's password Defining a database DEFINE Defines tables and columns LIST Lists tables and columns EXHIBIT Lists tables containing a given column CHANGE OWNER Changes the owner password CHANGE RPW Changes the read password for a table CHANGE MPW Changes the modify password for a table REFORMAT Change a column's default format REMOVE LINK Removes a link from the database REMOVE TABLE Removes a table from the database RENAME LINK Renames a link RENAME TABLE Renames a table RENAME COLUMN Renames a column Loading a database LOAD Loads data into a table Changing and deleting data BUILD KEY Builds a key for an column in a table CHANGE Changes data DELETE ROWS Deletes one or more rows from a table DELETE DUPLICATES Deletes duplicate rows from a table REMOVE KEY Deletes a key for an column in a table Data retrieval SELECT Lists rows from one or more tables REPORT Report writing = Define variable FOOTER Define footers HEADER Define headers IF Conditional processing NEWPAGE Page eject PRINT Print data PROCEDURE Define procedure SELECT Select rows WHILE Looping Relational algebra INTERSECT Creates an intersection of two tables JOIN Creates a join of two tables PROJECT Creates a subset of a table SUBTRACT Creates a difference of two tables UNION Creates a union of two tables Macro definitions MACRO Defines a macro RIM parameters and miscellaneous * Comment 'command' SET Sets the value of a parameter SHOW Shows the value of one or more parameters SHOW LIMITS Displays Rim's buffer size limitations SHOW MACROS Displays macro definitions ECHO Echo commands NOECHO Stop echoing commands INPUT Input commands from a file OUTPUT Direct output to a file Exit from RIM EXIT Exits from RIM QUIT Also exits from RIM +----------------------------------------------------------------------+ In all cases a RIM command or keyword may be abbreviated to the first three letters. Type 'HELP command' to get help for a particular command. For example, HELP SELECT will show you how to use the SELECT command. * .* +----------------------------------------------------------------------+ | * | +----------------------------------------------------------------------+ The comments are parsed, but no action is taken. This command is most often used to see macro expansions. * .BUILD KEY +----------------------------------------------------------------------+ | BUILD KEY FOR column IN table | +----------------------------------------------------------------------+ Builds a key for the specified column in the specified table. Selections based on keyed columns are much more efficient than those on un-keyed columns. However, updates are more costly for the keyed columns. * .CHANGE +----------------------------------------------------------------------+ | CHANGE column TO value IN table WHERE conditions | +----------------------------------------------------------------------+ Changes the value of the column in the specified table for all rows selected by the WHERE clause. Absence of the WHERE clause selects all rows for change. The 'value' must conform to the column's type. =where +------------------------------------------------------------------+ | There are two other change commands, which modify | | the schema of the database. They are: | | | | - CHANGE OWNER Changes the owner password | | - CHANGE MPW Changes the modify password of a table | | - CHANGE RPW Changes the read password of a table | +------------------------------------------------------------------+ * .CHANGE OWNER +----------------------------------------------------------------------+ | CHANGE OWNER TO new_owner | +----------------------------------------------------------------------+ Changes the owner password to 'new_owner'. The user must be the owner of the database in order to use this command (see the USER command). The 'new_owner' password may be from 1 to 16 characters. * .CHANGE MPW +----------------------------------------------------------------------+ | CHANGE MPW TO new_password FOR table | +----------------------------------------------------------------------+ Changes the specified table's modify password to 'new_password'. The user must be the owner of the database in order to use this command (see the USER command). The 'new_password' may be from 1 to 16 characters. * .CHANGE RPW +----------------------------------------------------------------------+ | CHANGE RPW TO new_password FOR table | +----------------------------------------------------------------------+ Changes the specified table's read password to 'new_password'. The user must be the owner of the database in order to use this command (see the USER command). The 'new_password' may be from 1 to 16 characters. .CLOSE +----------------------------------------------------------------------+ | CLOSE | +----------------------------------------------------------------------+ Closes the current database. All files are updated and closed also. Exiting from RIM will automatically close an open database. * .DEFINE +----------------------------------------------------------------------+ | DEFINE < filename > | +----------------------------------------------------------------------+ Begin definition of a database on the specified file. If the file exists, it must contain a RIM database and will be edited. If no filename is given then the currently open database will be edited. If a path is specified, the entire name should be enclosed in quotes. +----------------------------------------------------------------------+ A database definition is actually many commands. This is the order in which they must appear: Identifies the owner password Describes new columns column specifications Describes new tables table specifications Defines table links link specifications Associates passwords with tables password specifications END Ends database definition You may obtain help with any of the define sub-commands by: HELP DEFINE sub-command * .define OWNER +----------------------------------------------------------------------+ | DEFINE database_name | | OWNER owner_name | | . . . | +----------------------------------------------------------------------+ Defines the owner password of the database. If this is an existing database the 'owner_name' must equal the existing owner password .define COLUMNS +----------------------------------------------------------------------+ | DEFINE database_name | | . . . | | COLUMNS | | column_name type1 | | ... | | column_name type2 {row,col|row,VAR|VAR,VAR} + | | | | ... | +----------------------------------------------------------------------+ Defines column_names that can be used later in table definitions. type1 length ----- ------ INT na integer REAL na real DATE na date TEXT # of chars text DOUB na double precision real IVEC # of integers integer vector RVEC # of reals real vector DVEC # of reals double precision vector type2 row col ----- ------ ------ IMAT # rows # cols integer matrix RMAT # rows # cols real matrix DMAT # rows # cols double precision matrix VAR means the particular dimension is variable. =fmt * .define TABLES +----------------------------------------------------------------------+ | DEFINE database_name | | . . . | | TABLES | | table_name WITH column1 ... | | . . . | +----------------------------------------------------------------------+ Defines the tables of a database. * .define LINKS +----------------------------------------------------------------------+ | DEFINE database_name | | . . . | | LINKS | | link_name FROM column1 IN table1 TO column2 IN table2 | | . . . | +----------------------------------------------------------------------+ Defines links between tables. The link may be used during data selection from 'table1' to access data from the row in 'table2' where 'column1' in 'table1' is equal to 'column2' in 'table2'. * .define PASSWORDS +----------------------------------------------------------------------+ | PASSWORDS | | RPW FOR table_name IS read_password | | . . . | | MPW FOR table_name IS modify_password | | . . . | +----------------------------------------------------------------------+ Sets the read or modify password for the indicated table. * .EXIT +----------------------------------------------------------------------+ | EXIT | +----------------------------------------------------------------------+ Exits from Rim. * .EXHIBIT +----------------------------------------------------------------------+ | EXHIBIT column | +----------------------------------------------------------------------+ Lists the tables that contain the specified columns. * .HELP +----------------------------------------------------------------------+ | HELP < command < sub-command > > | +----------------------------------------------------------------------+ Provides help with the specified command. Help text for most commands includes the following: - A display of the command's syntax - A description of the command's function - More detail concerning syntax and function - Examples =syntax * .INTERSECT +----------------------------------------------------------------------+ | INTERSECT table_1 WITH table_2 FORMING table_3 + | | >> | +----------------------------------------------------------------------+ Forms table_3 which is the intersection of table_1 and table_2. If columns are listed then only those are included in table_3. * .JOIN +----------------------------------------------------------------------+ | JOIN table_1 USING column-1 WITH table_2 USING column-2 + | | FORMING table_3 | +----------------------------------------------------------------------+ Forms table_3 which is the logical join of table_1 and table_2. Rows are joined where: column-1 'compares to' column-2. The default comparison is 'EQ'. * .LIST +----------------------------------------------------------------------+ | LIST | +----------------------------------------------------------------------+ Lists information about tables and columns in the currently open database. If 'table_name' is not given then a summary of all tables is listed. If 'table_name' is given then all columns in the specified table. are listed. Links associated with the table are also listed. If '*' is given then all columns for all tables are listed. * .LOAD +----------------------------------------------------------------------+ | LOAD table_name | +----------------------------------------------------------------------+ Loads data into the specified table. Data loading is terminated by a line beginning with END or by an end-of-file. Unformatted loading: (USING not specified) Each input record must contain an entry for each column of the table. The input lines may be continued with '+'. Formatted loading: (USING specified) A format is read from 'formatfile' which specifies the position of each column's data on the input records. The 'formatfile' looks like: FORMAT line position column format ... END where 'line' is the relative line number (first is 1), 'position' is the character position on the line, 'column' is the column name to be loaded, and 'format' is the format of the data. All fields are required. * .MACRO +----------------------------------------------------------------------+ | MACRO name = definition | | MACRO name CLEAR | +----------------------------------------------------------------------+ Defines a macro. The definition consists of text (should be quoted) and integers (1-32). Text represents actual replacement text. Integers represent arguments - they will be replaced with argument tokens when the macro is invoked. The macro is invoked whenever its name appears in input text. The CLEAR variation deletes a macro definition. * .NEWPAGE +----------------------------------------------------------------------+ | NEWPAGE | +----------------------------------------------------------------------+ Causes a page eject in the output file. * .OPEN +----------------------------------------------------------------------+ | OPEN file | +----------------------------------------------------------------------+ Opens the specified database. A database must be opened before any operations can be performed on it. If a path is specified, the entire name should be enclosed in quotes. * .PROJECT +----------------------------------------------------------------------+ | PROJECT table_1 FROM table_2 >> + | | | +----------------------------------------------------------------------+ Forms table_1 which is a subset of table_2. If columns are specified then only those will be included in table_1. If a where clause is specified then only the selected rows will be included in table_1. =where * .QUIT +----------------------------------------------------------------------+ | QUIT | +----------------------------------------------------------------------+ Exits from Rim. * .REFORMAT +----------------------------------------------------------------------+ | REFORMAT column TO format | +----------------------------------------------------------------------+ Changes the format of the specified column. If no table name is specified then the column is changed in all tables. =fmt * .RENAME COLUMN +----------------------------------------------------------------------+ | RENAME column TO new_name | +----------------------------------------------------------------------+ Changes the name of the specified column to 'new_name'. If no table name is specified then the column is renamed in all tables. * .RENAME LINK +----------------------------------------------------------------------+ | RENAME LINK link TO new_name | +----------------------------------------------------------------------+ Changes the name of the specified link to 'new_name'. * .RENAME TABLE +----------------------------------------------------------------------+ | RENAME TABLE table TO new_name | +----------------------------------------------------------------------+ Changes the name of the specified table to 'new_name'. * .REPORT +----------------------------------------------------------------------+ | REPORT | | report statements | | END | +----------------------------------------------------------------------+ Writes a report, to filename if it is given, otherwise to the current output. Report statements include: FOOTER Defines footer ... END