• <Helps for 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
      • Debugging CSPro Applications
      • Declaration Section
        • Compiler Mode
        • Variables
        • Arrays
        • Files
        • User-Defined Functions
        • Alias Statement
        • Ensure Statement
      • Procedural Sections
      • Logic
      • Language Elements
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • CSPro Statements and Functions
    • Templated Reporting System
    • Appendix
  • <Helps for CSEntry>
  • <Helps for CSBatch>
  • <Helps for CSTab>
  • <Helps for DataViewer>
  • <Helps for TextView>
  • <Helps for TblView>
  • <Helps for MapView>
  • <Helps for TRSWin>
  • <Helps for CSDeploy>
  • <Helps for CSPack>
  • <Helps for CSFreq>
  • <Helps for CSSort>
  • <Helps for CSExport>
  • <Helps for CSReFmt>
  • <Helps for CSDiff>
  • <Helps for CSConcat>
  • <Helps for TRSSetup>
  • <Helps for ParadataViewer>
  • <Helps for ParadataConcat>
  • <Helps for ShpToMap>
  • <Helps for CSIndex>
  • <Helps for Excel2CSPro>
  • <Helps for 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.
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