Export a SAS dataset to Stata with all variable names converted to lowercase

I use both SAS and Stata and often need to transfer data between the two. SAS is case-sensitive and Stata is not. I always prefer working with lowercase variable names in Stata. The following code is used to export a SAS dataset to Stata with all variables names converted to lowercase.

The macro I use is borrowed from Adrian’s work. Thanks Adrian.

A related post can be found here: http://kaichen.work/?p=1365.

 

This entry was posted in SAS. Bookmark the permalink.

1 Response to Export a SAS dataset to Stata with all variable names converted to lowercase

  1. Alex Luong says:

    Hi Kai,
    I would suggest using “rename *, lower” in Stata.
    Adrian is actually a friend of mine and he is also using this now.

Leave a Reply to Alex Luong Cancel reply

Your email address will not be published. Required fields are marked *