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?
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.
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.