Export dataset to SAS file (.sas7bdat)

Solved!
Pasavento
Level 1
Export dataset to SAS file (.sas7bdat)

Hello,

Does anyone know a way to export a DSS dataset to a SAS table file (.sas7bdat extension)?

There is a SAS plugin to import this kind of file into a pandas dataframe into DSS, but nothing in the opposite direction...

There is a Python library that is supposed to do that (saspy), but I am not authorised to install new Python packages in my DSS Python environment.

Here is the project: GitHub - sassoftware/saspy: A Python interface module to the SAS System. It works with Linux, Window... 

Has anyone tried it yet in DSS ?

Thanks in advance.


Operating system used: Windows 10

0 Kudos
1 Solution
Jurre
Level 5

Hi @Pasavento ,

Yes i tried it, and failed miserably. This sas-format is opaque, some have tried to deconstruct it with mixed and not very promising results. A possible workaround is using SPSS as that has a built-in exportfunctionality to sas7bdat-format.

It should be noted that Sas has functions to import CSV and XLS(x) files but i'm not fully aware of it's inner workings and requirements. 

Cheers, 

Jurre

 

View solution in original post

3 Replies
Jurre
Level 5

Hi @Pasavento ,

Yes i tried it, and failed miserably. This sas-format is opaque, some have tried to deconstruct it with mixed and not very promising results. A possible workaround is using SPSS as that has a built-in exportfunctionality to sas7bdat-format.

It should be noted that Sas has functions to import CSV and XLS(x) files but i'm not fully aware of it's inner workings and requirements. 

Cheers, 

Jurre

 

Pasavento
Level 1
Author

Thanks @Jurre 

Indeed, I think that the only solution is to import the dataset to SAS as a csv file.

The idea was to save one step without having to go through a proc import, and just upload the dataset directly as SAS .sas7bdat table.

0 Kudos
Jurre
Level 5

i think it's a big questionmark if that "saving one step" actually works out that way @Pasavento , possibly a lot of work needs to be done to get to this sas7bdat-format in the first place. I left that to SPSS, just exported from DSS and imported in SPSS, and immidiatly saved as sas7bdat.  When familiar with Sas i would always rather use native importing functionality over exotic conversion-tools , but that's just my 2 cents.