I have a column in excel that exceeds 255. When I read the data in and use dbsastype to force the column char and length, it still gives me 255. Any ideas of what I'm doing wrong.
Here is some of the code:
LIBNAME WrkBk EXCEL "file" MIXED=YES;
DATA test.;
SET WrkBk."sh1"n(
DBSASTYPE=("f1"='char(450)'));
RUN;
LIBNAME WrkBk CLEAR;
Have you tried it with dbms=xlsx. Unfortunately, it doesn't allow mixed and dbsastype, but often does what one wants. e.g.:
LIBNAME WrkBk xlsx "/folders/myfolders/book1.xlsx"; DATA test; SET WrkBk.sheet1; RUN; LIBNAME WrkBk CLEAR;
Art, CEO, AnalystFinder.com
Take control. Save the data to a csv file and read that with a data step. The Excel file format is unusable as a reliable transport.
Try another option.
LIBNAME WrkBk EXCEL "file" MIXED=YES dbmax_text=32767 ;
DATA test;
SET WrkBk."sh1"n;
run;
Unfortunately that didn't work either
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.