BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
seltonsy
Quartz | Level 8

Hi there

 

I'm trying to import xlsx file using sas studio (see program below), but the mixed, scantext, scantime etc do not work. it used to work flawlessly in sas enterprise and 9.4.

 

now all my variables are messed up, numeric changed to characters. is there a way to work this instead of changing the format of each variable. 

 

 

FILENAME REFFILE '/folders/myfolders/sasuser.v94/1234.xlsx';

PROC IMPORT DATAFILE=REFFILE
DBMS=XLSX
OUT=WORK.projet;
GETNAMES=YES;
mixed=yes;
scantext=yes;
scantime=yes;
RUN;

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

I'm assuming you weren't using DBMS=XLSX when you used this code 'flawlessly'?

 

They are different engines.  I'm assuming you're using SAS UE?

 

My guess would be to try the LIBNAME

 

libname dataIn xlsx 'path to file';

You could try other engines in your import, but may be stuck converting it to CSV anyways. If you haven't already, you'll soon hear that you shouldn't use Excel because it doesn't have defined types. Expecting a system to correctly guess all the types is a big assumption and task, and many workarounds involve converting the file to CSV and then manually specifying your data types and formats. 

View solution in original post

1 REPLY 1
Reeza
Super User

I'm assuming you weren't using DBMS=XLSX when you used this code 'flawlessly'?

 

They are different engines.  I'm assuming you're using SAS UE?

 

My guess would be to try the LIBNAME

 

libname dataIn xlsx 'path to file';

You could try other engines in your import, but may be stuck converting it to CSV anyways. If you haven't already, you'll soon hear that you shouldn't use Excel because it doesn't have defined types. Expecting a system to correctly guess all the types is a big assumption and task, and many workarounds involve converting the file to CSV and then manually specifying your data types and formats. 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 1 reply
  • 2001 views
  • 0 likes
  • 2 in conversation