• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
      • Introduction to Batch Editing
      • Create a Batch Edit Application
      • Order of Editing
      • Correcting Errors
      • How to ...
        • Manipulate Automatic Reports
        • Create a Specialized Report
        • Use Hot Decks
        • Initialize Hot Decks in Program Logic
        • Initialize Hot Decks Using Saved Arrays
        • Interpret Reports
        • Run Production Batch Edits
      • Steps in Developing a Batch Editing Program
    • Tabulation Applications
    • Data Sources
    • CSPro Statements and 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>

Manipulate Automatic Reports

During the testing and debugging stages of developing your application, you'll want to write out a lot of error messages to help find problem areas, and keep statistics on the number of times certain code blocks are being executed (or values are being imputed). You may begin to notice that you're using the same error message in several places. Rather than write out the message every time it's needed, you can define it once and refer to it whenever needed. For example, suppose you have the following error message scattered throughout your code:
errmsg("Current age after imputation is %d", AGE);
Why bother retyping it each time? You can simply define it once and reference it over and over. To do so, select the Message tab in the Message View. You will see one line that has been generated for you; it reads: /* Application ... message file generated by CSPro */. Beneath this simply add your error message (we'll give it number 100001):
100001 Current age after imputation is %d
Then, whenever you want to use this message in your code, simply use the message number:
errmsg(100001, AGE);
Besides simplifying your work, after you run your program, a convenient summary statistic will be generated for each user-defined error message, indicating how often it was used. A sample listing is shown below:
 Number    Freq  Pct.  Message text                                        Denom
 ------    ----  ----  ------------                                        -----
 100001       1    -   Current age after imputation is %d                      -
See the errmsg function for a detailed explanation of all the options available to you.