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

SAS Data Source

Overview
The SAS data source allows writing, but not reading, data to a SAS file, written natively in the SAS Transport File (.xpt) format. This file is written along with a SAS program (.sas) file that contains CSPro's value set labels along with the syntax necessary to use the XPORT Engine to import the values.
This data source is similar to the other data sources that write to formats used by statistical software: R, SPSS, and Stata.
The SAS data source is used when a file has the extension .xpt.
Functionality
The SAS data source supports the following features:
FeatureSupported
Reading cases
✘
Writing cases
✔
Notes, case labels, and case statuses
✘
Storage of more than one kind of record
✔
Binary data items
✘
Deleting cases
✘
Undeleting cases
✘
Syncing data
✘
Cases with duplicate keys
✘
Case identification via UUID
✘
Contains an embedded dictionary
✘
Allows record sorts
✘
Customizable Behavior
The following behavior can be customized by specifying properties in the connection string. The default behavior is marked with ⁺⁺⁺.
Property Name and ValuesDescription
 
"encoding"Determines the text encoding of the SAS program (.sas) syntax file.
"ANSI"
The contents are encoded as part of the Windows code page. On Android this value is ignored and "UTF-8-BOM" is used instead.
"UTF-8"
The contents are encoded as UTF-8 and written without a byte order mark (BOM).
"UTF-8-BOM" ⁺⁺⁺
The contents are encoded as UTF-8 and written with a three-byte BOM.
 
"mappedSpecialValues"Determines how the special values missing and refused are written.
"codes" ⁺⁺⁺
The value of the mapped code is written. For example, if missing is mapped to -99, then -99 is written.
"native"
The value is mapped to SAS's special missing values: missing is mapped to .A and refused is mapped to .B.
"suppress"
No value is written.
 
"record"If the name of a record is provided, only items from that record are written.
 
"syntaxPath"By default, the SAS program (.sas) syntax file is written in the same directory as the SAS transport file (.xpt), with the same name as the transport file, followed by .sas. This property allows you to give a custom name for the program file. The property is evaluated relative to the path of the data file.
For example, the following connection string, specified in a batch PFF, would result in a SAS file containing the values of the HOUSING_REC record written using SAS's special missing values, with an overridden name for the SAS program file (rather than the default housing.xpt.sas).
OutputData=housing.xpt|mappedSpecialValues=native&syntaxPath=housing-sas-export.sas&record=HOUSING_REC
See also: Data Sources