[R] Reading SAS data into R

From: Shubha Vishwanath Karanth <shubhak_at_ambaresearch.com>
Date: Thu, 15 May 2008 16:01:03 +0530

Hi R,  

Suppose that SAS dataset 'tsubset1' is stored in the path, "Z:/data". Then I give the below read.ssd() command to read SAS dataset, 'tsubset1.sas7bat' into R.  

> library(foreign)

> s=read.ssd("Z:/data","tsubset1",sascmd = "C:/Program Files/SAS/SAS

> s

  A B C

1 3 4 5

2 6 7 8

3 3 4 5  

It reads perfect! It reads well for "tsubset1","tsubset2",....., "tsubset9" datasets. But then onwards it gives an error as below:  

SAS failed. SAS program at

The log file will be file6df11649.log in the current directory

Warning message:

In read.ssd("Z:/data", "tsubset1011", sascmd = "C:/Program Files/SAS/SAS 9.1/sas.exe") :

  SAS return code was 2  

Why is this? Are two numerical digits in a filename of a SAS dataset cannot be read by R? The error prevails for "tsubset201", "tsubset35462" etc.... Can somebody point out to me where actually the error is?  

Many Thanks,


This e-mail may contain confidential and/or privileged i...{{dropped:13}}

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 15 May 2008 - 10:36:22 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 15 May 2008 - 18:30:38 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive