[R] Re: Importing a SAS file to R: Alas, STILL more problems--has anyone gotten this message before, and why

Vincent Carey 525-2265 stvjc at channing.harvard.edu
Mon Feb 9 17:37:57 CET 2004


i am the author of read.ssd, and did not accommodate sas for
windows in the creation of that function.  i do not know how
sas is called under windows, but it is possible that if you
learn how to invoke sas through the R "system" command, you
can supply the invocation command as the "sascmd" parameter
to read.ssd

other ways of transferring the information from SAS to R
include 1) using a put statement to write the data out record
by record into a whitespace delimited file, and then using
read.table in R to collect the data for use in R, 2) using
read.ssd on a unix system, saving the resulting R object,
and then transferring the R object back to windows.

---
Vince Carey

On Mon, 9 Feb 2004, Shoultz, Gerald wrote:

> Sorry to write twice in one day--I am a relative newbie to some of these
> parts of R, and I am pulling my hair out!  B/c I am preparing a file to
> use WINBUGS I am cross-posting to the BUGS group as well, in case anyone
> there has some ideas on this.
>
> I've got a large SAS dataset that I want to put in R form to more easily
> use the file with the hierarchical modeling software WINBUGS. It has
> numerous variables, so setting up "vertical text files" could be
> awkward. I did get the library foreign installed OK.  I am now trying to
> run read.ssd.  What I have below is similar to that found in the
> documentation for the foreign package, p.9:
>
> >  list.files("C:/Project_data/WINBUGSfiles")
> [1] "lastfile.sas7bdat"
> > dtabunch<-read.ssd("C:/Project_data/WINBUGSfiles","lastfile")
>
> I unfortunately got this:
>
> SAS failed.  SAS program at
> C:\DOCUME~1\bjz9\LOCALS~1\Temp\Rtmp23335\file29621.sas
> a log and other error products should be in the vicinity
> Warning messages:
> 1: sas not found
> 2: ls not found
> 3: SAS return code was -1 in: read.ssd("C:/Project_data/WINBUGSfiles",
> "lastfile")
>
> I have tried to find the log file but have been unable to do so.Can
> someone who has had this happen before kindly tell me what exactly (or
> possibly) is going on?  I went to the SAS Technical Support Document
> TS-140 to try to get help and really didn't get much out of that.  Does
> anyone know a better (as in "foolproof/will avoid meaningless error
> messages") way to get a SAS dataset into R-format?  Any help on this
> would be most appreciated.
>
> Thanks!
>
> Gerald Shoultz
>
>
>




More information about the R-help mailing list