.ps 62,70 .lm 1 .flags bold .nf .nj .nap .keep .b 3 ^*@\* .tp 3 ^*Function:\* @ executes command files .tp 3 ^*Example:\* "@ procure.all" causes the execution of all commands in the command file procure.all (one command per line) .tp 3 ^*Syntax:\* @ .tp 3 ^*Comments:\* 1. Up to three levels of command files are supported. That is, one command file can call another which can in turn call a third. 2. When DBAG finishes executing all the commands in a file, it returns to its state prior to beginning execution of the file. 3. Normally, execution of a command file is done without interruptions and the result is shown on the screen. This mode can be changed with the "SET PAUSE ON" and "SET ECHO ON" commands. 4. The default extensions for command files are .bat or .cmd. For the command "@ procure", DBAG will look for the files "procure.bat" or "procure.cmd" in that order. .tp 3 ^*Related commands:\* SET PAUSE SET ECHO .pg .b 3 ^*APPEND\* .tp 3 ^*Function:\* APPEND transfers data. It can be used to: 1. Add new records directly to a data base 2. Add records to a disk file, using the structure of a data base. 3. Load records into a data base from a disk file. 4. Unload records from a data base to a disk file. .tp 3 ^*Examples:\* 1. "APPEND" transfers data from the terminal, using the DBAG editor, into the current or default data base. 1'. "APPEND TO personnel" transfers data from the terminal, using the DBAG editor, into the data base "personnel". 2. "APPEND TO personnel.rec" transfers data from the terminal, using the DBAG editor, to the file personnel.rec, with the structure of the current data base. 3. "APPEND FROM personnel.rec" transfers data from the file "personnel.rec" to the current data base. 3'. "APPEND FROM personnel.rec TO personnel" transfers data from the file "personnel.rec" to the data base "personnel" 4. "APPEND FROM personnel TO personnel.rec" transfers data from the data base "personnel" to the file "personnel.rec" .tp 3 ^*Formats:\* depending on the circumstances, there are options that can be used with the APPEND command Format 1: APPEND BLANKS TO BLANKS: adds a new record containing blanksto a data base without the need to call up the DBAG editor. Format 2: APPEND BLANKS TO OLD BLANKS: adds a new record containing blanks to a file without the need for the DBAG editor. OLD: if the specified file does not exist, it is created; if it exists, the record is added to it. Format 3: APPEND FROM TO BYNAME BYNAME: ignores field numbers, transferring the contents of the fields with the same name (mnemonic) in the file and in the data base Format 4: APPEND FROM TO OLD SCOPE FOR FIELDS OLD: if the file does not exist it is created; if it exists the data are appended at the end SCOPE: group of records under consideration for the APPEND FOR: logical condition to be met by the records in the SCOPE of the APPEND command FIELDS: list of fields to be appended The following default values apply to the APPEND command: SCOPE: if no SCOPE is included in the command the following are used in the order shown: - the "current search", if there is one - if there is no current search, all records in the data base are used FIELDS: if no list of fields is entered, all fields of each record are transferred .tp 3 ^*Syntax\* ( [ ] - optional, | - alternative ): 1. APPEND [ BLANKS ] [ TO ] 2. APPEND [ BLANKS ] TO [ DBAG ] [ NEW | OLD ] 3. APPEND FROM [ DBAG ] TO [ BYFIELDNUMBER | BYNAME ] 4. APPEND FROM TO [ [ SCOPE ] ] [ FOR ] [ FIELDS ] [ DBAG ] [ NEW | OLD ] N.B. - The options BYFIELDNUMBER: (transfer the contents of the fields with equal field numbers in the file and the data base) and NEW: (creates a new file) are always the default; the option DBAG: (format of disk file) is the only one presently implemented. .tp 3 ^*Comments:\* 1. "Performance" When one or more fields of a data base are indexed and a new record is added to the data base, DBAG always updates the index files. It can therefore be helpful to TEMPORARILY suspend this updating especially when you wish to load a large number of records. This will happen when you are restoring a data base from a disk file, for instance. Indexing should be re-activated and the data base re-indexed after restoration, so as to continue to take advantage of the benefits of indexing. The sequence for such anoperation would be as follows: SET INDEXES OFF APPEND FROM TO SET INDEXES ON REINDEX DATABASE 2. Assigning a number to a new record If the KILL command is not used, DBAG will assign a new sequential number to each new record. That is, as records are deleted, DBAG doen not re-use their record numbers. This mode is established when the structure of the data base is defined with the CREATE command, and can always be changed at any time with a MODIFY STRUCTURE command. .tp 3 ^*Related commands:\* CREATE KILL MODIFY STRUCTURE REINDEX SET INDEXES .pg ^*CANCEL\* .tp 3 ^*Funtion:\* CANCEL stops a "current search or a "current sort" of a data base. .tp 3 ^*Examples:\* 1. "CANCEL SEARCH" stops the "current search" of the current data base 2. "CANCEL SORT" stops the "current sort" .tp 3 ^*Syntax:\* \* ( [ ] - optional, | - alternative ): CANCEL SEARCH | SORT [ DATABASE ] The DATABASE option allows you to specify the desired data base. Omitting it directs the CANCEL to the current data base. .tp 3 ^*Observations:\* .tp 3 ^*Related commands:\* RESTORE SEARCH RESTORE SORT SAVE SEARCH SAVE SORT SEARCH SORT .pg ^*CLOSE\* .tp 3 ^*Function:\* the CLOSE command closes the data base .tp 3 ^*Examples:\* 1. "CLOSE" closes the current data base 2. "CLOSE personnel" closes the data base "personnel" .tp 3 ^*Syntax\* ( [ ] - optional ): CLOSE [ DATABASE ] .tp 3 ^*Observações:\* .tp 3 ^*Related commands:\* USE or OPEN .pg ^*COPY STRUCTURE\* .tp 3 ^*Function:\* the command COPY STRUCTURE creates a new data base with a structure identical to some existing data base. .tp 3 ^*Example:\* "COPY STRUCTURE FROM personnel TO personnel__2" copies the structure of the data base "personnel" to a new data base, "personnel__2" .tp 3 ^*Syntax:\* COPY STRUCTURE FROM TO .tp 3 ^*Observações:\* .tp 3 ^*Comandos relacionados:\* .pg ^*CREATE\* .tp 3 ^*Function:\* the CREATE command begins the definition of the structure of a data base. Normally, CREATE does not use the DBAG editor to define structure. But you can alter this mode by giving the SET SCREEN ON command first. .tp 3 ^*Example:\* "CREATE personnel" initiates the definition of a new data base called "personnel" .tp 3 ^*Syntax\* ( [ ] - optional ): CREATE [ ] .tp 3 ^*Observações:\* .tp 3 ^*Comandos relacionados:\* SET SCREEN .pg ^*DEFINE DISPLAY\* .tp 3 ^*Function:\* the DEFINE DISPLAY command initiates the process of defining a display format for the current data base. .tp 3 ^*Example:\* "DEFINE DISPLAY" .tp 3 ^*Syntax\* ( [ ] - optional ): DEFINE DISPLAY [ STANDARD ] .tp 3 ^*Observations:\* 1. DISPLAY sends data to the screen in a standard format, all fields that fit appear horizontally separated by a blank line. The size and type of the presentation is determined by the structure of the data base and each field is labeled above it with its name (mnemonic). 2. The DEFINE DISPLAY command allows you to use other forms of display. 3. You can return to the standard form by issuing the command DEFINE DISPLAY STANDARD. 4. In either case, you can suppress the field names with SET NAMES OFF and the blank line with SET RAW ON. .tp 3 ^*Related commands:\* RESTORE DISPLAY SAVE DISPLAY SET NAMES SET RAW .pg ^*DELETE\* .tp 3 ^*Function:\* the DELETE command totally deletes a data base. .tp 3 ^*Example:\* "DELETE DATABASE personnel" eliminates the data base "personnel", after requesting confirmation .tp 3 ^*Syntax:\* DELETE DATABASE or DELETE FILES .tp 3 ^*Observations:\* 1. Like other "destructive" commands, DELETE normally requires confirmation You can SET CONFIRM OFF if you wish to avoid confirmation(!!!) 2. The options DATABASE and FILES are identical here; they both indicate the data base to be deleted. .tp 3 ^*Related commands:\* SET CONFIRM .pg ^*LIST\* or ^*DISPLAY\* .tp 3 ^*Function:\* the commands DISPLAY and LIST show record structure in a data base, global state of DBAG, or the DBAG command buffer. These two commands are identical in all but one respect: - DISPLAY normally stops after each screen of data and waits for confirmation to continue. - LIST normally sends data until there is no more left. In practice you can use either one and modify how they work with the WAIT or NOWAIT options. To avoid repitions, we shoe examples for DISPLAY only. DISPLAY (or LIST) can be used to see: 1. The structure of a data base ( DISPLAY STRUCTURE ) 2. A record or a group of records ( DISPLAY ... ) 3. The data bases accesible at any time ( DISPLAY FILES ) 4. The global status of DBAG ( DISPLAY STATUS ) 5. The DBAG command buffer ( DISPLAY COMMANDS ) .tp 3 ^*Examples:\* 1. "DISPLAY STRUCTURE" shows on the terminal the structure of the current data base. 2. "DISPLAY 1, 2, 15" shows records 1, 2 and 15 of the current data base on the screen. 3. "DISPLAY FILES TO bases.lst" writes to the file "bases.lst" the list of accesible data bases. 4. "DISPLAY STATUS" sends to the terminal the characteristics and global status of DBAG (data bases in use, global limits, system parameter values, etc.) 5. "DISPLAY COMMANDS" lists on the screen the last 20 DBAG commands which can be accessed. Any result of the DISPLAY command can be directed to a file by using the TO option. .tp 3 ^*Formates:\* depending on the case, options may be added: Format 1: DISPLAY STRUCTURE DATABASE TO DATABASE: specifies which data base to use TO: sends output to a file Format 2: DISPLAY DATABASE TO SCOPE FOR SORT ON FIELDS OFF NOWAIT DATABASE: specifiesdesired data base TO: writes output to a file SCOPE: list of records to be considered FOR: logical condition to be met by records SORT ON: which fields to sort on FIELDS: list of fields to be considered in each record OFF: supress record numbers NOWAIT: show all records included as a resulr=t of the command immediately In this case, the following defaults are used: DATABASE: the current data base unless another is mentioned TO: output goes to the terminal unless a TO is included SCOPE: if no scope is specified one is chosen in this order: - the current search, if there is one - if there is no current search, but a FOR expression was used, then all ecords in the data base are used - if there is no current search and no FOR statement was included, then only the current record is used. - if there is no current record selected, then only the first record in the data base is used. SORT ON: if no sort is specified, records will be presented by order of their record numbers. FIELDS: if no fields are included, then all fields of each record are shown. OFF: unless OFF is used, each record will be listed with its record number NOWAIT: if this option is not used, DISPLAY stops after each screenful of data. The opposite is true for the LIST command. Examples: DISPLAY ALL stops after each screenful LIST ALL does not stop Format 3: DISPLAY FILES <"wild card"_> TO <"wild card"_>: "wild cards" are acceptable as follows; Examples: p_* all data bases beginning with the letter "p" p%%%%%l all data bases beginning with "p", ending with "l", and having a total of 7 characters TO: specifies the file to which the list is written If no "wild card" is specified, a list of all accessible data bases will be made, regardless of their names. Format 4: DISPLAY STATUS TO TO: DBAG status is written to the specified file Format 5: DISPLAY COMMANDS TO TO: the last 20 DBAG commands are writen to the specified file .tp 3 ^*Syntax\* ( [ ] - optional, | - alternative ): 1. DISPLAY or LIST STRUCTURE [ DATABASE ] [ TO ] 2. DISPLAY or LIST [ DATABASE ] [ TO ] [ [ SCOPE ] ] [ FOR ] [ SORT ON ] [ FIELDS ] [ ON | OFF ] [ WAIT | NOWAIT ] 3. DISPLAY or LIST FILES [ <"wild card"_> ] [ TO ] 4. DISPLAY or LIST STATUS [ TO ] 5. DISPLAY or LIST COMMANDS [ TO ] .tp 3 ^*Comments:\* 1. The WAIT and NOWAIT options have opposite default values, depending on the command: DISPLAY, by default, takes WAIT; LIST takes NOWAIT. 2. The DISPLAY command always considers a specific group of records from which to select the ones to be displayed. This group my or may not be affected by the "current search" set by the SEARCH command. If a "scope" is included in the command it will be used the same as if it were the "current search". 3. Records are always displayed by default in the standard format defined for the data base. This format can be modified at any time using the DEFINE DISPLAY or RESTORE DISPLAY commands. Since the definition of the display of a data base sets which fields are to be presented and how, the FIELDS option can only further restrict what is presented. A field that was not included in the original definition cannot be displayed with the FIELDS option. For example, if the display has been defined to show the fields NAME, SEX and SALARY, the command DISPLAY ALL FIELDS "sex, name, birth_date" would only display the fields SEX and NAME in that order. And thus, the command DISPLAY ALL would display NAME, SEX, and SALARY in that order. 4. In each record there is an implicitly defined field, the record number, which is indicated by "_#". As in the above example, unless this field were included in the definition of the "display", it will not be affected by the DISPLAY command. Thus the command "DISPLAY ALL FIELDS sex, name, birth_date, _#" will only display the fields SEX and NAME for a display as defined above. 5. In any case, the commands SET NAMES OFF and SET RAW ON can cancel the display of field names and the spaces between them respectively. .tp 3 ^*Related commands:\* DEFINE DISPLAY RESTORE DISPLAY RESTORE SEARCH SAVE DISPLAY SAVE SEARCH SEARCH SET NAMES SET RAW .pg ^*EDIT\* .tp 3 ^*Function:\* the EDIT command modifies records. This command uses the DBAG editor to modify a specific group of records. In general, the fields to be modified are loaded into the editor directly from the data base and, after being modified, re-written directly into the data base. Two variations are possible: - read from the data base the fields to be modified and write the modified data to an intermediate disk file - read the fields to be modified from a disk file and, after modifying them, re-write them directly to the data base The EDIT command can thus be used to: 1. Edit records loaded from a data base and return the results to that same data base. 2. Edit records loaded from a data base and return the results to a disk file. 3. Edit records loaded from a disk file and return the results directly into the data base. .tp 3 ^*Examples:\* 1. "EDIT 28" edits record number 28 from the current data base 1'. "EDIT 28 TO personnel" edits record number 28 from the data base "personnel" 2. "EDIT 28 FROM personnel TO personnel.rec" edits record number 28 in the data base "personnel" and puts the result into the file "personnel.rec" 3. "EDIT FROM personnel.rec TO personnel" edits the records previously stored in the file "personnel.rec" and re-writes the result to the data base "personnel" .tp 3 ^*Formats:\* depending on the case, there are some options that can be used: Format 1: EDIT TO SCOPE FOR FIELDS TO: indicates the source AND the target of the records to be edited SCOPE: group of records to be considered FOR: logical FOR to be applied to the reocrds in the scope FIELDS: list of fields to be edited In this case, the following default values are used: TO: if no data base is specified, the current data base is used as the source and target SCOPE: if no scope is specified, it is determined in the following order: - the "current search", if there is one - if there is none, then all records in the data base FIELDS: if no list of fields is specified, all fields of each record are made available for editing. Formato 2: EDIT FROM TO OLD SCOPE FOR FIELDS FROM: indicates the source of the records to be edited TO: indicates the target for the edited files OLD: if the file does not exist, create it; if it does exist, append to it SCOPE: group of records to be considered FOR: logical FOR to be applied to the records in the scope FIELDS: list of fields to be edited In this case, the following default values are used: TO: if no data base is specified, the current one is used as source and target for editing SCOPE: if no scope is specified, it is determined in the following order: - the "current search", if there is one - if there is none, then all records in the data base FIELDS: if no list of fields is specified, all fields of each record are made available for editing. Formato 3: EDIT FROM TO FIELDS FROM: indicates the source of the records TO: indicates the target for the records FIELDS: list of fields to be edited In this case, the following defaults are used: TO: if no data base is specified, the current one is used as source and target for editing FIELDS: if no list of fields is specified, all fields of each record are made available for editing. .tp 3 ^*Syntax\* ( [ ] - optional, | - alternative ): 1. EDIT [ TO ] [ [ SCOPE ] ] [ FOR ] [ FIELDS ] 2. EDIT FROM TO [ [ SCOPE ] ] [ FOR ] [ FIELDS ] [ DBAG ] [ NEW | OLD ] 3. EDIT FROM TO [ [ SCOPE ] ] [ FOR ] [ FIELDS ] [ DBAG ] N.B. - The NEW option, create a new file, is always the default; the DBAG option, format of the disk file, is currently the only option implemented. N.B. - A opção NEW: criar um file novo, é sempre tomada "por defeito"; a opção DBAG: formato do file em disco, é actualmente a única que está implementada. .tp 3 ^*Observations:\* .tp 3 ^*Related commands:\* RESTORE SEARCH SAVE SEARCH SEARCH .pg ^*EDT\* .tp 3 ^*Function:\* the EDT command calls the VMS EDT editor directly to edit a disk file. .tp 3 ^*Examples\* "EDT procure.cmd" edits the disk file "procure.cmd" .tp 3 ^*Syntax:\* EDT < file _> .tp 3 ^*Observations:\* .tp 3 ^*Related commands:\* .pg ^*QUIT\* or ^*EXIT\* .tp 3 ^*Function:\* the EXIT and QUIT end an interactive DBAG session, returning the user to the operating system. .tp 3 ^*Examples:\* "EXIT" abandons DBAG and returns to VMS .tp 3 ^*Syntax:\* EXIT or QUIT .tp 3 ^*Observations:\* .tp 3 ^*Related commands:\* .pg ^*\*, ^*RECORD \* or ^*GOTO \* .tp 3 ^*Function:\* the commands , RECORD and GOTO make record "n" of the current data base the current record. .tp 3 ^*Example:\* "12", "RECORD 12" and "GOTO 12" make record number 12 of the current data base the current record. ^*Syntax\* ( [ ] - optional ): [ RECORD ] or GOTO .tp 3 ^*Observations:\* .tp 3 ^*Related commands:\* .pg ^*_?\* or ^*HELP\* ^*Function:\* the commands HELP and _? give help on the interactive commands of DBAG. .tp 3 ^*Examples:\* 1. "HELP zero" or "? zero" send to the terminal a description of the functions and usage of the ZERO command. 2. "HELP" lists all the DBAG commands 3. "HELP _* TO help.doc" writes an explanation of all DBAG commands to the disk file "help.doc" .tp 3 ^*Syntax\* ( [ ] - optional, | - alternative ): HELP or _? [ _* | ] [ TO ] .tp 3 ^*Observations:\* 1. If "_*" is entered as an argument to HELP, a description of all DBAG commands is sent to the terminal. 2. The TO option instructs DBAG to write the results of the HELP command to a disk file. .tp 3 ^*Related commands:\* .pg ^*INDEX\* ^*Function:\* the INDEX command applied to the field of a data base allows that record to be accessed through an index table. Declaring a field to be indexed can result in faster searches of the particular data base for logical conditions of equality or inequality. .tp 3 ^*Extension:\* In the case of text fields there is an index option called KWIC: for key-words separated by spaces. This extension allows for the search of records whose fields (of type character) contain a key-word from a specified list. .tp 3 ^*Examples:\* 1. "INDEX ON FIELD birth_date" declares the field birth_date of the current data base as an indexed field. 2. "INDEX KWIC ON FIELD name" declares the field "name" of the current data base to be indexed for key_words. .tp 3 ^*Syntax\* ( [ ] - optional): INDEX [ KWIC ] [ DATABASE ] [ ON [ FIELDS ] ] .tp 3 ^*Observations:\* 1. The DATABASE option indicates which data base the command acts on. 2. If no list of fields is entered, DBAG indexes each field but only after requesting confirmation. 3. The KWIC option defines the fields to be indexed by key_word. Example: - the command "INDEX KWIC ON FIELD name" makes the field "name" searchable by key_word. - the command "DISPLAY ALL FOR name = 'Louis', 'Anthony' shows all records in the data base which have at least the text 'Louis' or 'Anthony' in th field "name". .tp 3 ^*Related commands:\* NOINDEX REINDEX SET INDEXES .pg ^*JOIN\* .tp 3 ^*Function:\* the JOIN command creates a new data base from two existing data bases. This command combines records of two data bases into a new data base by associating one or more records of the first data base with one or more of the second according to some chosen criteria. The new data base contains records made up of some or all of the fields of the selected records in the original data bases, as determined by the selection criteria. .tp 3 ^*Examples:\* 1. "JOIN personnel WITH moradas TO personnel__m JFOR code = code__m" associates all records in the data base "personnel" having the field "code" equal to a certain value with all records in the data base "morada" whose field "code__m" has the same value. A new data base named "personnel__m" is then formed form these two groups of records. 2. "JOIN personnel FIELDS sex, name WITH moradas FIELDS state, city, zip_code TO personnel__m JFOR code = code__m" differs from Example 1. by restricting the fields to be included in the records of the new data base to 2 from the first data base (sex, name) and 3 from the second (state, city, zip_code). 3. "JOIN personnel ALL FOR sex = 'M' WITH moradas TO personnel__m JFOR code = code__m", is also a variation on Example 1. in which the JOIN command will only act on those records of "personnel" for which the field "sex" has the value "M". As can be seen from the examples, the JOIN command always has two functions: to select from the source data bases the records to be joined, and to restrict the fields to be included in the new data base. .tp 3 ^*Syntax\* ( [ ] - optional ): 1. JOIN [ DATABASE ] [ [ SCOPE ] ] [ FOR ] [ FIELDS ] WITH [ DATABASE ] [ [ SCOPE ] ] [ FOR ] [ FIELDS ] TO [ DATABASE ] [ JFOR ] .tp 3 ^*Observations:\* 1. The target data bases are those named after the JOIN and WITH parts of the command string. 2. The new data base to be created is specified after TO. 3. The SCOPE and FOR options select the records from the source data bases; The FIELDS option restricts the fields to be copied to the new data base from the respective source data bases. SCOPE: lista de "scopes" (conjunto de records) a considerar FOR: expressão lógica validada para os records do SCOPE FIELDS: lista de campos a copiar The following default values apply: SCOPE: if none is specified, it is established in this order: - the "current search:, if one is defined - otherwise, all records in the data base FIELDS: if no fields are mentioned, all fields of each record are included 4. The JFOR option defines the criteria by which the records of the two source data bases are united in the new data base. JFOR: logical expression valid for the records in each of the two source data bases In this case, the following default applies: JFOR: if no JFOR statement is included, ALL the possible combinations among the selected records of each data base are used to create the new data base(!!!). 5. The new data base will have the general characteristics of the first data base, and the fields will take the definitions of the source fields. If there are fields in the two data bases with identical names (mnemonics), DBAG requests new names for these, in order not to have duplicate field names in the new data base .tp 3 ^*Related commands:\* SEARCH RESTORE SEARCH .pg ^*KILL\* .tp 3 ^*Function:\* the KILL command removes records from a data base N.B. - The contents of the records specified in the KILL command are IRRETRIEVABLY removed from the data base. .tp 3 ^*Examples:\* 1. "KILL 9,125, 68" deletes records numbers 9, 68 and 125 from the current data base 2. "KILL 12 DATABASE personnel" deketes record number 12 from the data base "personnel" 3. "KILL ALL FOR sex = 'M'" deletes all records in the current data base whose field SEX is equal to "M". .tp 3 ^*Syntax\* ( [ ] - optional ): KILL [ DATABASE ] [ [ SCOPE ] ] [ FOR ] .tp 3 ^*Observations:\* 1. As with other commands of a destructive nature, KILL normally requires confirmation. This may be supressed by using the command SET CONFIRM OFF. 2. Options: DATABASE: SCOPE: FOR: The following default values are used: DATABASE: if no base is specified, the "current" one is used SCOPE: if no scope is specified, the "current search" is used; if there is no current search, a scope must be specified. 3. If records are deleted, their numbers are generally re-used when new records are loaded into the data base. For example, in a data base with 20 records, if records 12 and 14 were deleted, new records (added with APPEND) would be numbered 12, 14, 201, 202, etc. However, if you do not wish to re-use numbers, you can modify this characteristic with the MODIFY STRUCTURE command. .tp 3 ^*Related commands:\* SET CONFIRM MODIFY STRUCTURE .pg ^*MODIFY STRUCTURE\* .tp 3 ^*Function:\* the MODIFY STRUCTURE command modifies the structure of a data base. This command uses the DBAG editor to modify data base structure. .tp 3 ^*Examples:\* 1. "MODIFY STRUCTURE" modifies the structure of the current data base. 2. "MODIFY STRUCTURE TO personnel" modifies the structure of the data base "personnel". .tp 3 ^*Syntax\* ( [ ] - optional ): MODIFY STRUCTURE [ TO ] .tp 3 ^*Observations:\* 1. If the data base is empty, any of its characteristisc may be modified. 2. If the data base already has data loaded into it, only characteristics which do not conflict with those of existing records may be modified. For example, the general description of the data base or its records, field names (mnenomics), default values, maximum and minimum values, may all be modified. 3. If it is necessary to edit other characteristics of a data base which has existing records, these records should be stored in a disk file. The data base can then be emptied, the modifications performed, and the data re-loaded from the disk file, This operation can be done with the following set of commands: i. APPEND ALL FROM to (empty the data base to a disk file) ii. ZERO DATABASE (delete all records from the data base) iii. MODIFY STRUCTURE TO (make the required modifications) iv. APPEND FROM TO (re-load the records into the data base) .tp 3 ^*Related commands:\* .pg ^*NOINDEX\* ^*Function:\* the NOINDEX command removes the INDEX characteristic from a record and deletes the corresponding index table. The only consequence of using this command would be a small increase in the speed of searching records in the particular data base, due to the removal from the disk of the index tables. .tp 3 ^*Example:\* "NOINDEX ON FIELD birth_date" removes the index characteristic from the field birth_date in the current data base. Note that the INDEX command can be used at any time to re-instate this characteristic. .tp 3 ^*Syntax\* ( [ ] - optional): NOINDEX [ DATABASE ] [ ON [ FIELDS ] ] .tp 3 ^*Observations:\* 1. The DATABASE option indicates the desired data base. 2. If no list of fields is given, DBAG requests confirmation before indexing each field. .tp 3 ^*Related commands:\* INDEX SET INDEXES .pg ^*NEWS\* ^*Function:\* NEWS displays notices on changes in DBAG of interest to all users, such as new commands or features. .tp 3 ^*Examples:\* 1. "NEWS" gives a list of all news. 2. "NEWS _* TO news.doc" writes all news to the file "news.doc" 3. "NEWS bugs" lists at the terminal the known, uncorrected errors in DBAG. .tp 3 ^*Syntax\* ( [ ] - optional, | - alternative ): NEWS [ _* | ] [ TO ] .tp 3 ^*Observações:\* 1. "_*" gives a list of all news. 2. TO indicates that the results should be written to a file. .tp 3 ^*Related commands:\* .pg ^*PAUSE\* .tp 3 ^*Function:\* PAUSE causes a halt to the execution of a command file. Two choices exist for the action of this command: - continue execution at the following command line - stop execution of the command file .tp 3 ^*Syntax\*: PAUSE .tp 3 ^*Observations:\* 1. This command can be inserted between any lines in a command file in order to control the continuation of the command file. For example, if you wish to do a search and then write the results to a file, you could do it with the following command file: OPEN personnel SEARCH ALL FOR sex = 'M' PAUSE DISPLAY TO personnel.m and execute it with the command @file_name. At the pause you can see how many records were selected and then decide whether to create the file "personnel.m" 2. The same result may be obtained through the "SET PAUSE ON" command, which halts execution after each command line without the need of inserting PAUSE commands in the command file at all. .tp 3 ^*Related commands:\* @ SET PAUSE .pg ^*UP\* or ^*RECALL\* .tp 3 ^*Function:\* the UP and RECALL commands permit access to the last 20 interactive commands given to DBAG. They use the DBAG editor adapted to the editing an execution of the last 20 commands. .tp 3 ^*Examples:\* "RECALL" as in VMS, recalls the last interactive command for editing or execution .tp 3 ^*Syntax:\* RECALL or UP [ ] .tp 3 ^*Observations:\* 1. Commands can be recalled by their number in the 20-command buffer or by an unambiguous abbreviation of the actual command. Examples: RECALL 10 accesses the tenth command in the buffer RECALL DISP accesses the last command which began with DISP 2. To see all the commands ion the buffer, use DISPLAY COMMANDS. .tp 3 ^*Related commands:\* DISPLAY COMMANDS RESTORE COMMANDS SAVE COMMANDS .pg ^*REINDEX\* ^*Function:\* REINDEX recalculates the indices for any indexed field in a data base. Indexed fields can be temporarily deactivated (SET INDEXES OFF) in order to speed up large APPEND or REPLACE operations. REINDEX may be used to return the indices to a usable state after re-activating them with the command SET INDEXES ON. .tp 3 ^*Example:\* "REINDEX" re-calculates the index tables of the indexed fields of the current data base, requesting confirmation field by field. .tp 3 ^*Syntax\* ( [ ] - optional): REINDEX [ DATABASE ] [ ON [ FIELDS ] ] .tp 3 ^*Observations:\* 1. The DATABASE option indicates the data base to use. 2. If no list of fields is given, DBAG requests confirmation before re-indexing each field of the data base. .tp 3 ^*Related commands:\* APPEND INDEX NOINDEX REPLACE SET INDEXES .pg ^*REPLACE\* .tp 3 ^*Function:\* REPLACE modifies records in a data base using data in a disk file. This command directly modifies the records in a data base with data in a disk file, without calling the DBAG editor. It substitutes in the corresponding records of the data base the values for each field contained in the file. .tp 3 ^*Examples:\* 1. "REPLACE FROM personnel.rec TO personnel" reads values from the file "personnel.rec" and imposes those values on the corresponding records and fields of the data base "personnel". 1'. "REPLACE FROM personnel.rec TO personnel FIELDS name" only reads the values for the field "name" from the disk file "personnel.rec" and imposes those values on the same field of the corresponding records in the data base "personnel". .tp 3 ^*Syntax\* ( [ ] - optional ): REPLACE FROM [ DBAG ] [ TO ] [ FIELDS ] N.B. - The option DBAG: disk file format, is currently the only one implemented. .tp 3 ^*Observations:\* FROM: indicates the origin of the values for the fields(file) TO: indicates the target for the new values(data base) FIELDS: list of fields to consider The following default values are used: TO: if no data base is given, the current one is used as the target. FIELDS: if no list is given, all fields are considered. .tp 3 ^*Related commands:\* .pg .b 3 ^*RESTORE\* .tp 3 ^*Function:\* RESTORE restores a DBAG context from a disk file where it had previously been saved (with a SAVE command) It can be used to restore 1. The "current search" as set by the SEARCH command. 2. The "current sort" as set by the SORT command. 3. The "current display" as set by the DEFINE DISPLAY command. 4. The DBAG command buffer .tp 3 ^*Examples:\* 1. "RESTORE SEARCH FROM saved.src" restores the "current search" of the current data base using the file "saved.src". 2. "RESTORE SORT FROM saved.srt" replaces the "current sort" of the current data base using the file "saved.srt". 3. "RESTORE DISPLAY FROM saved.dsp" replaces the "current display" of the current data base using the file "saved.dsp". 4. "RESTORE COMMANDS FROM saved.cms" replaces the DBAG: commandrepõe o "buffer" de buffer using the file "saved.cms". .tp 3 ^*Syntax\* ( | - alternative ): RESTORE SEARCH | SORT | DISPLAY | COMMANDS FROM .tp 3 ^*Observations:\* .tp 3 ^*Related commands:\* DEFINE DISPLAY SAVE SEARCH SORT .pg .b 3 ^*SAVE\* .tp 3 ^*Function:\* the SAVE command stores in a disk file one of the contexts of DBAG. The context can be restored later by the RESTORE command. SAVE can be used to save to a disk file: 1. The "current search" as set by the SEARCH command. 2. The "current sort" as set by the SORT command. 3. The "current display" as set by the DEFINE DISPLAY command. 4. The DBAG command buffer .tp 3 ^*Examples:\* 1. "SAVE SEARCH TO saved.src" puts into the file "saved.src" the "current search" of the current data base. 2. "SAVE SORT TO saved.srt" puts into the file "saved.srt" the "current sort" of the current data base. 3. "SAVE DISPLAY TO saved.dsp" puts into the file "saved.dsp" the "current display" of the current data base. 4. "SAVE COMMANDS TO saved.cms" puts into the file "saved.cms" the DBAG command buffer (the last 20 commands) .tp 3 ^*Syntax\* ( | - alternative ): SAVE SEARCH | SORT | DISPLAY | COMMANDS TO .tp 3 ^*Observations:\* .tp 3 ^*Related commands:\* DEFINE DISPLAY RESTORE SEARCH SORT .pg ^*SEARCH\* .tp 3 ^*Function:\* the SEARCH command makes a selection from the records of a data base and records the selected record numbers as the "current search" of that data base. .tp 3 ^*Examples:\* 1. "SEARCH ALL" selects all the records of the current data base as set by the "current search". 1'. "SEARCH ALL DATABASE personnel" sets all the records of the data base "personnel" to be the "current search". 2. "SEARCH ALL FOR sex = 'M'" sets all the records of the data base "personnel" with the field SEX equal to "M" to be the "current search". .tp 3 ^*Syntax\* ( [ ] - optional, | - alternative ): SEARCH [ DATABASE ] [ [ SCOPE ] ] [ FOR ] .tp 3 ^*Observations:\* DATABASE: specifies the data base to be used SCOPE: list of records to be considered FOR: logical expression for records in the scope The following default values are used: DATABASE: if none is mentioned, the current data base is used. SCOPE: if no scope is given, it is determined as follows: - the current search of the data base, if it is defined - otherwise, all records in the data base .tp 3 ^*Related commands:\* CANCEL SEARCH RESTORE SEARCH .pg ^*SET\* .tp 3 ^*Function:\* the SET command permits the modification of various parameters of the system. .tp 3 ^*Examples:\* 1. "SET NAMES OFF" eliminates field labels from the display, so that only their contents appear. 2. "SET WIDT TO 132" changes width of the terminal screen to 132 columns. 3. "SET ALTERNATE TO dbag.log" records in the file "dbag.log" the activity of an interactive session. .tp 3 ^*Syntax\* ( [ ] - optional, | - alternative ): 1. SET ON | OFF 2. SET [ TO ] - List of parameters which can be set ON or OFF: ALTERNATE When ON, records the interactive session in the file currently identified by the command SET ALTERNATE TO . Default state: OFF BELL When ON, DBAG beeps if there is an attempt to load an invalid value or one that is too big for the allowed space. Default state: ON CARRY When ON, APPEND will transport the data in the current record to the following record. Default state: OFF COLON When ON, the DBAG editor automatically encloses each field being edited with the character defined by the SET COLON TO command. Default state: ON CONFIRM When OFF, some interactive commands DO NOT REQUEST CONFIRMATION (JOIN, KILL, ZERO, and DELETE ) Default state: ON ECHO When ON, command file execution and messages are sent to the screen. Default state: ON HEADER When ON, DBAG shows in the first line of the screen some general information: data base, record, search and current sort. Default state: ON INDEXES When OFF, the system for indexing fields is NOT activated and the corrsponding index tables are neither used nor updated. Default state: ON INTENSITY When ON, the DBAG editor puts fields being edited in reverse video. Default state: ON NAMES When ON, field names (mnemonics) are included in the display. Default state: ON PADDING When ON, the DBAG editor shows empty parts of each field to be filled with the character currently defined by the SET PADDING TO command. Default state: ON RAW When ON, fields are displayed separated by a blank space. dados. Default state: OFF SCREEN When ON, manipulation of the structure of a data base is always done with the DBAG editor (CREATE, DISPLAY STRUCTURE, and MODIFY STRUCTURE). Default state: OFF TALK When OFF, DBAG send nothing to the terminal except during use of its editor. Default state: ON VERIFY When ON, any manipulation of records in a data base is preceeded by a verification of those records, with the exclusion of any records previously deleted with a KILL command. Default state: OFF - List of parameters to which values can be attributed: ALTERNATE sets the name of the file where the session activity is recorded Default value: 'DBAG.ALT' COLON sets the delimiter used by the DBAG editor to separate fields of a record. Default value: ':' PADDING sets the character to be used by the DBAG editor when pre-loading fields. Default value: '__' PROMPT sets the DBAG prompt Default value: 'BAG_>' WIDTH sets the width of the screen (80 or 132). Default value: 80 .tp 3 ^*Observations:\* 1. All DBAG parameters have a default value. 2. Normally, the user only modifies the parameters that influence presentation of data (SET NAMES and SET RAW), control screen width (SET WIDTH), or alter characteristics of the DBAG editor (SET BELL, SET COLON, SET INTENSITY, and SET PADDING). 3. Note that the following parameters can have negative impact on the performance of DBAG or can seriously affect your data: INDEXES - "SET INDEXES OFF" temporarily suspends the DBAG indexing system entirely: it should only be used to speed up the loading or editing of large records ( with the APPPEND or REPLACE commands). Be sure to re-activate it at once and then RE-INDEX the affected data base (SET INDEXES ON and REINDEX commands). CONFIRM - "SET CONFIRM OFF" suspends the mandatory confirmation for JOIN (which can create new data bases of unexpected dimensions), as well as KILL, ZERO, and DELETE (which can cause the permanent loss of data as well as entire data bases...). VERIFY - "SET VERIFY ON" will cause a verification of all records with respect to records accidentally deleted by KILL commands(?). For example, the commands DISPLAY ALL will make this verification before displaying any of the records in the data base. Execution time could double under these circumstances! .tp 3 ^*Related commands:\* .pg ^*SORT\* ^*Function:\* SORT performs an ordering of the records in the "current search" allowing their examination in an orderly manner. .tp 3 ^*Examples:\* 1. "SORT ON birth_date" ordes the "curernt search" of the current data base by ascending order of the field BIRTH_DATE. 2. "SORT DATABASE personnel ON BIRTH_DATE d, CODE" orders the "current search" of the data base "personnel" by the field BITRH_DATE in descending order and by the field CODE in ascending order. .tp 3 ^*Syntax\* ( [ ] - optional): SORT [ DATABASE ] ON [ FIELD ] .tp 3 ^*Observations:\* 1. The DATABASE option indicates which data base to use. 2. Fields will be sorted in ascending order (the default) when followed by an A, in descending order when foillowed by a D. .tp 3 ^*Related commands:\* RESTORE SORT SAVE SORT SEARCH .pg ^*TPU\* .tp 3 ^*Function:\* TPU calls the TPU editor directly to edit a disk file. .tp 3 ^*Example:\* "TPU procure.cmd" edits the disk file "procure.cmd" .tp 3 ^*Syntax:\* TPU < file _> .tp 3 ^*Observations:\* .tp 3 ^*Related commands:\* .pg ^*OPEN\* or ^*USE\* .tp 3 ^*Function:\* the OPEN or USE commands open a data base, i.e., they make it the current data abse. .tp 3 ^*Example:\* "OPEN personnel" make "personnel" the current data base. .tp 3 ^*Syntax\* ( [ ] - optional, | - alternative ): USE [ DATABASE ] [ UPDATE | NOUPDATE ] .tp 3 ^*Observações:\* 1. The DATABASE option indicates which data base to use. 2. The UPDATE (open a data base for editing) and NOUPDATE (open a data base read-only) options need not be used since DBAG automatically re-opens a data base for update when necessary. (?) .tp 3 ^*Related commands:\* CLOSE .pg ^*VMS\* .tp 3 ^*Function:\* the VMS command allows the execution of any VMS system command without the need to leave DBAG. .tp 3 ^*Example:\* "VMS type bases.lst" executes the VMS command "type bases.lst" and returns to DBAG afterwards. .tp 3 ^*Syntax:\* VMS < DCL command _> .tp 3 ^*Observations:\* .tp 3 ^*Related commands:\* .pg ^*ZERO\* .tp 3 ^*Function:\* the ZERO command deletes ALL the records of a data base N.B. - The contents of ALL records in the data base are PERMANENTLY lost. .tp 3 ^*Example:\* "ZERO DATABASE personnel" deletes the records of the data base "personnel" after requesting confirmation .tp 3 ^*Syntax:\* ZERO DATABASE or ZERO FILES .tp 3 ^*Observations:\* 1. As with other "destructive" commands, ZERO demands confirmation. Confirmation can be suppresed by using the SET CONFIRM OFF command. 2. The DATABASE and FILES options have the same function; to designate unambiguously the data base whose files are to be deleted. .tp 3 ^*Related commands:\* SET CONFIRM .f .j .ap .no keep