Hi there,
I'm having a problem in using PROC IMPORT to import excel files into SAS. I'm using the following code:
PROC IMPORT DATAFILE="FILE.xlsx" DBMS=xlsx replace OUT=FILE; RUN;
It appears to be everything ok with the dataset. However, when I try to referece string variables (for instance, "IF VAR='STRINGVALUE') I never get anything as a result. I used trim, strip and compress to check if there was any problem with blanks and it didn't work. I imported the dataset as CSV and it worked right. Proc Contents doesn't show anything unusual with dataset attributes. Does anyone knows what the problem may be?
Regards,
David
Could you show as the offending data step code and the output of proc contents for the imported dataset WORK.FILE?
The problem could be a number of things. CAn you extract a bit of the imported dataset, into a datastep and post here:
Shows how to do it.
And then show us the logic you are trying to apply to it.
Do note that using CSV would always be my preferred solution - fix your datastep import program based on the specifications document agreed with the vendor. This minimises issues. Excel is not a good data medium.
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 the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.