To select the type of sort you wish to perform, press either
Ctrl+T, click on the toolbar button

, or go to the
Options menu and choose
Sort Type. The four sort choices available to you are described below.
This is the default sort method. Only
ID items from level 1 are available as sort keys. Use this sort type for data files that are structured by questionnaire—that is, when all records used to represent the questionnaire are present in the data file and the records are already grouped by questionnaire ID—they only need to be put in order by case ID. You would choose this sort type if your data file looks like this:
questionnaire 1, housing record
questionnaire 1, person record 1
questionnaire 1, person record 2
questionnaire 3, housing record
questionnaire 3, person record 1
questionnaire 3, person record 2
questionnaire 3, person record 3
questionnaire 2, housing record
questionnaire 2, person record 1
Use this method to prepare your data for editing with hot decks, for then it ensures similar entities (persons, farms, businesses, etc) that are located near one another will be used to impute missing or erroneous data for their "neighbors", as generally neighbors have similar characteristics to one another.
This option is similar to the sort above, and is also used for data files that are grouped by questionnaire. However, this method additionally lets you choose sort keys from non-repeating data items found within singly-occurring records located in level 1.
In the above example where the housing record is a single record type, all of its non-repeating items (i.e., those without occurrences) would be presented as sort keys along with the dictionary's level 1 ID items.
Use for this type of sort where a single record type contains additional information about the questionnaire, such as geographical classification codes like urban/rural.
A record sort is used for data files that are grouped by record type rather than by questionnaire (i.e., the case). This is useful when importing data from another source that stored the different questionnaire sections in separate files (such as databases that do not support hierarchical structures like CSPro), or if the different questionnaire sections were collected through different CSPro applications. When ready to process the data as a case, you'll first need to bring them together in a single file organized by questionnaire. Once these separate files are merged into a single file, you might end up with the following:
questionnaire 2, housing record
questionnaire 3, housing record
questionnaire 1, housing record
questionnaire 2, person record 1
questionnaire 1, person record 1
questionnaire 3, person record 3
questionnaire 3, person record 1
questionnaire 1, person record 2
questionnaire 3, person record 2
In addition to this sort option allowing ID items from any dictionary level to be used as a sort key, this option also allows the <record type> to be used as a sort key. You'll need to include it as a sort key if there is more than one record in the dictionary. Simply add it as the last sort key, after choosing the ID items that uniquely identify the case. Using the Popstan dictionary, the sort specifications would look like the following (note the ID item Urban/Rural was not selected, as it is not needed to uniquely identify a case):
This sort type expands on the case sort (IDs plus single record items) described above. In addition to singly-occurring records, you can choose to sort on one or more items from multiply-occurring records. However, please note if you have more than one multiply-occurring record in your dictionary, you will only be able to choose items from one of the records—you cannot select items from two or more multiply-occurring records.
This type of sort can be useful for reordering records within cases. For example, if you were using a dictionary like our Census Dictionary.dcf, and your population records got out of order, you could resort them based on the variable "Line Number."
- Sort Data will test to make sure that single record types (if defined) are present for each questionnaire.
- For case sorts, Sort Data will also check for duplicate case ID values. If duplicate are encountered, no sort is done but a list of duplicate case IDs is displayed.