• <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 Connection String

Overview
A data connection string is a kind of connection string used to specify a data source. The resource is typically a file path or file name, which can be specified as a relative or absolute path.
Data connection strings are used in PFF files as well as in logic when data sources are specified, such as when using the setfile function.
For example, this connection string defines a resource, an Encrypted CSPro DB data source, and a property defining the password used to open the file:
Census.csdbe|password=MyPa%24%24w0rd%21
Used in logic, this might look like:
setfile(CENSUS_DICT, "Census.csdbe|password=" + encode(PercentEncoding, "MyPa$$w0rd!"));
The properties that can be specified differ for each data source and are documented in the topics describing each data source.
Type Calculation
The property "type" can be used to specify the data source type. Generally, it is not necessary to define a type because it can be deduced from the file extension, but in a couple cases it is necessary. This, for example, is how the None data source, which does not have a resource, is specified:
|type=None
The table below lists the type values as well as the default extension for each data source. If no type is explicitly specified, it will be matched based on the extension. If it matches none, the Text data source is used. In other words, most extensions will map to a Text data source.
Data SourceDefault ExtensionType
CSPro DB.csdb"CSProDB"
Encrypted CSPro DB.csdbe"EncryptedCSProDB"
Text.dat"Text"
JSON.json"JSON"
CSWeb—"CSWeb"
None—"None"
In-Memory—"Memory"
Comma Delimited (CSV).csv"CSV"
Semicolon Delimited.skv"Semicolon"
Tab Delimited.tsv"Tab"
Excel.xlsx"Excel"
R.RData / .rda"R"
SAS.xpt"SAS"
SPSS.sav"SPSS"
Stata.dta"Stata"
CSPro Export—"CSProExport"
See also: Connection String, Data Sources