Dexter Quick Start Guide

A primer for the MCDC's Data Extracter application

A video-based companion module is also available for this guide.

This brief tutorial is intended to assure the casual and/or first-time user of Dexter that the application does not have to be as complicated as the input form makes it look. To be sure, some extracts can get pretty complicated, depending on the data set and what you need to do with the data. But in many cases, the program can create useful extracts with almost no input specifications from the user. The general rule of thumb is that Dexter makes it very easy to extract a lot of data; it only gets more challenging when you use it to get exactly what you want.

Note that the Dexter query form contains links to the appropriate section of the Dexter help page.

The Dexter query form has six parts, but only one requires input from you.

Header Area

Dexter form header

The header area (data set) identifies the data set being accessed. The path (directory) being accessed is displayed separately and is a link, which if clicked will take you back to viewing the directory's contents via Uexplore. The data set name is displayed in a text box. Dexter allows the user to edit the name of the data set being accessed, but just because you can does not mean you should. If the set you specify does not exist (typos are easy to make and common), or if the new set specified does not have the exact same variables as the one being replaced then the Dexter application will fail.

For many (but not all) data sets there will be a link (after the Data Set input) to detailed metadata for the current data set. It is almost always a good idea to follow this link the first time you access a data set.

The Quick Look button is useful when you want to get an idea of what the data set looks like by previewing a subset. Clicking this button displays the first (up to) 100 observations/rows of the data set and, by default, just the identifer variables. If you want, you may select the columns of interest in Section III first, and then hit the Quick Look button to see just your selected variables for the first 100 rows.

You can enter a description of your query in the Query description input and it will be displayed on the Summary Log page. If you save your query page, the description will also be captured there.

Section I. Output Formats

Dexter section I

This is where you specify what output format(s) you want. If you want a comma-delimited file, then you need do nothing in this section (CSV stands for comma-separated values). If you want your output in a report format (not usually recommended if you have lots of variables), then make a choice other than "none" from the 2nd set or radio buttons; plain text is the fastest with the least formatting and is good for quick-and-dirty queries; PDF requires the most time to generate but perhaps looks the best. HTML is somewhere in the middle in terms of resources required to generate; it looks good in your browser but may lose something when printed. If you want something in a database format, the third set of radio buttons lets you specify output in either DBF or SAS dataset (for Windows) format. Note that the three sets of radio buttons are independent of each other; you can select up to three separate output formats, one per type.

Pipe report directly to browser is an optional convenience that can be safely ignored, especially by new users.

Section II. Filter Rows

Dexter section II

This section is the one that requires the most attention for most queries. You can always choose to just not enter anything in this part of the form, which will result in your getting data for every row/observation in the data set. This may often be just what you want. In many cases, even if it is not exactly what you want, you can go ahead and take all of it and then delete what you don't need once you have it in your local file.

You can also make use of the text box labeled Limit the number of output observations/rows. By entering a small number (50, for example) you can quickly run a test of the extract and examine the results before going back and doing the final complete extract.

