• <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
      • External File Functions
        • Clear Function
        • Close Function
        • CountCases Function
        • CurrentKey Function
        • DelCase Function
        • DirCreate Function
        • DirDelete Function
        • DirExist Function
        • DirList Function
        • FileConcat Function
        • FileCopy Function
        • FileCreate Function
        • FileDelete Function
        • FileEmpty Function
        • FileExist Function
        • FileName Function
        • FileRead Function
        • FileRename Function
        • FileSize Function
        • FileTime Function
        • FileWrite Function
        • Find Function
        • Key Function
        • KeyList Function
        • LoadCase Function
        • Locate Function
        • NMembers Function
        • Open Function
        • Retrieve Function
        • Set Access Statement
        • SetFile Function
        • Set First Statement
        • Set Last Statement
        • Write Function
        • WriteCase Function
      • 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>

LoadCase Function

Format
b = loadcase(dictionary_nameʃ, id1, ..., idNʅ);
Description
The loadcase function reads a specified case from an external file into memory. Once the case is loaded, all variables defined in the corresponding dictionary are available for use.
The dictionary_name must be supplied and refers to an external dictionary associated with your application.
The optional list of ID variables, id1 ... idN, specifies the list of variables that will identify the case to load from the external file. This process is similar to matching files on the basis of key variables in statistical and database software packages. Generally, each of the variables in the list is defined in a dictionary. The combined length of the variables in the list must equal the length of the case IDs defined for the external dictionary. The function concatenates the variables in the ID list to form a string. Alternatively, you can pass, as a string, the full key of the case to load. The function then loads from the external file the case whose case identifier matches the string constructed from the list.
If no ID list is provided, the next logical case in the external file will be loaded. The determination of what is "next" is based on the dictionary's access parameters.
(In versions of CSPro prior to 7.0, calling this function would automatically open an external file. The function no longer does this, so if you call close on an external dictionary, you must open it manually before calling this function.)
Return Value
The function returns a logical value of 1 (true) if the case was loaded successfully and 0 (false) otherwise.
Example
if loadcase(SAMPLE_DICT, CLUSTER, HH) then
    SURVEY_WEIGHT = SAMPLE_WEIGHT;
endif;
See also: Retrieve Function, WriteCase Function, Data.getCase Action