• <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
        • Average Function
        • Count Function
        • CurOcc Function
        • Delete Function
        • GetOccLabel Function
        • Insert Function
        • Max Function
        • MaxOcc Function
        • Min Function
        • NOccurs Function
        • Seek Function
        • SeekMax Function
        • SeekMin Function
        • SetOccLabel Function
        • SOccurs Function
        • Sort Function
        • Sum Function
        • Swap Function
        • TotOcc Function
      • General Functions
      • Date and Time Functions
      • 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>

TotOcc Function

 

Format:

i = totocc([group]);

   

Description:

The totocc function returns the total number of multiply occurring records or the total number of multiply-occurring items that a group currently contains.

 

During data entry, the occurrence value is updated in the preproc of the first field within a repeating form, record or roster. If the totocc function is executed prior to the entry of form or roster, it returns 0. If it is executed from a group or field within the form or roster, it returns the total number of occurrences currently entered. If it is executed after the form or roster, it returns the total number of occurrences in the form or roster.

 

During batch editing, totocc always returns the total number of occurrences in the group.

 

Return value:

The function returns an integer value of the number of occurrences.

 

Example 1:

if totocc(HOUSING) > 1 then

  errmsg("More than 1 housing record");

endif;

 

Example 2:

PROC HOUSING

if totocc() > 1 then

  errmsg("More than 1 housing record");

endif;

 

See also: Curocc Function, Maxocc Function, Count Function, Soccurs Function, Noccurs Function