• <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>

SetOccLabel Function

Format
b = setocclabel(ʃitem_name ‖ group_name,ʅoccurrence_label);
Description
The setocclabel function sets the occurrence label for a repeating item or group (i.e., the row label of a roster). This is especially useful when designing applications for mobile devices, as it allows you to specify the label that is displayed in the navigational case tree. If no item_name or group_name is given, the function sets the occurrence label of the current field. The occurrence label is set to the string expression occurrence_label.
Return Value
The function returns a logical value of 1 (true) if the label was set successfully and 0 (false) if the occurrence for the item or group item does not exist.
Example 1
PROC PERSON_NAME

   
setocclabel(PERSON_ROSTER,strip(PERSON_NAME));
Example 2
PROC MYSURVEY_QUEST

preproc

   
// fill in occurrence labels for the household roster
    do numeric ctr = 1 while ctr <= totocc(PERSON_ROSTER)
       
setocclabel(PERSON_ROSTER(ctr),strip(NAME(ctr)));
   
enddo;
See also: GetOccLabel Function, Occurrence Labels, ShowOcc Function