Write and run SAS programs in your web browser

MIXED and SCANTIME

Accepted Solution Solved
Reply
Contributor
Posts: 28
Accepted Solution

MIXED and SCANTIME

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


Accepted Solutions
Solution
‎12-02-2016 03:58 PM
Grand Advisor
Posts: 16,348

Re: MIXED and SCANTIME

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


All Replies
Solution
‎12-02-2016 03:58 PM
Grand Advisor
Posts: 16,348

Re: MIXED and SCANTIME

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. 

Post a Question
Discussion Stats
  • 1 reply
  • 165 views
  • 0 likes
  • 2 in conversation