sas7bdat_to_csv command

Issue #25 new
Former user created an issue

Hi,

I just installed the package and am having trouble using sas7bdat_to_csv. Sorry if it's a silly question but I know little to nothing about programming in Python and this is the only way I've found to convert large sas files without stat/transfer or SAS.

I can read and print rows of a SAS file using SAS7BDAT() but when I try to use sas7bdat_to_csv as described here https://pyhacker.com/pages/sas7bdat.html I just get an invalid syntax response. I've tried writing the whole file path so not to make any directory mistakes as well as using the object I made with SAS7BDAT().

I also went through the source code and couldn't find the expression "sas7bdat_to_csv" any where, is this no longer a feature?

Thanks, Mike

Comments (2)

  1. Marcus Burke

    I don't know if you ever got this solved, but I was similarly puzzled and found the solution. This is for a Windows environment, although it may work elsewhere (untested). Here it is for posterity:

    To run the conversion script, you need the full path of everything for the command line. So, for example, if you are using Python 2+, you will need to find the sas7bdat_to_csv script in the Python install folder (e.g. C:\Python27\Scripts) and the full path to the sas7dbat file you are trying to convert.

    X\:> python C:\Python27\Scripts\sas7dbat_to_csv "FULL PATH TO sas7bdat FILE.sas7bdat"
    

    For Python 3+, it would be similar, although the path to the script will need to correspond to the installation location.

  2. Log in to comment