[R] Reading SAS data into R

Shubha Vishwanath Karanth shubhak at ambaresearch.com
Thu May 15 15:39:16 CEST 2008


After running the codes in the log file, I realized that this has something to do with SAS only...

Shubha Karanth | Amba Research
Ph +91 80 3980 8031 | Mob +91 94 4886 4510 
Bangalore * Colombo * London * New York * San José * Singapore * www.ambaresearch.com

-----Original Message-----
From: Shubha Vishwanath Karanth 
Sent: Thursday, May 15, 2008 7:03 PM
To: Peter Dalgaard
Cc: r-help at stat.math.ethz.ch
Subject: RE: [R] Reading SAS data into R

Hi Peter,

Realized that the log files are generated only when there is an error. Here are my contents of the log file:

libname src2rd 'Z:/data';
libname rd xport 'C:\DOCUME~1\SHUBHA~1.AMB\LOCALS~1\Temp\1\RtmpObHuqk\file323b4e45';
proc copy in=src2rd out=rd;
select tsubset10 ;


Shubha Karanth | Amba Research
Ph +91 80 3980 8031 | Mob +91 94 4886 4510 
Bangalore * Colombo * London * New York * San José * Singapore * www.ambaresearch.com

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Shubha Vishwanath Karanth
Sent: Thursday, May 15, 2008 6:35 PM
To: Peter Dalgaard
Cc: r-help at stat.math.ethz.ch
Subject: Re: [R] Reading SAS data into R

Seems that it gets deleted.... But lemme try again by providing the arguments...

Shubha Karanth | Amba Research
Ph +91 80 3980 8031 | Mob +91 94 4886 4510 
Bangalore * Colombo * London * New York * San José * Singapore * www.ambaresearch.com

-----Original Message-----
From: Peter Dalgaard [mailto:P.Dalgaard at biostat.ku.dk] 
Sent: Thursday, May 15, 2008 6:30 PM
To: Shubha Vishwanath Karanth
Cc: r-help at stat.math.ethz.ch
Subject: Re: [R] Reading SAS data into R

Shubha Vishwanath Karanth wrote:
> 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
>>     
> 9.1/sas.exe")
>
>   
>> 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:
>
>  
>
> *       s=read.ssd("Z:/data","tsubset10",sascmd = "C:/Program
> Files/SAS/SAS 9.1/sas.exe")
>
>  
>
> SAS failed.  SAS program at
> C:\DOCUME~1\SHUBHA~1.AMB\LOCALS~1\Temp\1\RtmpObHuqk\file6df11649.sas 
>
> 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?
>
>  
What is in the SAS log file?

-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)              FAX: (+45) 35327907


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

______________________________________________
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.
This e-mail may contain confidential and/or privileged i...{{dropped:10}}



More information about the R-help mailing list