DBGEN_NAME= Data Set Option

Specifies how SAS renames columns automatically when they contain characters that SAS does not allow.
Valid in: DATA and PROC steps
Default: DBMS
Supports: All

Syntax

DBGEN_NAME=DBMS | SAS

Syntax Description

DBMS
specifies that disallowed characters are converted to underscores.
SAS
specifies that DBMS columns that contain disallowed characters are converted into valid SAS column names, using the format _COLn, where n is the column number (starting with zero). If a name is converted to a name that already exists, a sequence number is appended to the end of the new name.

Details

SAS retains column names when reading data from DBMS tables, unless a column name contains characters that SAS does not allow, such as $ or @. SAS allows alphanumeric characters and the underscore (_).
This option is intended primarily for National Language Support, notably the conversion of kanji to English characters because the English characters converted from kanji are often those that are not allowed in SAS.
Note: The various interfaces handle name collisions differently in SAS Version 6. Some interfaces appended to the end of the name; other interfaces replaced the last characters in the name. Some interfaces used a single sequence number, other interfaces used unique counters. If you specify VALIDVARNAME=V6, name collisions are handled the same as they were in SAS Version 6.

Example:

If you specify DBGEN_NAME=SAS, a DBMS column named DEPT$AMT is renamed to _COLn where n is the column number.
If you specify DBGEN_NAME=DBMS,a DBMS column named DEPT$AMT is renamed to DEPT_AMT.