The ACCESS Procedure for PC Files

ASSIGN Statement

Indicates whether SAS variable names and formats are automatically generated.

Syntax

ASSIGN= YES | NO | Y | N

Details

The ASSIGN statement indicates whether SAS variable names and formats are automatically generated. Where long names must be shortened to the SAS length limit of eight characters, variable names are automatically generated.
An editing statement such as ASSIGN appears after the CREATE and database-description statements. See "Create Statement" for additional information.
You can use the value NO (or N) to modify SAS variable names and formats when you create an access descriptor. Use NO (or N) when you create view descriptors that are based on this access descriptor. When creating an access descriptor, use the RENAME statement to change SAS variable names. Use the FORMAT statement to change SAS formats.
Specify a YES (or Y) value for this statement to generate unique SAS variable names from the first eight characters of the PC file column names. With YES, you can change the SAS variable names only in the access descriptor. The SAS variable names that are saved in an access descriptor are always used when view descriptors are created from the access descriptor. You cannot change the variable names in the view descriptors.
SAS variable names are generated as follows:
  • If the column name is longer than eight characters, SAS uses only the first eight characters. If truncating results in duplicate names, numbers are appended to the ends of the names to prevent duplicate names.
  • If the column name in the PC file contains blank characters, SAS ignores it.
  • If the column name in the PC file starts with a digit (0 through 9), SAS adds the character Z before it.
  • If the column name contains characters that are invalid in SAS names (including national characters), SAS replaces the invalid characters with underscores (_).
When the SAS/ACCESS interface encounters the next CREATE statement to create an access descriptor, the ASSIGN statement is reset to the default NO value.