11-24-2015 02:06 PM
SAS\Access sqlsvr connecting to Unix MS SQL database containing views with column names exceeding 32 characters in length. My reading indicates that SAS can overcome the 32 characters restriction by specifying in the LIBNAME statement the PRESERVE_COL_NAMES option. I've tried =YES as well as =NO and each results in ERROR 65-58: Name '. . . XYZ . . .' is too long for a SAS name in this context. Any helpful tips to resolve is appreciated.
11-24-2015 02:17 PM
11-24-2015 02:18 PM
"This option applies only when you create a new table"
This issue have discussed multiple time on the communities - pls do a search.
In short, you probably need to use explicit SQL pass-thru, or having view created in the RDBMS which complies to SAS naming limits.
11-24-2015 02:24 PM - edited 11-24-2015 02:26 PM
You can't have SAS column names longer than 32 characters period.
The only way to reference a longer than 32 character column in SQL Server is by using SAQL PASSTHRU. SAS will truncate the column name to 32 chars when reading it into SAS.
proc sql; connect to sqlservr (connection string); create table test as select * from connection to sqlservr (select extremely_long_column_name_more_than_32_chars_long from tablename ); quit;