• <Helps for GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • CSPro Statements and Functions
      • Statement Format Symbols
      • Alphabetical List of Statements and Functions
      • List of Reserved Words
      • Deprecated Features
      • Declaration Statements
      • Program Control Statements
      • Assignment Statements
      • Data Entry Statements and Functions
      • Batch Edit Statements
      • Numeric Functions
      • String Functions
      • Multiple Occurrence Functions
      • General Functions
        • Compress Function
        • Decompress Function
        • Diagnostics Function
        • ErrMsg Function
        • ExecSystem Function (Desktop)
        • ExecSystem Function (Mobile)
        • ExecPFF Function
        • GetProperty Function
        • GetLabel Function
        • GetLanguage Function
        • GetSymbol Function
        • GetValueLabel Function
        • InValueSet Function
        • LoadSetting Function
        • LogText Function
        • MaxValue Function
        • MinValue Function
        • Paradata Function
        • PathName Function
        • Report Function
        • SaveSetting Function
        • SetLanguage Function
        • SetProperty Function
        • SetReportData Function
        • SetValueSet Function
        • SetValueSets Function
        • Special Function
        • SqlQuery Function
        • Stop Function
        • SysParm Function
        • Tr Function
        • Trace Function
        • UUID Function
        • Warning Function
      • Date and Time Functions
      • External File Functions
      • Synchronization Functions
    • Templated Reporting System
    • Appendix
  • <Helps for CSEntry>
  • <Helps for CSBatch>
  • <Helps for CSTab>
  • <Helps for DataViewer>
  • <Helps for TextView>
  • <Helps for TblView>
  • <Helps for MapView>
  • <Helps for TRSWin>
  • <Helps for CSDeploy>
  • <Helps for CSPack>
  • <Helps for CSFreq>
  • <Helps for CSSort>
  • <Helps for CSExport>
  • <Helps for CSReFmt>
  • <Helps for CSDiff>
  • <Helps for CSConcat>
  • <Helps for TRSSetup>
  • <Helps for ParadataViewer>
  • <Helps for ParadataConcat>
  • <Helps for ShpToMap>
  • <Helps for CSIndex>
  • <Helps for Excel2CSPro>
  • <Helps for CSWeb>

MaxValue Function

Format
d = maxvalue(item_name ‖ value_set_name);
Description
The maxvalue function returns the the maximum valid value for an item or value set. If a numeric item_name is provided, the function looks at the current value set for the item, or if no value set exists, looks at the item itself (returning a maximum value based on the item's number of digits). If a numeric value_set_name is provided, the function returns the maximum range or discrete value in the value set.
Return Value
The function returns the maximum valid value for an item or value set.
Example
PROC EDUCATION_CURRENT

    if EDUCATION_CURRENT = 1 and AGE > maxvalue(EDUCATION_CURRENT_PRESCHOOL_VS) then
        errmsg("Someone aged %d cannot be currently attending preschool.",AGE);
        reenter;
    endif;
See also: MinValue Function, High Function, GetLabel Function