Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Re: statalist-digest V4 #3858

From   Dan Blanchette <>
To   "" <>
Subject   st: Re: statalist-digest V4 #3858
Date   Fri, 23 Jul 2010 10:54:14 -0400 (EDT)

BTW, -usesas- requires that you also have SAS installed on the same
computer because it invokes SAS to load a SAS dataset into Stata.

-usesas- can run a SAS program to load the last dataset created by
the SAS program.  So you can download the SAS dataset and create a
SAS program like so:


 libname in "C:\data";

 proc format;
   ...copy and paste all the formats code here...

 data work.naaccr_cina_2002_2006_sas_data;
  set in.naaccr_cina_2002_2006_sas_data;

  format reg regf.
         race racef.
         site sitef.
         sex sexf.
         age agef.
         pedsite pedsitef.
         combined combinef.
         nhiacomb nhiacf.
         adltincd pedincd yn.


and save it to:
and invoke -usesas- like so:

  usesas using "C:\data\"

My Stata command -saswrapper- is designed specifically to run SAS code from within Stata and could also run your SAS program like so:

  saswrapper using "C:\data\", nodata usesas

The "nodata" option means "do not transfer the dataset currently in Stata to SAS". -saswrapper- does that by default assuming you want to run some SAS code on the Stata dataset in memory. The -usesas- option loads the last dataset created in the SAS program back to Stata.

Dan Blanchette
Research Associate
Center for Entrepreneurship and Innovation
Duke University's Fuqua School of Business

Date: Thu, 22 Jul 2010 08:51:56 -0400
From: Marcello Pagano <>
Subject: Re: st: CINA

Thanks, Steve, we'll try them.


On 7/22/2010 8:14 AM, Steven Samuels wrote:
StatTransfer or Don Blanchette's -usesas- should convert the SAS data
To convert the VALUE statments, PERL code at
might help. I've not used the last two.


On Jul 22, 2010, at 6:29 AM, Marcello Pagano wrote:

Dear Listers,

Has anyone translated (parts) of this into Stata?

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index