• <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
      • 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
      • 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
        • AdjLBA Function
        • AdjLBI Function
        • AdjUBA Function
        • AdjUBI Function
        • DateAdd Function
        • DateDiff Function
        • DateValid Function
        • PublishDate Function
        • SetLB Function
        • SetUB Function
        • SysDate Function
        • SysTime Function
        • timestamp Function
        • timestring Function
      • External File Functions
      • Synchronization 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>

SetUB Function

Format
i = setub(month, year, maximum_cmc);
Description
The setlb function returns the upper bound of the century month code (CMC) of an event. The arguments month, year, and maximum_cmc are all numeric expressions.
If the month and year are both valid, the function returns the CMC of that date, as if calling:
i = cmcode(month, year);
If the month is invalid but the year is valid, the function returns the CMC of December in the valid year, as if calling:
i = cmcode(12, year);
If both the month and year are invalid, the function returns the upper bound represented as maximum_cmc.
Return Value
The function returns the upper bound of the CMC of an event.
Example
if CM12Y < 9997 then
    ldoblc = 
setlb(CM12M, CM12Y, 0);
    udoblc = 
setub(CM12M, CM12Y, 9999);
endif;
See also: SetLB Function, CMCode Function, AdjLBA Function, AdjLBI Function, AdjUBA Function, AdjUBI Function