Can we append Excel(.xlsx) file into .sas7bdat
@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
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.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.