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

Initialize Hot Decks in Program Logic

In this technique, the hot deck is initialized in program logic. Hot deck values are updated during the program's execution but the values are not saved externally.
The following is an example of code that will initialize age values based on sex and relationship:
PROC GLOBAL

// declare an array and set the initial values

Array AgeSRDeck(2,6) =  27, // male head of HH
                        30, // male spouse of head
                         6, // male child of head
                        58, // father of head
                        11, // male other relative of head
                        24, // male non-relative of head
                        32, // female head of HH
                        25, // female spouse of head
                         8, // female child of head
                        60, // mother of head
                        10, // female other relative of head
                        27; // female non-relative of head

PROC AGE

   
if AGE = notappl then
       
// if the value for age is not valid...
        // assign the value from the hot deck based on sex and relationship
        impute(AGE, AgeSRDeck(SEX, RELATIONSHIP));

   
else
       
// otherwise...
        // update the value of the hot deck
        AgeSRDeck(SEX, RELATIONSHIP) = AGE;

   
endif;
See also: Dynamic Imputation (Hot Deck), Use Hot Decks, Initialize Hot Decks Using Saved Arrays