• <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
      • 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
        • ABS Function
        • CMCode Function
        • CountNonSpecial Function
        • Exp Function
        • High Function
        • Inc Function
        • Int Function
        • Log Function
        • Low Function
        • Random Function
        • RandomIn Function
        • Round Function
        • Seed Function
        • Sqrt Function
        • Set Behavior SpecialValues Statement
      • 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>

Set Behavior SpecialValues Statement

Feature Upgrade: Starting with CSPro 7.1, you should no longer use this function as it may soon be removed from CSPro. To replicate the behavior of the function, you can use the setproperty function with the argument "SpecialValuesZero".

 

Format:

set behavior() specialvalues(zero) on | off;

 

Description:

The set behavior specialvalues statement allows special values to be treated as zero (0) values during arithmetic operations, including addition, subtraction, multiplication, division, and modulo. By default this behavior is disabled. The set behavior statement affects all numeric data items from the point where it is executed onward. To limit its scope, it must be turned on and off at appropriate times.

 

Example:

 

PROC GLOBAL

 

numeric var1,var2,var3;

numeric result;

 

PROC SUMMATION

 

var1 = 5;

var2 = 10;

var3 = default;

 

set behavior() specialvalues(zero) on;

result = var1 + var2 + var3; // result will be 15

 

set behavior() specialvalues(zero) off;

result = var1 + var2 + var3; // result will be DEFAULT

 

 

See also: Special Values