• <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
        • EndCase Statement
        • Export Statement
        • Freq Statement (Unnamed)
        • GetDeck Function
        • PutDeck Function
        • Set Behavior Export Statement
        • SetOutput Function
        • Skip Case Statement
      • 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>

GetDeck Function

Format
f = getdeck(array_nameʃ,override_dim1, override_dim2, override_dim3]ʅ);
Description
The getdeck function returns the value stored in the DeckArray hot deck by using the current value(s) of the value set items that were defined as dimensions in the DeckArray declaration. The function automatically recodes the values and accesses the proper cell in the hot deck. If any of the DeckArray dimensions are not associated with a value set, then you must specify the desired numeric index when calling the function.
If (+) was specified after any of the array_name dimensions, the "leftover" rows for that dimension will be retrieved whenever an invalid value for that dimension is given.
Return Value
The function returns the value in the hot deck or DEFAULT in the event that the values supplied are not valid entries in the value sets and thus could not be recoded to a proper cell in the hotdeck. Note that DEFAULT will never be returned if all hot deck dimensions allowed "leftover" (i.e., they were defined with a (+)).
Example
Array education_HD_SexAge(SEX_VS, AGE_FOR_EDUCATION_HD_VS) save;

// more code ...

PROC EDUCATION

    EDUCATION = 
getdeck (education_HD_SexAge);      // use current values for sex and age
    EDUCATION = getdeck (education_HD_SexAge, 1);    // override sex only
    EDUCATION = getdeck (education_HD_SexAge,  ,28); // override age only
    EDUCATION = getdeck (education_HD_SexAge, 1,28); // override both sex and age
See also: DeckArrays, DeckArray Leftover Rows, PutDeck Function