The ASSIGN statement indicates whether SAS variable
names are automatically generated and whether users can change SAS
variable names and other column information the view descriptors created
from this access descriptor.
An editing statement,
such as ASSIGN, must be specified after the CREATE and database-description
statements when you create an access descriptor.
For more information,
see CREATE Statement.
The value
NO
(or
N
) enables you to modify
SAS variable names, formats, informats, database contents, occurrence
ranges, and BY keys when you create an access descriptor and when
you create view descriptors that are based on this access descriptor.
Specify a
YES
(or
Y
) value for this statement
to generate unique SAS variable names from the first eight characters
of the DBMS column names, according to the rules listed below. With
YES
, you can change the SAS variable names and other
column information only in the access descriptor. The SAS variable
names and other column information that are saved in an access descriptor
are
always used when view descriptors
are created from the access descriptor; you cannot change them in
the view descriptors.
Default SAS variable
names are generated according to these rules:
-
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. For example, the DBMS names
clientsname
and become the SAS names
clientsn
and
clients1
.
If the same descriptor
has another set of columns with duplicate names, the numeric suffix
begins at the next highest number from the previous set of duplicate
names. For example, if the descriptor has the duplicate names above
and also has the DBMS names
customername
,
customernumber
, and
customernode
, the default SAS names would be
customer
,
custome1
, and
custome2
.
-
If the column name contains characters
that are not valid in SAS names (including national characters), SAS
replaces these characters with underscores (_). For example, the
column name
func$
becomes the SAS variable
name
func_
.
If you specify
YES
for this statement, SAS automatically resolves any
duplicate variable names. However, if you specify
YES
, you cannot specify the CONTENT, FORMAT, INFORMAT, KEY, MVF (with
OCCURS option), RENAME, or RESET statements when you create view descriptors
that are based on the access descriptor.
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.
AN is the alias for
the ASSIGN statement.