Skip to content

robertgambrel/sas_to_stata_import

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Convert SAS import scripts to STATA import scripts

We had a series of datasets in ASCII format, but the provided import programs were SAS only. Unfortunately, the data was all on Mac-encrypted drives, so we couldn't transfer them to a Windows computer with SAS. This script read through the SAS import script, pulled variable names and formats, and rewrote everything to a new Stata-syntaxed file.

It's likely that some of the choices made here will have to be changed for different data sources, but hopefully this helps get you started.

The import files came from the Healthcare Cost and Utilization Project and looked like this. My script was tailored to that format specifically, so it uses their coding patterns to consistently translate SAS import commands to Stata, taking into account the fact that variables not only have line indexes but also survey-defined missing value codings and formats. All of these are converted to Stata code and written to a do file.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages