• <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
        • Compress Function
        • Decompress Function
        • diagnostics Function
        • Encode Function
        • ErrMsg Function
        • ExecSystem Function (Desktop)
        • ExecSystem Function (Mobile)
        • ExecPFF Function
        • GetProperty Function
        • GetLabel Function
        • GetLanguage Function
        • GetSymbol Function
        • GetValueLabel Function
        • hash Function
        • htmldialog Function
        • InValueSet Function
        • Invoke Function
        • IsChecked Function
        • loadsetting Function
        • LogText Function
        • MaxValue Function
        • MinValue Function
        • paradata Function
        • PathConcat Function
        • PathName Function
        • savesetting Function
        • SetLanguage Function
        • SetProperty Function
        • SetValueSet Function
        • SetValueSets Function
        • Special Function
        • sqlquery Function
        • Stop Function
        • SysParm Function
        • tr Function
        • Trace Function
        • UUID Function
        • View Function
        • Warning Function
      • 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>

paradata Function

Format
d = paradata(action_typeʃ, argument1, ..., argumentNʅ);
Description
The paradata function performs an action related to the paradata log. The first argument, action_type, must be one of the following:
action_typeDescription
concatConcatenates several paradata logs into a single log. The first argument is the file name of the output log. The subsequent arguments are the file names (as string expressions or string List objects) of input logs. You can concatenate into the currently open paradata log, but in that case you must also include the currently open paradata log as an input.
queryExecutes a query on the paradata log. This is the same as: sqlquery(filename(paradata), ...). You can also query paradata logs using the Sqlite.exec action.
openOpens a paradata log to start logging events. Specify the file name as a string expression as the sole argument.
closeCloses the currently open paradata log.
flushWrites all cached paradata events to the log. This is rarely needed, and may only be necessary if you want to query the paradata log from an external application.
It is not recommended that you open or close paradata logs via logic, as the log will not contain all of the initializing features that exist when specifying the paradata log when the application begins (and via the PFF file).
Return Value
For the open, close, and flush actions, the function returns a logical value of 1 (true) if successful and 0 (false) otherwise. For the concat action, the function returns the number of paradata logs concatenated, or default upon error. Look at the documentation for the sqlquery function to see the return values for the query action.
Example - Concat
List string logs_list;

dirlist(logs_list, "C:/Survey/Paradata", "*.cslog");

// add the paradata logs into the currently open log
paradata(concat, filename(paradata), filename(paradata), logs_list);
Example - Query
string message_events_query = maketext(
   
"SELECT COUNT(*) "
   
"FROM message_event "
   
"JOIN event ON message_event.id = event.id "
   
"JOIN case_instance ON event.case_instance = case_instance.id "
   
"JOIN case_info ON case_instance.case_info = case_info.id "
   
"WHERE case_info.uuid = '%s';",
   
uuid(DICT_NAME));

numeric message_events_for_this_case = paradata(query, message_events_query);
See also: Paradata, sqlquery Function, SyncParadata Function