Hello all,
Truncating the column name by keeping the first 32 characters normally works in PROC SQL. Just omit the remaining characters past the first 32 and SAS will recognize the full name of the column. That is my approach when using PROC SQL, but the same should be true for data steps.
It was communicated at the Global Forum that this will finally be fixed in version 9.5.
Yes indeed. The 9.5 release of SAS is currently slated to contain long name support (i.e., up to 255 characters) for member names of type DATA, VIEW, and ITEMSTOR, as well as variable names for DATA, VIEW, and PROGRAM.
Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF
View now: on-demand content for SAS users
Work around is by using sql pass through:
proc sql;
connect to <engine> (dsn=xxxx user=xxx pw=xx);
create table longtabletest as
select * from connection to <engine>
(select * from <table name with more than 32 character>
where <filter condition if any>);
disconnect from <engine>;
quit;
Using your explicit passthrough workaround, what results do you get in SAS when your RDBMS table is something like:
CREATE TABLE FOO (
THIS_IS_A_LONG_COLUMN_NAME_THAT_IS_MORE_THAN_32_CHARS VARCHAR(50),
THIS_IS_A_LONG_COLUMN_NAME_THAT_IS_MORE_THAN_32_CHARS2 VARCHAR(50),
THIS_IS_A_LONG_COLUMN_NAME_THAT_IS_MORE_THAN_32_CHARS3 VARCHAR(50)
)
Are all columns imported successfully?
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.