Most data sets have variables that are keys to identifying the meaning of the data contained in a row; such identifiers are often geographic codes such as State, County, Place, etc. If you know the codes used for these variables, it can be pretty simple to create a filter. For example, if the data set you are accessing indicates it has data for every county in the U.S., and you are only interested in data for the state of California, then you can specify this by making choices/entries in the first of the five rows of entry boxes in Section II. (This is by far the hardest part of what we'll be dealing with here — but remember, many extracts can be done without having to do any such filtering.) The form uses drop-down menus in the first two columns of Section II; the third column is a text entry box where you need to type in a value.

There are also checkboxes down the left and right sides of Section II to insert parentheses into the logical expression. These are rarely used (only for complex logical expresssions involving three or more conditions) and should almost always be ignored, especially by new users.

Assuming that the data set you are accessing has a variable (field) named State and that this field contains a two-digit FIPS state code (which it always will in our data collection), then you would select "State" from the pull-down in row 1, column 1; then select "Equal To (=)" as the value for Operator from column 2. In the third column, you have to type in something. Enter the value "06" in the text box. To do this you have to know your FIPS/ANSI state codes. You must include the leading zero, because this field is not stored as a numeric value, but as a character string. Typing a value in the third column that does not match any of the values for the specified variable would result in filtering all the data, and after you hit an Extract Data button, it would result in an error message.

The screen shot above shows a filter condition for only rows for California (state = 06). It also shows that we will limit output to the first 100 cases that pass the filter.

There are lots of examples of how to code filters in the Dexter online tutorial, and a discussion of how to use the metadata to access web pages showing you the values and meaning of those values for many key variables on the data sets. Two commonly used sources for viewing the values for coded variables are:

Section III. Choose Columns (Variables)

Dexter section III

This is the only section where you are required to select something. While Section III may be required, and can sometimes be somewhat tedious to navigate if there are a lot of variables, it is really just a matter of making choices off a pair of select menus. We separate the ID variables from the numerics, because we find that we almost always need to select a few good identifiers. In many of our data sets there can be hundreds, if not thousands, of numerics. These side-by-side drop-down select menus contain variable names as well as descriptive labels in most cases. But you may still have to consult a data dictionary to make sure you know exactly what some of these variables really represent. Be sure to hold down the ctrl key when making multiple selections from these select menus.

For some data sets (those having more than 100 numeric variables) you will see extra options below the select list labeled Filter by regular expression. We suggest first-time users just ignore this feature until later. It allows you enter something in the text box and then click on the Filter button to have the list regenerated so that only entries that match the text box entry appear on the menu. This can be very handy when the list has hundreds of entries. But for the large majority of data sets and queries you will never have to use this feature.

Section IV. Other Options

Dexter section IV

These non-essential options can be used to provide title and footer labeling for report output, and for specifying a sort order for the output. This section can usually be skipped.

Section V. Advanced Options

These options are beyond the scope of this document and can be ignored by first-time users. You should learn to do basic extracts before trying to use these advanced features. When you are ready to try these out, you can follow the link to the online documentation to see what they are all about. Not everything in this section is really all that complicated.

Running the Application and Retrieving the Results

To execute your query, click any of the Extract data buttons. The results of the query will be displayed back to your browser. Wait for it to display a message saying "Processing completed at [time and date]". Note that at the the top of the screen you should see a job ID code ("15JUN18_00001" as shown).

Dexter section IV

If you encounter an error that you do not understand while using Dexter, please report the error to the Questions and comments regarding Dexter email link at the bottom of the Dexter query form and include this job ID as part of the message you send. Such problems should be rare. If the query works, you will see a link to a Summary Log page and to the requested output file(s): delimited, report, and/or database. The Summary Log page is your record of what you specified and provides a concise record of the query. If you need to document your source, we strongly recommend that you save this file somewhere.

The links to the output file(s) will be to temporary files created in a temporary directory created when you invoke Dexter. This directory is automatically deleted after 24. (Occasionally, we may experience overload on the system causing us to run short of temporary work space, in which case your results may be deleted in less than 24 hours.) We strongly recommend that you download your output files as soon as possible. The simplest way to download is by right-clicking on the file link and then selecting the Save Link As... option. You will then be prompted to specify the target location on your system.

Note that you can share your results with colleagues or clients by right-clicking on the file links and choosing the Copy link location (or address) option to copy the URL of the file. This technique is used frequently by MCDC personnel who run queries for users and then simply e-mail a link to the results to the user. (Just remember the 24-hour time limit.)

In the case of a SAS dataset, the typical process involves doing a right-click and saving the .sas7bdat file to your local system. Then you can open it within a SAS desktop session by coding a libname statement referencing the directory where you saved the file and then by opening the data set within that directory. So, for example, if you save the file as C:\temp\xtract.sas7bdat on your local disk, then from your SAS session you would submit the statement libname temp "c:\temp"; You could then run a data step that starts with something such as proc summary data=temp.xtract (where=[condition]); ....

Note that the file you save to on your desktop should be named "xtract.sas7bdat" (because the SAS data set name is actually stored within the file). If you want a different name, you can rename it using SAS (use the DIR window if you have FSP, otherwise use proc datasets). In many cases you may need to submit the SAS statement options nofmterr; to avoid having problems caused by references to custom SAS format codes that may appear in the data set. Do this prior to attempting to access the data set.

If you view your results and decide they are not exactly what you intended, you should be able to use your browser's Back key to return to the Dexter query form. Unfortunately, it cannot be guaranteed that when you return that the browser will remember all your specifications that you just entered on the form. Our experience has been that with the Firefox browser this is never a problem, our specifications are always restored. With IE it is not always so. The Firefox browser also has a useful feature that is not available wiht IE (version 7): you can save your query to a file on your desktop by doing a File — Save as from the Dexter query screen after it has been filled out. Firefox generates code that preserves all your textbox entries and select-list/option choices. Subsequently you can open this saved HTML file (in any browser, not just Firefox) and you will be back where you left off. You can even send your saved query file to someone else and tell them here is how you do it — just open this file in a browser. They can then customize the query and resubmit it. For example, if you did a complex extract of data tables for all the counties in California but your colleague in New York wanted NY counties, they could easily modify the filter row where you specified the condition "State Equals 06", specifying instead "State Equals 36," and they would get comparable results for New York counties.

Getting Help With Your Query

You can always ask for help with your query. The ideal situation is to have a query system where users can go and access a wide variety of data strictly on their own without any assistance from the people who built the system. While we continue to work toward that ideal, the current reality is that in very many cases users — especially new ones not familiar with the software and the data archive — will simply not be able to easily find and/or extract the data they need. You can use the email link at the bottom of the Dexter query page (and this page as well) to ask for assistance. We cannot guarantee, of course, that we have the data you are looking for, or that Dexter will be the appropriate tool for accessing the data and getting it into the format you require; but we are always available to assist you as best we can with the data and tools we have available. In many cases, MCDC personnel can run the query and point you to the results much faster than they can explain to you how to do it. That is often the best solution if you think you are in that category of first- and last-time user.

To Learn More

The MCDC has a number of online tutorials (besides this one) related to Dexter and Uexplore. To see what's available visit the Uexplore/Dexter tutorials page. (The Powerpoint modules referenced there should be helfpful, but they were really developed to be used in a hands-on workshop setting.) And for those of you who just want the facts, you really can't beat the basic online help.