ADVANCED TOPICS =>Auxiliary Files and Their Functions: Data Dictionary Files. .DCT. Data dictionary files describe each of the variables on the corresponding data file(s). Each data dictionary file has either the same filename as the corresponding .DBF file except that D is the last character of the filename, or has a shorter filename so that it can serve as data dictionary for a number of files that all start with the same characters in the filename. Data dictionaries are in dBase III+ format even though they do not have the .DBF extension. Some data dictionaries include both a .DCT file and a matching .DBT file that carries definitions which are referenced as memo fields from the .DCT files. Label Files. .DBF. Label files carry text descriptors associated with the individual values of particular variables (for example, the names of particular kinds of business or geographic areas). These files may also be referred to as stub files, since they carry the text information normally found in the stub (i.e. lefthand column) of printed tables. Memo fields may be used to provide longer definitions of values, in which case there is a .DBT file of the same name. Each label file must also have an associated index file. The file SELEX.DBF must be present in order for code labels to be used in the item selection process. Catalog Files. .CTG and .CTI. Catalog files list the files of a particular type that are available, along with a brief description of each one. The master catalog "master.ctg" lists the available catalogs, or types of files, available on the device. Files with the extension .CTI catalog index files. While .CTG files are compatible with dBase catalog files (.CAT), a different extension is used so that users are not tempted to use them in dBase without recopying them. (DBase attempts to write new information to a catalog in use, not appropriate for CD-ROM.) Program and Parameter Files. EXTRACT.EXE is a program compiled by ClipperTM. The first time it is used it gets certain parameters from "extstart.prm", but as soon as the user exercises the option to save format options, a new file "ex- tract.prm" is created. Help Screen Files. .TXT. As soon as a catalog is selected, the EXTRACT program displays a catalog-specific help screen, if present. That same screen can be brought up at any time from the main menu by typing "H". These help screen files have the same name as the corresponding catalog files, e.g., RC87A1__.txt. =>Setting Up an EXTRACT Menu Drive designations may be entered at the command line. This is particularly useful where multiple Census Bureau CD-ROMs are in use, at least one of which relies on auxiliary files stored on a hard disk. Command-line parameters allow batch files or menuing systems to deliver the user right to the menu of avail- able catalogs, thereby avoiding having to teach each user about drive designa- tions on the system. The command line takes the following form EXTRACT [ Example: EXTRACT cb l: c:\ccdbaux\ c:\test\ master.ctg ccdintro.txt If no arguments are present, the system will operate as usual, prompting for drive and directory designations. The individual arguments are as follows 1. C indicates that the data drive is a cd- rom; n indicates no cd-rom. A, together with no additional arguments, puts the user immediately into the advanced menu, discussed below. B, when added to the c, n, or a, puts the display into monochrome (black and white) mode. 2. 3. This is normally "l:\auxil\" on CD-ROMs, such as the economic census discs, that have auxiliary files built in. 4. [] 5. [] Optional. Any entry, which may include a full path designa- tion, overrides the normal default to a file named "master.ctg" within the auxiliary drive designated above. 6. [] Optional. Used so that a customized screen can be presented in lieu of EXTRACT's opening screen. Using the ave option at the opening Drive Selection screen generates a one- line batch file saving the first five parameters, assigning a name you specify. EXTRACT also builds the file EXMENU.bat, listing each of the batch files you have created, but without any description. With your text editor, you can add appropriate annotations to each line of the file EXMENU.bat, illustrated below. echo off echo . echo EXTRACT MENU echo . echo EX EXTRACT with Economic or Agriculture Census discs echo EXCBP EXTRACT with County Business Patterns echo EXEXPORT EXTRACT with U.S. Exports of Merchandise echo EXIMPORT EXTRACT with U.S. Imports of Merchandise echo EXCCDB EXTRACT with County and City Data Book, 1988 echo EXUSACO EXTRACT with U.S.A. Counties, 1992 echo EXTRACT with 1990 Census CD-ROMs: echo EXPL94 PL94-171 echo EX1A STF 1A echo EX1B STF 1B (Block statistics) echo EX1C STF 1C echo EX3A STF 3A echo EX3B STF 3B (ZIP Code data) echo EX3C STF 3C echo EXEEO EEO file echo on Below are listings of the corresponding batch files, created with your text editor or simply by using ave. This illustration assumes that the CD-ROM drive is L:, that the subdirectory C:\EXTRACT\WORK exists for use as the program's work space, and that the subdirectories CBPAUXIL, FTDAUXIL, CCDBAUX, and 1990AUX within C:\EXTRACT\ contain the appropriate auxiliary files. Note that the fifth argument is added to specify the name of the master catalog for foreign trade and 1990 census CD-ROMs, since each of those groups use the same auxiliary directory. Filename Contents EX.BAT EXTRACT c l: l:\auxil\ c:\extract\work EXCBP.BAT EXTRACT c l: c:\extract\cbpauxil\ c:\extract\work EXEXPORT.BAT EXTRACT c l: c:\extract\ftdauxil\ c:\extract\work mstrexpo.ctg EXIMPORT.BAT EXTRACT c l: c:\extract\ftdauxil\ c:\extract\work mstrimpo.ctg EXCCDB.BAT EXTRACT c l: c:\extract\ccdbaux\ c:\extract\work EXUSACO.BAT EXTRACT c l: c:\extract\usacoaux\ c:\extract\work EXPL94.BAT EXTRACT c l: c:\extract\1990aux\ c:\extract\work mstrpl94.ctg EX1A.BAT EXTRACT c l: c:\extract\1990aux\ c:\extract\work mstrst1a.ctg EX1B.BAT EXTRACT c l: c:\extract\1990aux\ c:\extract\work mstrst1b.ctg EX1C.BAT EXTRACT c l: c:\extract\1990aux\ c:\extract\work mstrst1c.ctg EX3A.BAT EXTRACT c l: c:\extract\1990aux\ c:\extract\work mstrst3a.ctg EX3B.BAT EXTRACT c l: c:\extract\1990aux\ c:\extract\work mstrst3b.ctg EX3C.BAT EXTRACT c l: c:\extract\1990aux\ c:\extract\work mstrst3c.ctg EXEEO.BAT EXTRACT c l: c:\extract\1990aux\ c:\extract\work mstreeo.ctg If you want the EXTRACT menu to reappear after you quit the program, add these three lines to each of the above one-line batch files: PAUSE CLS EXMENU The "pause" instruction will cause your system to prompt "Press any key to continue..." before presenting the EXTRACT menu. In those cases when EXTRACT terminates abnormally, it leaves a one line error message at the top of the screen. Pausing gives you a chance to write down any error message before the screen is cleared. =>File Manipulation ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ MANIPULATE FILES ³ ³ ³ ³ 1. Select an existing index ³ ³ ³ ³ 2. Create a new index ³ ³ ³ ³ 3. Merge files horizontally (add items to existing records) ³ ³ ³ ³ 4. Merge files vertically (add more records to existing file) ³ ³ ³ ³ 5. Create totals or subtotals ³ ³ ³ ³ Press to return to Main Menu ³ ³ ³ ³ ³ ³ Enter option number: _ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ Option 1. Select an existing index. Some files have one or more index files which can be used to resequence the output. Index files can also speed certain kinds of searches, and the "Select Records" option may pick an index for you, if a relevant one is available. Therefore, most users will not find it necessary to use this option. To explicitly select an index, highlight your selection and press . To return the file to its original sort, press . ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³SELECT INDEX (H for HELP) ³ ³ ³ ³1. Position cursor by using , , <>, or <> ³ ³2. Press to select an index, to UNSELECT. ³ ³ ³ ³ ndx_name key_descr ³ ÆÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͵ ³ RC87C1MN ³ First record for each county ³ ³ RC87K1MN ³ By kind-of-business code, by rectype ... ³ ³ RC87M1MN ³ First record for each MSA ³ ³ RC87N1MN ³ First record for each PMSA ³ ³ RC87P1MN ³ First record for each place ³ ³ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ Option 2. Create a new index. If none of the existing indexes yield the desired sequencing, you may create a new index. The system prompts you to enter the key expression for the index, and, to help you with the format, shows what the key expressions for existing indexes look like. The indexing expression can be as simple as "-sales" to rank all records by sales (the leading minus sign specifies descending sequence). To rank areas by sales within each kind of business, the indexing expression is more compli- cated, since alphabetic information and numeric information can only be used in the same key after the numeric information has been converted to string format. The key expression shown in the illustration above subtracts sales from a large number to make the descending sequence appear like ascending sequence to the computer, converts that expression to a 10-character string, and combines it with the kind-of-business code. Since the spelling of variable names must be exact, you may need to back to the main menu and review variable names on the Select Items screen before proceeding. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ INDEX FILE DESCRIPTION INDEX KEY ³ ÆÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͵ ³ RC87C1MN ³ First record for each county ³ RECTYPE+ST+COUNTY ³ ³ RC87K1MN ³ By kind-of-business code, by rectype ... ³ RTL87KB+RECTYPE+ST+ ³ ³ RC87M1MN ³ First record for each MSA ³ RECTYPE+MSA+PMSA ³ ³ RC87N1MN ³ First record for each PMSA ³ RECTYPE+PMSA ³ ³ RC87P1MN ³ First record for each place ³ RECTYPE+ST+PLACE ³ ³ ³ ³If the file you are working with is relatively large, and the number of ³ ³records you want to access through the index is relatively small, it is ³ ³likely more efficient to extract a file (.DBF) before indexing. ³ ³ ³ ³ Enter KEY expression for new index: _______________________________ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ After you enter an indexing expression, the system prompts you for a name for the index file and a description to enter into your MY_FILE.cti catalog of index files. In the future you will be able to access this index from the "Select an existing index" option. As the screen warns, indexes for large files can be large themselves. All records in the file are indexed and any previous record selection is ignored. Thus it may be more practical to extract the desired data to a .DBF file and index the result than to index an entire file on a CD-ROM. Options 3 and 4. Merging files. Two ways of merging files are available. The following illustrates the difference between vertical and horizontal merger. Horizontal merger: XXXXXXXXXXXXXXXXXXXXXXXX XXX XXXXXX XXXXXXX XXXXXXX XXXXXXX XXXXXX XXXXXXXXXXXXXX--original file--XXXX XXXXXXX XXXX--merged file--XXX XXXXXXXXXXXXXXXXXXXXXXXX XXX XXXXXX XXXXXXX XXXXXXX XXXXXXX XXXXXX XXXXXXXXXXXXXXXXXXXXXXXX XXX XXXXXX XXXXXXX XXXXXXX XXXXXXX XXXXXX Vertical merger: XXXXXXXXXXXXXXXXXXXXXXXX XXX XXXXXX XXXXXXX XXXXXXXXXXXXXX--original file--XXXX XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXX XXX XXXXXX XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXX XXX XXXXXX XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXX XXX XXXXXX XXXXXXX XXXXXXXXXXXXXXX--merged file--XXXXX XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXX XXX XXXXXX XXXXXXX When you merge files horizontally, you add to your current display items from another source that has compatible identifiers for each record. Adding labels is a form of horizontal merger in which the user interface is simplified by the fact that the necessary relationships are pre-specified in the data dictionary. This option allows you to merge files of your own choosing, such as employer and nonemployer data, data for different time periods, population and economic data, etc. When you merge files vertically, you append records to the end of the original file from a second file. Vertical merger, for instance, allows you to create a single file that contains counties from multiple states when the original files on CD-ROM are state-specific. Option 3, Merging files horizontally. Horizontal merger takes you through four screens, three of which are already familiar. The first two screens-- "Select a Catalog" and "Select a Data File"-- specify the file to be merged into the current display. The third screen asks you on what basis the two files are to be merged. The simplest files to link are those that have the same number and sequence of records (see option 1, below). Examples include the various files within STF 1A or within the 1988 County and City Data Book. (Using the Add Labels option from the main menu may accomplish the same thing with fewer steps.) If the number of records in the current file and new file are not the same, the system prompts you for an expression that gives the record number in the new file, for example, LOGRECNU (logical record number) on STF 1A files. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ How do records in RC87N2XS relate to records in RC87A1MN? ³ ³ ³ ³ 1. By way of the record number (e.g., STF 1) ³ ³ ³ ³ 2. By way of an index I need to create now ³ ³ ³ ³ 3. By way of one of the indexes listed below ³ ³ ³ ³ Enter option: 3 ³ ³ ³ ³ INDEX FILE DESCRIPTION ³ ÆÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͵ ³ RC87N2K ³ By kind of business by State, MSA & PMSA ³ ³ RC87N2S ³ First record for each State ³ ³ RC87N2M ³ First record for each MSA or PMSA ³ ³ ³ ³ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ The illustration above shows the linkage of statistics about employers from the RC87A1MN file with statistics about nonemployers from the RC87N2XS file. The two files do not have exactly the same number of records, but they do have the same kind-of-business, state, MSA and PMSA codes, so they can be linked by way of the first index. Indexes with a description "First record for..." should normally be avoided. Entering option 3 puts the cursor on the first index, which is selected with . That brings up the following prompt: Specify relation for RC87A1MN RTL87KB + ST + MSA + PMSA Pressing here will accept the suggested relationship, which reflects the key expression of the selected index. Changes are appropriate if the current file uses different names for the variables shown, or if corresponding variables are not available. If, for example, the link were being made from a previously extracted file for Minneapolis-St. Paul MSA that carried the RTL87KB code but did not include state or MSA codes, the relationship could be changed to RTL87KB + "00" + "5120" where 00 is the default state code on MSA records and 5120 is the code for the Minneapolis-St. Paul MSA. If the linking expression is not expressed correctly, the fields merged subsequently will contain only blanks and zeroes. The fourth screen in the horizontal merge sequence prompts you to select items from the new file. The results of this merge are illustrated below. Data from the merged file appear at the right, and the column headings show their source by the "RC87N2XS->" prefix. Note that some of the data in the righthand columns are shown as zero. This is because these source records had no match in the RC87N2XS file, nonemployer data being available in less detail than employer data. After a horizontal merger, it is possible to combine the contents of both old and new items in a user-defined item, for example, a freeform expression SALES + RC87N2XS->SALES would yield total sales for employer and nonemployer establishments. The syntax for specifying the merged items in such an expres- sion must be copied exactly from the headings shown. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³Use ARROW keys to scroll up, down, and sideways. Press ESC when finished³ ³ ³ ³ 1987 RETAIL TRADE: General Statistics RC87A1 ³ ³ Minneapolis-St. Paul, MN-WI MSA ³ ³RTL87KB->TEXT40 ESTAB SALES RC87N2XS->ESTAB RC87N2XS->SALES³ ÆÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͵ ³ Retail Trade ³ 13311 ³ 16762012 ³ 7346 ³ 309301³ ³52 Bldg materials ³ 687 ³ 1038660 ³ 295 ³ 12053³ ³521,3 Bldg material ³ 290 ³ 796066 ³ 150 ³ 5686³ ³521 Lumber & bl ³ 205 ³ 735569 ³ 0 ³ 0³ ³523 Paint, glas ³ 85 ³ 60497 ³ 0 ³ 0³ ³525 Hardware stor ³ 257 ³ 137758 ³ 53 ³ 4188³ ³526 Rtl nurseries ³ 105 ³ 88549 ³ 72 ³ 2009³ ³527 Mobile home d ³ 35 ³ 16287 ³ 20 ³ 170³ ³53 General merchan ³ 226 ³ 2374716 ³ 119 ³ 2747³ ³531 Dept. stores ³ 80 ³ 2188192 ³ 0 ³ 0³ ³531 Dept. stores ³ 80 ³ 2074585 ³ 0 ³ 0³ ³531 pt. Conventiona ³ 20 ³ 0 ³ 0 ³ 0³ ³531 pt. Discount or ³ 40 ³ 0 ³ 0 ³ 0³ ³531 pt. National ch ³ 20 ³ 528734 ³ 0 ³ 0³ ³533 Variety store ³ 39 ³ 36078 ³ 57 ³ 1482³ ³539 Misc. general ³ 107 ³ 264053 ³ 62 ³ 1265³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ EXTRACT does not give you control over the sequence of items in the display. Labels always appear first, followed by items from the current file, followed by merged items, followed by user-defined items. If you subsequently create an extract .DBF file or .PRN file with headings, the system will prompt you to supply a different name and description for the duplicate fields. For example, you could change the field name to "ESTABnon" and the description to "Nonemployers--Number of establishments, 1987". The prompt below would appear at the bottom of the Extract Data to a File screen, and be followed by a similar prompt for the duplicate SALES field. ³ Duplicate field name detected ³ ³ In original file: ³ ³ ESTAB Number of establishments, 1987 ³ ³ ³ ³ RC87N2XS->ESTAB ³ ³ ESTAB_____ Number of establishments, 1987_____________________________ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ Option 4. Merge files vertically. Merging files vertically involves appending the records of a second file to the bottom of the current file. Unlike horizontal merger, this involves an immediate write to disk. Therefore the program allows you to initiate a vertical merger only when the current file is in your MY_FILES catalog. The file being merged in may be from any catalog, but it is highly likely that it will also be from your MY_FILES catalog since the entire file is read in. The structure of the resulting file is dictated by the current, or original, file. Only those data fields that appear in both files with the same name will be added in. If there were no commonality between field names in the two files, vertical merger would add only blank records. Where field names are entirely different, you may need to study horizontal merger further. The dialog to accomplish vertical file merger is fairly short. You are presented with the "Select a Catalog" screen followed by the "Select a Data File" screen, following which the merger is accomplished. The resulting file has the same name as it did before. If you wish to change its description in your MY_FILES catalog, do so with option 6 from within the Advanced Options screen (option 10 from the main menu). Some files may be merged either horizontally or vertically. For example, the nonemployer data merged in the horizontal example above could have also been merged in vertically, since the data field names are compatible in both sources. Another example where a similar choice is available is data from corresponding files for different periods of time, such as 1987 and 1982 manufactures data. In this case you will need to anticipate the need to distinguish the two sources from one another in the resulting file. This can be accomplished when creating the original file by adding a user-defined item named YEAR and giving it a freeform value of "87". The records merged in from the 1982 file will be blank in the new YEAR field. Option 5. Create totals or subtotals. Totalling allows you to create a new data base where all records with a common identifier, or totalling key, have been summed together. This may be an essential function in reducing the size of certain very large files, such as imports or exports files where there are no intermediate-level summaries that can be selected. This function is less frequently needed in economic census and 1990 census files where intermediate- level totals are already included. If your intention is to extract a file for loading into a spreadsheet, you may well find that it is easier to defer totalling to the spreadsheet unless, of course, you are dealing with a file too large before totalling to be loaded into memory. After you have entered a key expression, the system prompts for a name for the resulting file, and a description for your MY_FILES catalog. When the totalling is complete, the system will prompt whether you want to return to the original file for further work, or whether to immediately load the file you have just created. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³This function creates a new database consisting of totals or subtotals from ³ ³the current database. The totals file will include all of the items (columns)³ ³on this file--regardless of any subset you may have specified in SELECT ITEMS,³ ³and regardless of any LABELS you may have added. Labels can be added to the ³ ³totals file, but only after this process is complete. ³ ³ ³ ³The prompt below asks you to specify an item or expression as the KEY. As ³ ³the program reads in new records from the file, it generates a total every ³ ³time the value of KEY changes. ³ ³ ³ ³The output file will contain sums for every numeric item selected (up to a ³ ³maximum of 24). Since the program will bomb if a field is not wide enough ³ ³to accommodate the total generated, SELECT ITEMS to exclude flags and other ³ ³numeric fields not wide enough. For codes and other alphabetic items, the ³ ³totals file will present the first value encountered within the total. ³ ³ ³ ³Totalling can consume a lot of time and disk space. If the number of output ³ ³records will be large, and if you are interested in only a small subset of ³ ³items, it may be advantageous to extract a file first and then perform the ³ ³totalling on that. ³ ³ ³ ³ Enter KEY on which to total: ³ ³ ³ ³MSA = 5120 to 5120 ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ You will get the results you want only if the records to be totalled are consecutive. If not, you probably need to first create a new index (option 2 on the Manipulate Files menu--the indexing key is likely the same as your planned totalling key). =>How to Select Records with Conditional Clauses While record selection by way of the 2-level menus works well for most uses, those familiar with dBase may occasionally prefer to specify conditional clauses directly. This is possible by typing C when the first record selection menu is presented, whereupon the prompt "Enter conditional expression:" appears at the bottom of the screen. What you enter at this point becomes the argument for the dBase-style expression SET FILTER TO. Sample entries include -- SALES >= 10000 MSA = "5120" .and. RECTYPE = "04" RECTYPE = "02" .or. RTL87KB = "001" IIF(ESTAB>0,SALES/ESTAB,0) >= 10000 Note that when entering desired values for code fields stored as character variables, they must be enclosed in quotes. While the first two examples could be entered easily by way of the menu system, the last two examples illustrate conditions that can only be specified in this way. The Select Records menu system assumes that conditions set for two variables are additive, i.e., they would be connected by a Boolean ".and.". The third example shows the use of an ".or." condition, in this case selecting all state level records (RECTYPE = "02") but only those records at other levels that are for trade area totals (RTL87KB = "001"). The last example illustrates the selection of all records with more than $10,000,000 (10000) in sales per establishment. Note, however, that it was necessary to imbed that SALES/ESTAB fraction within an "immediate if" (IIF) to make sure that the program does not attempt to divide by zero when it encounters a record where the number of establishments is zero (e.g., not available). One of the major pitfalls of directly entering conditional expressions is that an error in punctuation or logic may lead to abrupt program termination. Record selection by way of conditional expressions does not take advantage of indexes that may speed many of the code searches using the normal menu approach. You may be able to get around this problem by selecting records in two "passes". To select records in the Minneapolis-St. Paul MSA with at least a certain ratio of sales per establishment, select the MSA on the first pass through select records, then select records again, this time entering R to einstate the previous selection criteria before typing C to specify the onditional expression. Note that the program expects you to enter the conditional clause without the words FOR or WHILE that you might use in dBase. =>Displaying Secondary Files The Advanced Options menu option 2--"Display secondary file"--allows you to look at another data file without losing your place in the main file selected. This is a "no-frills" display, with no item descriptions from a data dictionary, no ability to alter column width, and no ability to select items or records. This screen does allow rudimentary editing of the data file, including record insertion and deletion, assuming the file is not on a CD-ROM. Following are a few examples of ways you may use this option. Checking a previously created extract file. In the middle of setting up a data extraction, you may wish to refer to a file you previously created, for example, to include the same statistics. Checking a code list. You can generally view the labels corresponding to particular codes by using the Add Labels function or by going through record selection. If either of those approaches would disrupt the way you have your main file set up, you may display the label file through this option. Deleting selected records. 1990 census STF CD-ROMs have multiple records for a particular area within certain summary levels, each defined by a different GEOCOMP code. In order to get rid of the extras, the easiest way may be to create an extract file (DBF format), load it with this option, point to the second in each group of apparently duplicate records, then delete it by pressing U, and repeat as necessary. If you previously created any indexes for this file from the Manipulate Files menu, you will need to redo them if you have deleted or inserted records. Editing particular fields. You may change the data in a field, for example, to make your own annotation to an area name, by pressing to start the edit mode, typing over the existing contents, and pressing again to complete the edit. This can be tedious if more than a few records are involved. =>How to Get EXTRACT to Work with Other dBase Files While EXTRACT was primarily designed to work with files as issued by the Census Bureau, it is possible to add other dBase III-compatible files to your MY_FILES catalog and to create data dictionaries for them, as a prelude to being able to merge these data with data you have derived from census files. From the Advanced Options menu, Option 5 confirms the name and location of your MY_FILES catalog file, then prompts you to dd to or eplace your existing catalog. Replacing wipes out any previous entries in the MY_FILES catalog. The next prompt is to "Enter full filename or mask", to which you should respond with a filename in the form "c:\dbase\mydata.dbf" or "c:\census\*.dbf". Both "?" and "*" can be used in DOS wildcard expressions. EXTRACT adds each file name that fits that directory mask to the catalog, and then displays the catalog entries to the screen. Cursor to the right until you see the "title" field, then enter whatever descriptive statement will be useful to you in the future. If you have accidentally added files that do not belong in the catalog, delete them with U. If the system cannot find a data dictionary for each file added to the catalog (it looks in the default directory and in the same directory as the data file for a data dictionary that may have been created previously), EXTRACT will create one, asking you to specify a directory location for the .DCT file. Unless you specify otherwise, it will put it in the same directory as the data. In order to create a data dictionary, the system will ask for the full name of an existing dictionary files that it can use as a pattern--i.e., a .DCT file that already exists in the \AUXIL subdirectory on the CD-ROM or in an auxiliary directory installed on your hard disk. If you specify a .DCT file with any field names that are the same as field names in new .DBF file, the program will copy their descriptions to the new dictionary, saving you the trouble. The program then presents you with the field names and spaces to fill in descriptions. You must press after you have edited any field in order to move on to the next field. After you enter all of the 60-character descrip- tions and press , the program will prompt you for 40- and 20-character descriptions, which you may skip if you wish. The final set of prompts is for entries to fields called LABELFILE, LABELNDX, LABELKEY, and ALTNAME, which, if applicable, the program will have already picked up from the pattern .dct(s). If the data file you are adding to the catalog is not one you are familiar with, you may find that you are not confident of the descriptive titles you are entering for files and variables. Rest assured that you can return to the Advanced Options menu at any time to further edit the titles in your MY_- FILES.CTG (Option 6) or in the data dictionaries you have created (Option 4). These procedures do not attempt to create label files for databases created outside of EXTRACT. If you want to do so in dBase III, adapt the structure of one of the label files on CD-ROM insofar as is possible. =>Miscellaneous Notes If you find that you are not able to move up or down or side to side on screen displays, check to make sure that your NumLock key has not been set on. The program can be aborted at any time by pressing C, and answering No to the question displayed at the top of the screen. Aside from , this may be the only way to regain control of the computer if the system is doing a search that is taking so long that you lose interest.