The ACCESS Procedure for PC Files |
Valid: | for DBF, DIF, WK1, WK3, WK4, Excel 4, Excel 5, and Excel 95 file formats under Windows operating environments |
Applies to: | access descriptor |
Interacts with: | FORMAT, RENAME, RESET, UNIQUE |
Not allowed with: | UPDATE |
Default: | NO |
Alias: | AN |
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 more 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.
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.