• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
      • Data Connection String
      • CSPro DB
      • Encrypted CSPro DB
      • Text
      • JSON
      • CSWeb
      • None
      • In-Memory
      • Comma Delimited (CSV)
      • Semicolon Delimited
      • Tab Delimited
      • Excel
      • R
      • SAS
      • SPSS
      • Stata
      • CSPro Export
      • Data Source Identification of Cases
      • Case Read Optimization
    • Synchronization
    • CSPro Statements and Functions
    • Text Templates
    • Templated Reporting System
    • HTML, Markdown, and JavaScript Integration
    • Action Invoker
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataManager>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

Data Source Identification of Cases

When working with cases in CSPro, a case's key is typically used to identify a case. The key is created by concatenating the values of the case's identification items together into a string. The value of each identification item is formatted using that item's Length and Zero Fill properties.
However, CSPro data sources use other identifiers to uniquely identify a case, partly because a case key may not be unique if a data source allows duplicate cases.
Each data source uses a position to identify the "location" of the case in the data source. This position is always unique to the data source, but a case's position may change when cases are modified. For example, the position of a case in a Text data source indicates the offset in the text file where the case is located. This position could change if a case located prior to the case were deleted.
Some data sources use a UUID, a universally unique identifier, to identify a case. A case's UUID can be retrieved using the uuid function. Unlike position, once automatically generated, a case's UUID does not change. Because the UUID is unique and does not change when the case key changes, it can be used to refer to a specific case. This remains true even as the case is modified.
The following table describes these identifiers as used by CSPro's main data sources:
Data SourceKeyPositionUUID
CSPro DBnot unique, duplicates allowedunique, constantunique, constant
Encrypted CSPro DBnot unique, duplicates allowedunique, constantunique, constant
Textuniqueunique, can changeunique, constant
JSONnot unique, duplicates allowedunique, can changenot used
CSWebnot unique, duplicates allowedunique, constantunique, constant
Note that it is possible for a Text data source to contain cases sharing the same key. For example, multiple data sources concatenated using the "file contents" could result in duplicate cases. If so, this Text data source would not be usable by some CSPro functions because an index cannot be created when the keys are not unique.
See also: Identification Items, Key Function, CurrentKey Function, UUID Function