• <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
        • Break Statement
        • Do Statement
        • Exit Statement
        • For Statement
        • ForCase Statement
        • For (Dictionary) Statement
        • If Statement
        • Next Statement
        • Universe Statement
        • When Statement
        • While Statement
      • Assignment Statements
      • Data Entry Statements and Functions
      • Batch Edit Statements
      • Numeric Functions
      • String Functions
      • Multiple Occurrence Functions
      • 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>

For (Dictionary) Statement

Format
for dictionary_nameʃ(mark_type)ʅ do
   
// statements
endfor;
Description
The for (dictionary) statement executes one or more statements repeatedly within a loop for each selection made during a selcase function call. This allows an operator to select some number of cases and then allows you to load each case and perform some analysis on the selected cases. Unlike the forcase loop, which operates on all cases in a data file, this loop only operates on selected cases.
The dictionary_name must be supplied and refers to an external dictionary associated with your application. An optional argument, mark_type, indicates what kinds of cases to process, and can be one of the following values:
mark_typeDescription
markedProcess only the cases selected by the operator during the selcase function call.
unmarkedProcess the cases not selected by the operator.
allProcess all of the cases that could have been selected by the operator.
If not specified, the mark_type defaults to marked.
Example
selcase(OCCUPATION_DICT,"Plantation") multiple;

numeric maxEducation;

for OCCUPATION_DICT do
    maxEducation = 
high(maxEducation,MAXIMUM_EDUCATION);
endfor;
See also: For Statement, ForCase Statement, NMembers Function