[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: SAS/Stata data conversion programs are update on SSC

From   Dan Blanchette <>
Subject   st: SAS/Stata data conversion programs are update on SSC
Date   Tue, 8 Apr 2008 11:05:30 -0400 (EDT)

I've made some really good improvements to my data conversions programs.
If you have them already installed, it would be good to update them.
If you are using Stata 10, then you really should update these programs.

My programs require that you have both SAS and Stata installed on the
same computer since they run SAS and Stata to do the conversion.

These are my programs that have been updated:

 SAVASTATA SAS macro which saves a SAS dataset as a Stata dataset

 -usesas- which lets you just load a SAS dataset into Stata

 -savasas- which lets you save a Stata dataset as a SAS dataset

 CHAR2FMT SAS macro which converts long SAS character variables
  to user-defined formats like Stata's -encode- command does.
  CHAR2FMT is used by -usesas- and

 savas UNIX/Linux C-shell script which runs either SAVASTATA or
  -savasas- to make a SAS or Stata copy of your dataset.

Thanks to Kit Baum, these updated programs are available on the SSC

To update your installation all you'll need to do is:

ssc install usesas , replace

ssc install savasas , replace

For all you -usesas- users who have had to use the "quotes" option
to read in your SAS data, this updated version makes it so that you
are pretty much never going to have to use that option again.

I also added the option "describe" to -usesas- which allows you to
use -usesas- like -describe using- where you can see the variable
names and information about your dataset without actually loading
it into Stata.  This can be helpful in situations where your SAS
dataset is too big to load into Stata.  The -usesas- help page
goes into a lot of detail explaining this new option.

If you are mainly a SAS user and have ever wanted to use Stata just for
a quick analysis of data, check out my new STATA_WRAPPER SAS macro which
lets you run Stata code on your most recently created SAS dataset and
have the contents of the Stata results window printed to your SAS output
window.  On this webpage is an example of how to use STATA_WRAPPER to
basically be USESTATA (create a SAS work dataset out of a Stata dataset):
STATA_WRAPPER is now installed when you install or update -usesas- since
it requires that -usesas- be installed to run.

I hardly ever get e-mails about problems with these programs, so please
let me know if you have any questions.


Dan Blanchette

Research Computing
University of North Carolina Chapel Hill

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index