BookmarkSubscribeRSS Feed
DebG
Obsidian | Level 7

I am trying to set the data types when reading a spreadsheet using the libname XLSX enging.

 

I am sucssful in reading the spreadsheet, however when I try to use the DBSASTYPE SAS throws and error.  I am using SAS EG 8.3.  The facility_id appears in excel to be a column of numbers.  I am able to read it and convert it.

 

My question is specific to using the dbSASTYPE functionality.  If I remove the dbSAStype, I can successfully read the file.

 

libname xl XLSX "/sasdata/airb_output01/dgear/cc_basel/my_file.xlsx" ;

data cc_basel1;
set xl.GUI(DBSASTYPE=(FACILITY_ID='char(20)'));
run;

 

Results in:

34 data cc_basel1;
35 set xl.GUI(DBSASTYPE=(FACILITY_ID='char(20)'));
_________
22
ERROR 22-7: Invalid option name DBSASTYPE.

 

Is there something that must be installed? 

 

2 REPLIES 2
Reeza
Super User
No, this option isn't enabled for the XLSX engine. As far as I know there's no way to specify the type 100% fool proof from an Excel file except by converting to CSV and reading that in.
Quentin
Super User

Unfortunately, as Reeza mentioned, the XLSX engine does not have support for the DBSASTYPE option.  

 

Please  upvote this ballot item, where I suggested this improvement:

https://communities.sas.com/t5/SASware-Ballot-Ideas/Add-DBSASTYPE-or-similar-option-to-XLSX-engine-t...

 

I did notice on LinkedIN a couple weeks ago that Henry Feldman is 'open to work' after departing ATT.  Perhaps SAS will be able to hire him back... I wouldn't think it would be hard to add support for DBSASTYPE.  

The Boston Area SAS Users Group (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info at https://www.basug.org/events.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

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.

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
  • 2 replies
  • 458 views
  • 0 likes
  • 3 in conversation