I am trying to import a permanent SAS data set using read.ssd in the foreign library. I get the following error: > list.files("C:/temp") [1] "newdat1.sas7bdat" "snpm1.sas7bdat" "test1.sas" > library(foreign) > newdat1 <- read.ssd("C:/temp","newdat1") SAS failed. SAS program at C:\DOCUME~1\paul\LOCALS~1\Temp\Rtmp21143\file30218.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:/temp", "newdat1") I can export the SAS data as a tab delimited file and then read it into R with read.delim, but I have many SAS files I need to look at. Does anyone have experience with this? Thanks Paul Green
Paul - I think you have to have an executable copy of SAS on the same machine as R in order for this to work. I've never used it, but I remember a very similar question on the list from just a few months ago. Maybe there's some description of this in the foreign package manual, or in the help pages. - tom blackwell - u michigna medical school - ann arbor - On Wed, 29 Oct 2003, Paul Green wrote:> I am trying to import a permanent SAS data > set using read.ssd in the foreign library. I get > the following error: > > > list.files("C:/temp") > [1] "newdat1.sas7bdat" "snpm1.sas7bdat" "test1.sas" > > library(foreign) > > newdat1 <- read.ssd("C:/temp","newdat1") > SAS failed. SAS program at > C:\DOCUME~1\paul\LOCALS~1\Temp\Rtmp21143\file30218.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:/temp", "newdat1") > > I can export the SAS data as a tab delimited file and then read > it into R with read.delim, but I have many SAS files I need to > look at. Does anyone have experience with this? > > Thanks > > Paul Green > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help >
There is a utility called dataload at: http://www.vsn-intl.com/genstat/downloads/datald.htm that says it can convert SAS files (and numerous other formats) to csv and other formats. I have successfully used it to convert Excel xls files to csv although I don't have experience with its SAS capability. --- From: Paul Green <pgreen at umich.edu> [ Add to Address Book | Block Address | Report as Spam ] To: <r-help at stat.math.ethz.ch> Subject: [R] importing SAS data I am trying to import a permanent SAS data set using read.ssd in the foreign library. I get the following error:> list.files("C:/temp")[1] "newdat1.sas7bdat" "snpm1.sas7bdat" "test1.sas"> library(foreign) > newdat1 <- read.ssd("C:/temp","newdat1")SAS failed. SAS program at C:\DOCUME~1\paul\LOCALS~1\Temp\Rtmp21143\file30218.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:/temp", "newdat1") I can export the SAS data as a tab delimited file and then read it into R with read.delim, but I have many SAS files I need to look at. Does anyone have experience with this? Thanks Paul Green _______________________________________________ No banners. No pop-ups. No kidding. Introducing My Way - http://www.myway.com