.ap .flags bold .sp 2 .spr 4,1,3 .b 3 ^*1. Introduction to Interactive Use .b 3 ^*Definition of the structure of a record [CREATE]\* .b To define a record, use the CREATE command. For example, the command "CREATE personnel" initiates the definition of a data base called "personnel". .b A record is defined by its fields which can be of the following types: .nf .nj .b c - character ex: Antonio Carlos .b n - integer ex: -128, 200 ... .b x - floating point ex: -12.3, 120.0 .b d - data ex: 10-jan-85 .b l - logical ex: t (true) f (false) .b db - another data base ex: 12 .f .j .b For the first three types (characters, and integer and floating point numbers) it is also necessary to define their total size and, in the case of floating point numbers, the maximum number of decimal places that can appear to the right of the decimal point. .b In the case of logical records or fields, the size need not be specified since DBAG imposes the values of 11 and 1 respectively. (?) .b The type "other data bases" is used to combine different bases and will be covered in the section on "linking two data bases by explicit reference". .b Each field will also have a name, or nmemonic, meant to completely identify that field of the record. Note that to make an explicit reference to any field, you can also use its sequential ORDER NUMBER in the definition of the record. That is, the first field can be referred to as %1 (field no. 1), the second as %2 )field no. 2), etc. .b You can also assign a "default value" to each field, that is, a value that will be assigned automatically, unless it would fill the file. .b Example of a record: .nf .nj .b field 1: code, integer, size = 4 .b 2: name , character, size = 18 .b 3: birth_date, data .b 4: sex , character, size = 1 "default" value = 'M' .b 5: salary , floating point, size = 7, decimal pts. = 1 .f .j .b In addition to the above-mentioned characteristics, you can assign a generic description to a record as well as to each one of its fields. From the time data is loaded into the data base, each occurance of a record is assigned a sequential number, beginning usually with 1. However, at the time you "CREATE" the data structure you can indicate that the numbering begin with another number, 100 for instance, etc. .b In addition, for each field, you can - make it mandatory (a value must be assigned to it) - assign a default value to it. .b Finally, in the case of integers, floating point numbers or data, errors in filling the fields should be avoided by defining upper and lower limits. For example, the record shown above could be "code from 1 to 9999", "birth_date from 1-jan-1900 to 31-dec-1999", "salary from 15000.0 to 50000.0". .b 2 .tp 14 ^*Making a data base "current" [ USE or OPEN ]\* .b In order to speed command entry, the majority of commands can be issued without indicating the data base to which they apply. .b ^*Example:\* the command "DISPLAY STRUCTURE" displays on the terminal the structure of the "current data base", if there is one. If there is none, DBAG requests the name of the data base you wish to make "current". .b To make a data base "current" issue the USE (or OPEN) command. .b ^*Example:\* the command "USE personnel" makes the data base "personnel" current. .b Thus, a simple way to use most of the commands in DBAG is to precede them with the command USE. .b ^*Example:\* The series of commands "USE personnel" and "DISPLAY STRUCTURE" displays on the terminal the structure of the data base "personnel" even if some other data base is "current". .b Nevertheless, you can also indicate within the command itself which data base you wish to display on the terminal by using the word DATABASE. .b ^*Example:\* the command "DISPLAY STRUCTURE DATABASE personnel" displays on the terminal the structure of the data base "personnel". .b 2 .tp 14 ^*Viewing a data base structure [ DISPLAY or LIST ]\* .b To view the structure of a data base use the command DISPLAY, followed by the word STRUCTURE. .b You can still indicate in the command the data base you wish to see with the word DATABASE. .b ^*Example:\* the command "DISPLAY STRUCTURE DATABASE personnel" displays the structure of the data base "personnel" on the terminal. .b The name of the data base appears on the first line in the description of the structure - PERSONNEL - and, in parenthesis, the indication "[#]PERSONNEL" appears. This is the name of the disk file in the user's default area which contains the data comprising the data base. Thus, the data base itself can be referred to by any logical name you wish. For more details see the section covering initialization by ".INI" files. .b DISPLAY presents data a screen at a time, waiting for you to indicate whether to continue. The LIST command sends data to the terminal continuously until the end of the file. .b 2 .tp 14 ^*Loading of data into a data base [ APPEND ]\* .b The loading of data into a data base is always done using the APPEND command which adds the data to NEW RECORDS added on to the data base. Thus, if three new records are added to a data base which was previously empty, the new records will use the first three record numbers. If you load more data, the fourth, fifth, etc. numbers will be used. .b ^*Example:\* the command "APPEND TO personnel" requests that the data in the records be added to the data base "personnel". .b The command APPEND can include the words FROM and TO, to indicate where data is located to begin with and to where you wish to move it. If FROM is left out, it is assumed that data are to be entered directly from the teminal. .b Although data are normally loaded directly into the data base, they can be loaded into an intermediate file on disk and, at a later time loaded into the data base using the APPEND command. .b 2 .tp 14 ###^*Interactive use\* .b Interactive input of data uses an editor similar to EDT, producing one file per line. You will use editing commands similar to those of EDT when you use the DBAG editor, such as "CTRL_Z EXIT" or "CTRL_Z QUIT" to leave the editor. .b Each field introduced is verified both as to type (for example a numeric field can only accept numbers) and limits, when they exist. Whenever a field has a default value defined, this value is attributed to the field automatically. .b As with other DBAG commands, you can restrict the fields you wish to fill by using the word FIELDS. Unspecified fields will remain empty unless they have some default value. .b 2 .tp 14 ######^*Directly into the data base\* ^*Example:\* the command "APPEND TO personnel" asks the user for the data in the records to be added to the data base "personnel". .b 2 .tp 14 ######^*With an intermediate file\* .b If instead of loading data directly into a data base, you decide to create an intermediate file, all is as in the previous example with the exception that the data will be loaded into that file instead of being loaded into the data base. .b As there can be more than one data base defined at any time, the "APPEND" command should be preceded by the "USE" command in order to identify the data base intended for use. .b ^*Example:\* the series of commands "USE personnel" and "APPEND TO personnel.rec" asks the user for the data to be written to the file "personnel.rec". .b 2 .tp 14 ###^*Loading data from disk files .b You can load data into a data base from files on disk, using the command APPEND with TO (data base) and FROM (file). The disk file should be created by the APPEND command as well. .b ^*Example:\* the command "APPEND TO personnel FROMM personnel.rec loads into the data base "personnel" the data previously loaded into the file "personnel.rec". .b 2 .tp 14 ^*Unloading data from a data base [ APPEND ]\* .b The unloading of data is always done with the APPEND FROM (data base) TO (file) command. .b ^*Example:\* the command "APPEND FROM personnel TO personnel.rec unloads into the file personnel.rec the records from the data base "personnel". .b 2 .tp 14 ^*Displaying the contents of a data base [DISPLAY or LIST ]\* .b To see the data loaded into a data base use the DISPLAY command. .b This command, perhaps the most used interactive one, can carry out almost any query of a data base ( e.g. show a group of records all meeting some determined criterion). .b You indicate the desired data base with the DATABASE command. .b ^*Example:\* the command "DISPLAY ALL DATABASE personnel" shows on the terminal all the records of the data base "personnel". .b You will ordinarily indicate in this command which records you wish to see in two different ways. These can be used alone or in combination: - restricting the display to a specific group of records through specification of a SCOPE: .nf .nj .b ALL all the records in the data base; .b 100:150 records 100 through 150 inclusive; .b 100, 104, 101 just records 100, 101, and 104. .f .j - specifying one or more logical conditions to be met by the fields defined by a FOR condition and related by unions (.OR) or intersections (AND.). .b Examples: .nf .nj .b DISPLAY ALL FOR birth_date _>= 1/11/67 .AND. birth_date <= 31-dec-1978 .f .j shows all records with the field birth_date greater than or equal to Nov. 1, 1967 and less than or equal to Dec. 31, 1978. .nf .nj .b DISPLAY 100:150 FOR ( %5 _> 90000.0 .AND. sex='M' ) .OR. ( salary _> 80000.0 .and. %4='F' ) .f .j shows, for records numbered from 100 to 150, those that have field number 5 greater than 90000.0 and field "sex" = M or those with field "salary" greater than 80000.0 and field number 4 = F. .b As we have said, the command DISPLAY acts on a group of records that are defined by: 1) a range such as ALL; 2) a FOR statement valid for the records contained in that range definition. .b Another way to define a range for a data base is by using the SEARCH command to initiate a search of a data base. The results of a SEARCH of a data base can be used to define a range for that data base. For more details, see the section on "Searching within a Data Base". .b DISPLAY presents data a screen at a time, waiting for you to indicate whether to continue. The LIST command sends data to the terminal continuously until the end of the file. .b 2 .tp 14 ^*Modifying the contents of a data base\* .b Data can be corrected in two ways: - using the editor to correct records with the EDIT command; - using new data from a disk file with the REPLACE command. .b 2 .tp 14 ###^*Using the editor [ EDIT ]\* .b ^*Example:\* the command "EDIT TO personnel" calls the DBAG editor to modify records in the data base "personnel". .b As is done when viewing records, a range can be specified along with one or more logical conditions to be imposed on the fields of the records. Consult the section "Displaying the data in a data base" .b ^*Example:\* the command EDIT 120:130 TO personnel" calls up the editor in order to modify records 120 through 130 inclusive in the data base "personnel". .b 2 .tp 14 ###^*Using disk files [ REPLACE ]\* .b ^*Example:\* the command "REPLACE TO personnel FROM personnel.rec" modifies the records in the data base "personnel" with values contained in the file personnel.rec. .b TO and FROM are used to indicate which data base is to be modified and which file on disk the new data are to be taken from. .b You can use this command as an alternative to using EDIT whenever you have an appropriate file on disk with data you wish to put into the data base. .b For example, you can unload some records from a data base into a disk file with the APPEND command, leave DBAG and use EDT to modify the data, re-enter DBAG and modify the records of the data base with the REPLACE command. .b 2 .tp 14 ^*Searching a data base [ SEARCH ]\* .b Any data base can be searched with the SEARCH command. .b ^*Example:\* the command "SEARCH ALL DATABASE personnel FOR birth_date _>= 1/1/67" selects from the data base "personnel" the records with field BIRTH_DATE greater than or equal to Jan. 1, 1967. .b Note that the records encountered by this search are not sent to the screen as they are when the DISPLAY command is used. SEARCH only finds the numbers of the records which meet the criteria of the logical condition, and designates them as the "current search". Any subsequent commands that are in their simplest forms, omitting mention of a data base, will be applied to this group of "current search" records. .b ^*Examples:\* if the next command were only DISPLAY, the records selected by the previous SEARCH command will be sent to the screen, while if it were EDIT, only those records would be edited. .b Note that if the next command imposes a "FOR" condition, it will be imposed only on those records belonging to the "current search" group, that is, those selected by the last SEARCH command. .b ^*Example:\* if the next command were "DISPLAY FOR sex = 'M'", only the records with the "sex" field equal to 'M' that are in the group defined by the previous SEARCH command will be included. .b 2 .tp 14 ^*Sorting of selected records [ SORT ]\* .b Records selected by a SEARCH command can be sorted by any criteria. .b ^*Example:\* the command "SORT DATABASE personnel ON birth_date A" sorts the records selected from the data base "personnel" by field BIRTH_DATE in ascending order. To sort in descending order, use "D" instead of "A" in the command. .b As with SEARCH, this command does not show anything on the screen. It only stores records previously selected by the SEARCH command. Use DISPLAY to see the records. .b Note that the above actions can be taken all at once by combining the search and sorting in a DISPLAY command as for example: .b "DISPLAY ALL ... FOR ... SORT ON birth_date A" .b This sort, however, will not be recorded and to sho these same records sorted by the same criterion again, it will be necessary to sort again. As the sorting operation can be slow it is a good idea not to repeat sorts unless absolutely necessary. .b ^*N.B.\* Sorting a data base does NOT change the numbers of the records. records. .b 2 .tp 14 ^*Presentation of fields [DISPLAY or LIST, DEFINE DISPLAY ]\* .b The DISPLAY command uses a very simple format for presenting the fields in a data base: - name of fields (mnemonics) at the top of the screen, underlined - one record per line, showing as many fields of the record as fit on the screen without truncating. - the fields are presented with the order and size indicated by the definition of the data base( used in the CREATE command). - fields are separated by blank lines. - at the left of each record is its record number. .b In addition, depending on the type o ffield as indicated in the definition oif the data base, standard forms are used for the various data types as defined in the . For example: .nf .nj .b c - character Anthony Charles as is .b n - integer -128, 200 ... right-justified .b x - floating pt.-12.3, 120.0 ... right-justified .b d - data 10-jan-1985 as is .b l - logicals t (true), f (false) as is .b db - other bases 12 right-justified .f .j .b This standard display can be changed in two ways: - within the DISPLAY command, specifying which fields to display and in which order. .b ^*Example:\* the command "DISPLAY ALL FIELDS code, sex, name, code OFF" presents the fields specified by FIELDS in the order shown (in this case, the field "code" will appear twice, enclosing the other two fields and the record numbers will be suppressed by the OFF command. .b The DISPLAY command presents data a screen at a time, while you should use LIST if you wish the data to scroll accross the terminal without interruption. - by explicit definition of the format in a DEFINE DISPLAY command; as there may be more than one data base defined, issue a USE command first to identify the data base to be used. .b ^*Example:\* the commands "USE personnel" and "DEFINE DISPLAY" enter into a dialogue in which you can define a display. .b 2 .tp 14 ###^*Definition of a display [ DEFINE DISPLAY ]\* .b With the DEFINE DISPLAY command you can choose: .b THE FORMAT TO USE: format 1 = horizontal, i.e. one record per line, limitesd by the length of the screen; format 2 = vertical, i.e. one field per line ( the record is presented vertically). .b THE FIELDS TO BE SHOWN: indicate for the desired order the fields you wish to show; you may also define the size, the type of presentation of the field ( number or text), whether left, right, or centered justification should be used or whether the data should be printed literally, as it was entered into the data base. .b Some field types have different representations if shown as a number or as text. Examples of various fields: .nf .nj .b type contents as a number as text .b ---------------------------------------------------------- .b character Anthony Charles no difference .b integer -128 no difference .b floating pt. 120.0 no difference .b data 10-jan-1985 19850110 10-Jan-1985 .b logicals t or f 1 or 0 t or f .f .j .b ^*N.B.\* To nullify any definitions of alternate displays and return to the standard format use the command DEFINE DISPLAY STANDARD. .b 2 .tp 14 ^*Saving and restoring searchs, sorts and displays [ SAVE, RESTORE ]\* .b The results of SEARCH, SORT and DEFINE DISPLAY commands can be saved in disk files and called up for later use (restored). .b ^*Examples:\* the command "SAVE SEARCH DATABASE personnel TO personnel.dat" saves the current search of the data base "personnel" in the disk file personnel.dat; issue the inverse command "RESTORE SEARCH DATABASE personnel FROM personnel.dat" to restore the results of that search. .b They can be saved on disk and restored: - the current SEARCH of a given data base (results of a SEARCH command) SAVE####SEARCH###TO#... RESTORE#SEARCH###FROM#... - the current SORT of a given data base (results of a SORT command) SAVE####SORT#####TO#... RESTORE#SORT#####FROM#... - the current DISPLAY of a given data base (result of a DEFINE DISPLAY COMMAND) SAVE####DISPLAY##TO#... RESTORE#DISPLAY##FROM#... .b 2 .tp 14 ^*Canceling searches and sorts [ CANCEL ]\* .b As has been shown, the results of a SEARCH command become "current". They can be ordered with a SORT command. .b If you wish to stop a search or sort use the CANCEL SEARCH or CANCEL SORT commands. .b ^*Examples:\* the command "CANCEL SEARCH DATABASE personnel" stops the current search of the data base "personnel"; the command "CANCEL SORT DATABASE personnel" stops the current sort of that data base. .b ^*N.B.\* Cancelling a current search will cancel any corresponding current sort. .b 2 .tp 14 ^*#Displaying#data#from#a#file#[#DISPLAY#or#LIST#...#TO#]/* .b Output from the DISPLAY command is normally directed to the screen. If you wish to save it on a disk file, add the TO qualifier to the command. .b ^*Examples:\* the command "DISPLAY ALL DATABASE personnel TO personnel.rec" writes ALL the records in the data base "personnel" to the file personnel.rec; the command "DISPLAY DATABASE personnel STRUCTURE TO personnel.str" writes the structure of the data base to the file personnel.str. .b In the case of writing to a file, DISPLAY and LIST have the same effect and both write to the file without stopping. .b 2 .tp 14 ^*Elimination of all the records of a database [ZERO ]\* .b To empty a data base of all records but keep the definition of its structure, use the ZERO command. .b ^*Example:\* the command "ZERO DATABASE personnel" deletes all the records in the data base after requesting conmfirmation. .b 2 .tp 14 ^*Modifying the structure of a data base [MODIFY STRUCTURE ]\* .b To modify the structure of a data base, for example to delete, modify, or increase fields, use the MODIFY STRUCTURE command. .b ^*Example:\* the command "MODIFY STRUCTURE TO personnel" calls up the DBAG editor to modify the structure of the data base "personnel". .b 2 .tp 14 ###^*Empty data bases\* .b If a data base is empty, you can modify any of its characteristics with no restrictions. .b 2 .tp 14 ###^*Data bases containing data\* If a data base contains information, you can only modify the characteristics which will not conflict with any existing records. .b For example, you can change the general description of the data base or of the fields or their names (nmenomics), as well as default values and maximum and minimum values. .b If you wish to modify other characteristics, you will have to save all the records on a disk file, delete them from the data base, modify the structure of the data base as desired, and finally re-load the records. .b In such a case, you would use the following commands: .nf .nj .b 1) APPEND ALL FROM personnel to personnel.rec .b (unload all the records to the file "personnel.rec") .b 2) ZERO DATABASE personnel .b (delete all records from the data base "personnel") .b 3) MODIFY STRUCTURE TO personnel .b (modify the structure of the data base "personnel") .b 4) APPEND FROM personnel.rec to personnel .b (re-load the records into the data base "personnel") .f .j .b 2 .tp 14 ^*Total deletion of a data base [DELETE ]\* .b To PERMANENTLY delete a data base, eliminating not only all records but also the structure of the data base, use the DELETE command. .b ^*Example:\* the command "DELETE DATABASE personnel" deletes, after asking for confirmation. the data base "personnel". .b 2 .tp 14 ^*Obtaining help [ HELP or ? ]\* .b HELP or ? will allow you to obtain explanations of all DBAG commands. .b ^*Examples:\* the command "HELP edit" displays on the terminal explanation of the EDIT command, "HELP" displays a list of all possible commands, and "HELP *" will display explanations of all DBAG commands. .b 2 .tp 14 ^*Global characteristics of DBAG [ DISPLAY or LIST ]\* .b Use the DISPLAY STATUS command to see the status and global characteristics of DBAG. .b ^*Example:\* "DISPLAY STATUS" shows DBAG status and global characteristics on your terminal. .b This command gives you useful information about DBAG. For example, the maximum number of data bases that can be opened simultaneously, the number open currently, etc. In particular, you can see the current state of the parameters that can be modified by the SET command. (see the following paragraph) seguinte). .b The DISPLAY command prsents output a screen at a time while the LIST command sends information to the screen uninterruptedly. .b 2 .tp 14 ^*Setting global parameters [ SET ]\* .b The SET command sets any global DBAG parameters. .b ^*Example:\* the command "SET NAMES OFF" removes field names from data presentation, so that only the contents of the fields is shown. .b Some parameters that can be SET include: -#ALTERNATE: "SET ALTERNATE TO dbag.log" writes to a disk file called DBAG.log your terminal session with DBAG. -#HEADER###: "SET HEADER OFF" eliminates an informational line that usually appears at the top of the screen. -#WIDTH####: "SET WIDTH TO 132" sets the terminal width to 132 columns. -#PAUSE####: "SET PAUSE ON", when using a command file, pauses before executing each command in the file. .b 2 .tp 14 ^*Linking two data bases by explicit reference\* .b To explicitely link a data base with one or more others use one or more fields of type "other data base". For example, if you have a data base called COUNTRIES, in which record no. 1 is PORTUGAL, no. 2 SPAIN, NO. 3 france, etc, you can refer directly to these from another data base with the values 1,2,3, ... .b Returning to the example of records given at the beginning of this manual, we can add one last field, leaving the record with the following structure: .nf .nj .b field 1: code, integer, size = 4 .b 2: name , character, size = 18 .b 3: birth_date, data .b 4: sex , character, size = 1 "default" value = 'M' .b 5: salary , floating point, size = 7, decimal pts. = 1 .b 6: country , db , other data base = COUNTRIES .f .j .b Of course, a data base called COUNTRIES must have been previously defined with a CREATE command, having at least one field of type "character" and size equal to the maximum expected for a country name. For example: .b field 1: country_name, character, size = 15 .b 2 .tp 14 ###^*Display of fields from "other data bases" (db) \* .b So it is possible to have a record of your data base with a field COUNTRIES loaded with the value of 2, and thus pointing to record no. 2 of a separate data base called COUNTRIES. .b If you direct a DISPLAY command to that record you will get back the actual numerical contents of the record, i.e., 2. .b In order for DBAG to automatically substitute the value in the other data base, SPAIN, in this case instead of "2", you must indicate that you wish to see the field COUNTRY not as a numerical but rather as text. To do this, use the DEFINE DISPLAY command as defined in the section on "Viewing fields". .b 2 .tp 14 ^*Linking two data bases [ JOIN ]\* .b You can link two data bases with the JOIN command, creating a new data base from the two original ones. The structure of the new data base is automatically defined through the union of the two original data bases. The fields of the new data base are loaded with the contents of the fields of the original data bases, using the records which match the conditions of the JOIN command. .b For example, let us suppose that a data base COUNTRIES has been defined with a CREATE command to have two fields, one an integer and the other a character: .nf .nj .b field 1: country_no , integer , size = 3 .b 2: country_name , character , size = 15 .f .j .b ^*Example:\* the command "JOIN personnel WITH countries TO personnel_c JFOR countries = country_no" creates a new data base named personnel_c from the two data bases "personnel" and "countries", containing the record pairs with identical country numbers. .b JFOR specifies the condition under which the JOIN should be performed. JFOR is used like FOR (see appendix) except that the first and second data bases must be specified to the left and right of the JFOR statement. .b In the above example, the data base personnel_c would be defined with 8 fields, 6 from "personnel" plus 2 from "countries". If desired, you can indicate in the command which fields you wish to copy to the target data base. .b ^*Example:\* the command "JOIN personnel FIELDS name, salary, sex WITH countries FIELDS country_name TO personnel_c JFOR country = country_no" creates a new data base called "country_c" from the two data bases "personnel" and "countries" for the record pairs with identical country numbers and with the indicated fields. .b In this case, the data base "personnel_c" ends up with only 4 fields: 3 from "personnel" and one from "countries". .b 2 .tp 14 ^*Indexing and de-indexing of fields [INDEX, NOINDEX ]\* .b If you do frequent searches with a particular condition of equality or inequality, (as in DISPLAY ALL FOR sex = "M") you can "index" that field to accelerate the search with the INDEX command. .b ^*Example:\* the command "INDEX DATABASE personnel ON FIELD sex" indexes the field "sex" of the data base "personnel". .b APPEND and EDIT commands on an indexed field will be slower but searches using that field will be much faster. .b You can remove indexing at any time with the NOINDEX command. .b ^*Example:\* the command "NOINDEX DATABASE personnel ON FIELD sex" removes indexing. .b 2 .tp 14 ###^*Indexing by key-words [ INDEX KWIC ]\* .b Adding the qualifier KWIC to the INDEX command enables indexing by keyword. .b ^*Example:\* the command "INDEX KWIC DATABASE personnel ON FIELD name" indexes the field "name" of the database "personnel" for key-words which can then be specified in subsequent commands. For example, using the command "DISPLAY ALL DATABASE personnel FOR name = louis, anthony" will find the records in the data base where the "name" field is either "louis" or "anthony". .b 2 .tp 14 ^*Erasing records [KILL ]\* .b To remove records from a data base, use the KILL command. .b ^*Example:\* the command "KILL ALL DATABASE personnel" removes, after requesting confirmation, ALL records in the data base "personnel". .b It would be faster and more practical to use the ZERO DATABASE command if you really wish to remove ALL records from a database. KILL is normally used in a selective manner. Examples: .nf .nj .b KILL ALL FOR birth_date _>= 1/11/67 .AND. birth_date <= 31-dec-1978 .f .j removes all records where the field "birth_date" is between the two dates shown, inclusive; .nf .nj .b KILL 100:110, 234 .f .j removes the records with numbers between 100 and 110, inclusive, and also record number 234. .b This command always requests confirmation as information KILLed cannot be recovered. .b The numbers of KILLed records are normally re-used if new data are added to a data base. In the above example, an APPEND command subsequent to the confirmed KILL of records 100 through 110 and 234 would start at record 100 and continue with 101, 102, ... and 234 for new record numbers. .b 2 .tp 14 ^*Copying the structure of a data base [ COPY STRUCTURE ]\* .b Use this command to copy (duplicate) the structure of a data base. .b ^*Example:\* the command "COPY STRUCTURE FROM personnel TO personnel2" duplicates the structure of the data base "personnel" in the new data base "personnel2". .b You can use this command when you wish to duplicate the structure of a data base for any reason. In particular, before modifying the structure of a data base (with the MODIFY STRUCTURE command) you can "save" it in case you make a mistake during the modification. .b 2 .tp 14 ^*Using command files [ @ ]\* .b Instead of entering commands at a terminal, they can be placed in a file, one command to a line, and executed in the same way DCL command files are. .b ^*Example:\* the command "@ m.out" will initiate the execution of the commands in the file "m.out". .b If "m.out" created (say, with EDT) to contain the following commands .nf .nj .b USE personnel RESTORE DISPLAY FROM personnel.dsp DISPLAY ALL FOR sex = 'M' TO personnel.m .f .j .b "personnel" would be designated the default data base, a display previously saved in the file "personnel.dsp by the SAVE DISPLAY command would be called up for use in showing the requested data, and finally all records with the field SEX set to "m" would be displayed on the screen in that saved format. .b 2 .tp 14 ^*Recalling and editing commands [ UP or RECALL ]\* .b A command can have up to 256 characters. When it does not fit on a single line, use the semicolon, ";", to indicate that the command is continued on the following line. .b ^*Example:\* the series of lines .nf .nj .b DISPLAY ALL FOR sex = 'M' ; SORT ON code,name; TO personnel.srt ; FIELDS name, sex, birth_date .f .j .b will be interpreted by DBAG as a single command: get all records with field "SEX" = "M", sort by CODE and NAME, and write the fields NAME, SEX, and BIRTH_DATE to the file "personnel.srt". .b In addition, all lines beginning with "!" are ignored so comments can be added to command files to document them. .b Any command line can be edited. DBAG asks the user if he/she wishes to edit a line that has been entered with a syntax error. If the answer is affirmative, DBAG enters the command line editor. If not, DBAG requests the next command. .b DBAG keeps the last 20 commands in a buffer that can be accessed by the UP or RECALL command in several ways. .b ^*Examples:\* the command "UP" recalls the last command, "UP 4" returns the fourth command back, and "UP displ" returns the last command beginning with "displ". .b After issuing an "UP" command, you can cycle through the previous commands with the "down" and "up" arrow keys. .b Any recalled command can be edited. .b Press the carriage return, "", to execute the command. .b To see the entire command buffer, use DISPLAY COMMANDS. .b 2 .tp 14 ^*Operating system commands [ VMS EDT TPU ]\* .b Without leaving DBAG, you can execute any DCL command by prefacing .b it with the VMS. ^*Example:\* the command "VMS dir" shows the list of files in your default directory without leaving DBAG. .b The prefix VMS can be replaced by EDT or TPU in order to invoke directly either editor. .b ^*Example:\* the command "EDT a.cmd" calls EDT directly to edit the file "a.cmd". .b 2 .tp 14 ^*Notices and news [ NEWS ]\* .b Notices of general interest to DBAG users can be listed with the NEWS command. It can be used to announce updates to the program or the addition of new features. .b ^*Examples:\* the command "NEWS" displays at the terminal a list of unread news items. "NEWS *" will show all existing entries. .b 2 .tp 14 ^*Invoking DBAG automatically\* If there is a file in your default directory named "autoexec.bat" it will be automatically interpreted as a command file by DBAG. .b ^*Example:\* if your autoexec.bat file contains the commands "set width to 132", "open personnel", and "append", one command per line, then every time you enter DBAG, your terminal will be set to 132 columns, the default data base will be "personnel", and the DBAG editor will be invoked to add new records to that data base. .b 2 .tp 14 ^*Leaving DBAG [ EXIT or QUIT ]\* .b Use the EXIT (or QUIT) command to return to the operating system. .b ^*Example:\* the command "EXIT" leaves DBAG and returns to the operating system.