BookmarkSubscribeRSS Feed
qwerty12
Fluorite | Level 6

Can we append Excel(.xlsx) file into .sas7bdat

2 REPLIES 2
Patrick
Opal | Level 21

@qwerty12 wrote:

Can we append Excel(.xlsb) file into .sas7bdat


These are two totally different file formats from different vendors - so no, certainly not directly without conversion from the one to the other format.

If you can read your .xlsb data into a SAS table (.sas7bdat) then you can append this SAS table to an already existing SAS table IF they share the same columns.

Reading an Excel sheet directly into SAS also always has the issue that you can't fully control the resulting output table - column type and attributes. If you want to implement something repeatable then additional measure are required - and there have already been many Q&A in this forum around this topic. 

 

Ideally use a .xlsx file and not .xlsb
https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-xlsb-SAS-EG-7-1-64-bits/td-p/351501 

https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/acpcref/n0msy4hy1so0ren1acm90iijxn8j.htm 

 

ErikLund_Jensen
Rhodochrosite | Level 12

Hi @qwerty12 

 

You can do that with xlsx files, because the SAS XLSX engine lets you see an xlsx file as a library with the induvidual sheets as members. I don't think it works with xlsb-files. 

 

But - as explained by @Patrick - it is two very different file systems, and you might run into all sorts of trouble with both variable names and sheet names depending on your validname settings and interpretation of variable content, so I don't think is is a good idea. It is better to get your data into SAS, so you can verify results, rename variables, apply formats etc, before you try to append the contents to an existing data set.

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
  • 557 views
  • 2 likes
  • 3 in conversation