BUILDING A DATABASE IN CONDOR
Back to Handout's Index
WHAT IS CONDOR? Condor is a DOS-based Database. It works in the plain DOS environment (and not the colorful Windows environment) and uses COMMANDS to conduct the operations, with a simple prompt in the form C>>
CONDOR has also a menu, which you can access from the C:\CONDOR folder:
However, we will work from the C:\SCRATCH folder, where you will save your working files, and from which you will use the command environment of CONDOR.
PRELIMINARIES: Before turning on the computer we need to think about how we are going to organize the database, that is think about the information that will be entered in our finished database. We will need to think in things like: the VARIABLES, the CODES for the variables, how many SPACES do we need to enter the data for each variable, and what TYPE OF DATA we will input: letters, numbers, letters and numbers, integers or numbers with decimals?
The preparation of a database starts with the consideration of the actual data that will help you work any research questions you have on the materials. Some other information will also be included, but you have to make sure that the data you need to explore will be easy to enter and manipulate. It is highly recommended that the skeleton of the database is prepared on paper before building it in the computer. There will perhaps be errors in the computer but they will related to technical aspects and not to the conception of the database. This step will save you much time. Prepare then a LIST (in tabular form) with the specifics of the database. Prepare it with columns for VARIABLE, CODE, SPACES, and TYPE OF DATA.
PREPARING A DATABASE. Now it is time to put what you have in the paper in the computer screen. Start CONDOR with the command "DBMS" (use the commands without the quotes) from the C:\SCRATCH prompt. In the first screen you will be asked to enter the drive your file disk is. You will enter C since you will put the data in C:\SCRATCH (you would enter A if you wanted to save directly into the floppy disk).
FIRST STEP: DEFINE the database by preparing the matrix where you will enter data. The DEFINE command lets you set up a form by entering manually the variables you need. You must use this command to create a new file. To create a new file, you must first specify a valid file name. A file name can have from one to eight letters or numbers. It should not include blanks: "DEFINE filename" After entering the DEFINE command, you see a blank screen on which you can type your form:
1. Entering VARIABLES: put the CODE for the variable in brackets: [code] ; then write the variable name at a side: [W]eight or [Le]ngth. Variable codes can have from 1 to 15 letters or numbers and should not contain spaces. It is practical to keep the codes short; this will make your job of manipulating the database much easier. Attention: CONDOR will not allow two variables "W". The code for, say, width will be "Wi" hence [Wi]dth, in case [W] already exists in the form.
2. Entering the SPACES with underscores: _ (this is done with the SHIFT - key) to hold the data (based on the number of spaces you have pre-established). ATTENTION: Say you will have a VARIABLE for length of mound [L] and another as length of microlith [Lm]. The type of length of these two variables is very different: in the first case you might just enter meters as integers; you can safely asign 3 underscores to the variable ___, meaning that you allow a maximum length of 999m which is a safe bet for a mound. But you want to be more precise with the lithics: here you will enter length in centimeters with two decimals. How many underscores are needed? Five. The decimal point takes one space. These 5 underscores: _____ will be interpreted as __.__ when you tell CONDOR, in the next step, that this variable has 2 decimals. This means that we expect no lithic length to exceed 99.99cm.
Finally the form can also have any comments you wish. Only the information in brackets will be interpreted as variables. When the form is complete, press "END" to save it.
You are then prompted to assign data types according to the kind of data you plan to enter. Take you paper with the codes and underscore numbers and enter them here. You have the following options for data types
N.n Decimal numeric (n= 0 to 18 decimal places)
Following the above examples, we would need to enter N for the [L] variable, and 3 for the three undescores (hence, N,3); and N.2,5 for the [Lm] variable. After entering the data types, press ENTER to use the preset values that CONDOR interprets for field size, minimum, maximum and defaults. After you have entered data types for all the fields, press "Y" if the types are OK. Answer "N" (No) to prompts asking if you want a copy of the data definitions and an index. Then you are returned to the Main Menu.
Your database in now finished. Before sitting down to enter all the needed data try the form out. Enter the command "ENTER filename" at CONDOR's C>> prompt and an empty form appears. You will now enter a first set of data to see if the form accepts your information as you set it up. It will not accept letters in place of numbers, but does it accept all the numbers you need? Can all the spaces be filled? If not, or if you have a message refusing the data it is the right time to revise the form.
FORGOT SOMETHING? MISTAKES? If something went wrong in your first entering of data, changes can be made now with little consequences for your data (none have been entered). Some changes you make will delete all the info already entered, but you just made one test entry. Use the REORG command: "REORG filenane". The form appears on the screen. You can add new variables. After you hit "END" CONDOR will ask you for info on that new item. If you deleted an item it will ask for confirmation to delete. If you use REORG to change codes for a variable or change the number of underscores in a variable it will ask for deletion of the old variable and data for the new one. In this last case you will lose the data for the variable you changed. If this type of changes is needed and there is little data in the database I suggest you first delete the variable & underscores, exit REORG & confirm deletion. Then re-enter REORG to add the correct variable with its underscores.
IF THERE IS DATA ALREADY ENTERED IN THE DATABASE, I suggest the following: (1) use REORG to create a new variable with the correct code and spaces; (2) put all the data of the old variable into the new variable field: "COMPUTE filename ST NEWvariable IS OLDvariable"; then (3) REORG to erase the old variable.
You may also use DEFINE with an existing file. If you use DEFINE on an already exISting file, you will start by getting a message telling you that the file exists already, and asking you if you want to describe or redefine the form. Use the "describe" option "D" to see how your fields are defined. Use the option "redefine" "R" to change data types in an empty database. If there is data in the database, CONDOR will ask to delete all that information. This option is not recommended except when just trying the new database.
CONDOR DATABASE FILES: WHAT ARE THEY NAMED? When you create one database CONDOR creates a series of files for different aspects of the database: filename.FRM, for the form you created, filename.DEF, for the definitions of each variable, and filename.DAT with all the data entered on the form. In addition to these files CONDOR creates DATA.DIC a master file where are listed all the databases created in that folder. So if you save your work in a floppy disk to work with your information in another computer that has CONDOR you should copy *.DAT, *.FRM, *.DEF and the DATA.DIC files.
ENTERING THE DATA You have already used the "ENTER filename" command to test the database form. Now that the form is tested you will enter the data collected in your research. Normally I would tell you that you have to save constantly your information in a floppy disk. But when you finish to enter data in one form and hit "C" to continue entering data, CONDOR saves automatically the data in the filename.DAT file. So after each entry your data file is UPDATE d. You will see that you also have the option to "R" revise, or "D" delete the data just entered. "E" is to end and you go back to the C>> prompt.
MANIPULATING A CONDOR DATABASE
LOOKING AT YOUR DATA WITH THE "LIST" COMMAND. This command shows whole datasets one at a time or list specified variables. To have a GENERAL look at all the entries in the database: "LIST filename". To have a SPECIFIC look at some entries in the database you will have to use the WHERE subcommand and the code for the variable you want to explore (here L) and the values you are looking for (lithics are 5cm long): "LIST filename WHERE L IS 5.0"; or
"LIST filename WHERE L GT 5.0" (all cases where length GREATER THAN 5 cm).
LIST can also display the data in columns when you specify the variables you want listed, and in the order you write them here -not in their form order. The codes of the variable appear as headings:
"LIST filename BY w l e r x y ...z". Notice that the LIST command only allows you to look, not change the information in the database: see UPDATE command below.
LOOKING AT YOUR DATA IN ORDER: "SORT" COMMAND before "LIST" COMMAND. Perhaps in the GENERAL list you made above the records were not ordered in correlative numbers; they are displayed in the order they where entered. You can change this with: "SORT filename BY L#" (L# is lithic number). Try again "LIST filename" to see the records starting from 1. Do "SORT filename BY L" if you wanted entries ordered by lenght.
CHANGING VALUES IN SOME ENTRY FORMS: "UPDATE ". The UPDATE command displays records you specify one by one and you can choose to revise any record or to keep the original version of the record. Say you want to change the length of the flake in form L#2:
"UPDATE filename WHERE L# IS 2" will take you to the form and you will have to navigate to the field L and make the change. Or you might write, if you know the length of the item:
"UPDATE filename WHERE L IS 3.45". This case shows in the screen and you go and change the length for its correct value.
CHANGING VALUES FOR A VARIABLE IN ALL THE DATASET: "CHANGE" This command changes the data in specified variables in every record of the dataset. In a GENERAL fashion you can change the values of a constant value like "date": "CHANGE filename ST date IS 19/8/99".
Or you can be more SPECIFIC with the WHERE command: "CHANGE filename WHERE cost GT 500 ST date IS 19/8/99"
CALCULATIONS IN CONDOR: "COMPUTE" We have already used this command to copy data from one variable to another (with different names): "COMPUTE filename ST NEWvariable IS OLDvariable". COMPUTE can be used to complete variables that need calculation between one more variables in the same form. Say you recorded length and width of sites, and you set a variable named "area". When you entered data you just entered length and width, and now you are ready to calculate the area. Write:
"COMPUTE filename ST ar = w*l". Do a LIST command to see all the area fields filled after this calculation.
PRODUCING INFORMATION WITH "TABULATE " Say you have a lithics database where artifacts are made from three types of stone: calcedony, flint and obsidian. This information was entered in the "Mat" variable (with only space for 1, 2, and 3, or C, F & O -I always recommend using numbers, it is easier in CONDOR and in other programs). You want to now how frequent is each type. First, you need to sort the "Mat" variable: "SORT filename BY Mat". Then enter "TABULATE filename BY Mat". Something like this is produced:
Say in addition to "Mat" you had a variable "OC" for obsidian color: green, grey and black (1, 2, 3). You can create a table with "Mat" and "OC". Start with "SORT filename BY Mat OC". Then you can proceed with "TABULATE filename BY Mat OC". Something like this is produced:
In this case only 3 (for obsidian) is divided in three rows for its color. For 1 & 2 entries the OC variable was just 0.
PRODUCING STATISTICS WITH "STATS" This command calculates statistics for specified variables: "STATS filename BY L". Something like this is produced:
Total 790.56 (the sum of all the lengths in the sample)
Minimum 3.78 (the shortest length measurement)
Maximum 17.67 (the longest length measurement)
Average 9.76 (the mean lenght in the sample)
Record count 81 (the number of cases in the sample)
The power of CONDOR for these calculations is limited and therefore the statistics are very basic. We have already seen how SYSTAT can produce more specific statistical information. We will see now how we can get information from a CONDOR database into SYSTAT EDIT, and then get the statistics in the STATS module.
PRODUCING ASCII FILES WITH INFORMATION FROM CONDOR. The information you see in your screen can be put into a file that you can open in a word-processor to edit and produce data like tables for a text. Or to prepare an ASCII file to be read by SYSTAT. The procedure in CONDOR is the following: (1) Provide a name for the file in the following command: "PRINTER FILE filename.txt". If you do not put ".txt" the resulting file will be: filename.lst;
(2) issue the command as in other cases but redirect the output to the file with " [p]":
"LIST filename WHERE l GT 5 [p]"
All the commands you issue that end with "[p]" will be saved in filename.txt; a command with no [p] will just show on your screen. If new information has to be in a different file, issue a new PRINTER FILE command with another filename in order for that data to be saved in this last file.
PRODUCING LISTNGS OF DATA IN TABULAR FORM: The LIST command is a good one to produce the data in tabular form. However, when you issue the command "LIST filename WHERE l GT 5 [p]" what you will get in your file is the forms for the cases where length is larger than 5 cm. To have a LIST with headings and columns you need to specify the variables you want listed: "LIST filename WHERE l GT 5 BY L# l w x y z [p]".
Any word-processor will read the file "filename.txt". You can then include a table or LIST of data within your text for a paper or report. SYSTAT will also read the ASCII file "filename.txt". However, you will need to edit it: eliminate the variable headings that CONDOR produces in the lists. Data/numbers in columns should start in the first row of the screen and no spaces should be present after the last row of data. Use DOS EDIT to edit filename.txt. Then go to "DATA" (a SYSTAT module) and issue the following command: "IMPORT 'filename.txt' / TYPE=ASCII". At the next prompt enter "EDIT". You will see the information appear, with the headings VAR(1), VAR(2) .... CHANGE the headers names. When you are done hit "ESC" and at the ">" prompt at the bottom of the worksheet write "SAVE filename" (no extension!). You have just save the data that is now in "filename.sys". Now you can produce more detailed statistics on the database data.
OTHER COMMANDS: COPY filename TO filename2; RENAME oldfilename TO newfilename.
DANGEROUS COMMANDS: DELETE filename WHERE L# IS ....; EMPTY filename; DESTROY filename.
When you are finished you will exit CONDOR with the command "SYS".
Back to Handout's Index