• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
      • Introduction to CSPro Language
      • Data Requirements
      • CSPro Program Structure
      • Programming Standards
      • Code Folding
      • Debugging CSPro Applications
      • Declaration Section
        • Compiler Mode
        • Variables
        • Alias Statement
        • User-Defined Functions
        • Array Object
        • Audio Object
        • Case Object
        • Document Object
        • File Object
        • Freq Object
        • Geometry Object
        • HashMap Object
        • Image Object
        • List Object
        • Map Object
        • Pff Object
        • SystemApp Object
        • ValueSet Object
      • Procedural Sections
      • Logic
      • Language Elements
    • Data Entry Module
    • Batch Editing Applications
    • 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>

Alias Statement

Format
alias aliased_name : original_name;
Description
The alias statement allows for the creation of new names to alias, or to provide an alternative reference to, names in a program. This can be used to shorten, or lengthen, variable names, or to match names in a dictionary with preexisting code using a certain naming convention.
You can define aliases in logic, or directly in the dictionary editor.
Example 1: Shortening Dictionary Names to Quicken the Typing of Variables
alias   P14 : P14_AGE,
        P15 : P15_RELATIONSHIP,
        P16 : P16_SEX;
Example 2: Using Aliases to Standardize Variable Names so that Logic Can be Reused Across Programs
alias   AGE             : P14_AGE,
        RELATIONSHIP    : P15_RELATIONSHIP,
        SEX             : P16_SEX;
In both examples, P14_AGE, P15_RELATIONSHIP, and P16_SEX are the names of items declared in a dictionary. Once the alias statement has been specified (in PROC GLOBAL), the names P14 and P14_AGE can be used interchangeably. For example, these two statements are identical:
if P14_AGE < 18 and P16_SEX = 2 then

if AGE < 18 and SEX = 2 then