• <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 Statements and Functions
      • Statement Format Symbols
      • Alphabetical List of Functions and Statements
      • List of Reserved Words
      • Deprecated Features
      • Declaration Statements
      • Numeric Values
        • JSON Representation
        • JavaScript Representation
      • String Values
      • Symbol Functions
      • Item Functions
      • Array Object
      • Audio Object
      • Barcode and QR Codes
      • Case Object
      • Document Object
      • File Object
      • Freq Object
      • Geometry Object
      • HashMap Object
      • Image Object
      • List Object
      • Map Object
      • Path
      • Pff Object
      • StringWriter Object
      • SystemApp Object
      • ValueSet Object
      • Program Control Statements
      • Assignment Statements
      • Data Entry Statements and Functions
      • Batch Edit Statements
      • Numeric Functions
      • String Functions
      • Multiple Occurrence Functions
      • General Functions
      • Date and Time Functions
      • External File Functions
      • Synchronization 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>

CSPro ⇄ JSON Conversions: Numeric Values

A CSPro numeric value, created as a numeric or as part of an object such as a List, is generally represented as a JSON number. However, special values are serialized as strings:
CSPro ValueJSON Value
notappl"NOTAPPL"
missing"MISSING"
refused"REFUSED"
default"DEFAULT"
Note that notappl is serialized as null in JavaScript but as a string in JSON.
When converting a JSON value to a CSPro numeric, the following conversions are supported:
JSON ValueCSPro Value
numbernumber
true1
false0
nullnotappl
"NOTAPPL"notappl
"MISSING"missing
"REFUSED"refused
"DEFAULT"default
The strings representing special values are processed in a case-insensitive manner. For example, both "MISSING" and "miSSing" are converted to missing.
Converting a string that contains a number succeeds even if the number is followed by a non-number. That is, both "40" and "40 days" are converted to 40, but "forty" results in an exception.
Converting an array or object results in an exception.
See also: JSON Representation of Symbols Overview, CSPro ⇄ JavaScript Conversions: Numeric Values