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
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.
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.