BookmarkSubscribeRSS Feed
dmanteigas
Fluorite | Level 6

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

2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

The problem could be a number of things.  CAn you extract a bit of the imported dataset, into a datastep and post here:

This post:
https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...

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.

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

What is Bayesian Analysis?

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 769 views
  • 2 likes
  • 3 in conversation