[R] SAS and RODBC

Uwe Ligges ligges at statistik.tu-dortmund.de
Sun Feb 14 16:08:48 CET 2010



On 14.02.2010 08:19, Daniel Nordlund wrote:
>> -----Original Message-----
>> From: Frank E Harrell Jr [mailto:f.harrell at vanderbilt.edu]
>> Sent: Saturday, February 13, 2010 5:49 AM
>> To: Daniel Nordlund
>> Cc: r-help at r-project.org
>> Subject: Re: [R] SAS and RODBC
>>
>> Daniel Nordlund wrote:
>> . . .
>>
>>>
>>> This is just a quick follow-up to my previous post.  Based on Prof.
>> Ripley's response I went back and looked at the SAS log file and reread
>> the RODBC help pages.  The problem of writing a SAS dataset was solved by
>> setting colQuote=NULL in the call to the odbcConnect() function.
>>>
>>> ch<- odbcConnect('sasodbc', believeNRows=FALSE, colQuote=NULL)
>>>
>>> I hope this will be useful to others who may have the SAS BASE product
>> and want to do graphics or statistical analyses with their SAS data, but
>> can't afford the high licensing fees for the SAS STAT and GRAPH modules.
>> Thanks to Prof. Ripley for the fine RODBC package.
>>>
>>> Dan
>>>
>>> Daniel Nordlund
>>> Bothell, WA USA
>>>
>>>
>>
>> Daniel since you have SAS BASE installed why not use sas.get in the
>> Hmisc package and also get access to metadata such as variable labels
>> that ODBC does not handle?  Besides providing better documentation, the
>> labels are very useful as axis labels in plotting, etc.
>>
>> Frank
>>
>
> Frank,
>
> I have used sas.get from Hmisc before, and I will continue to use it. I appreciate the work that you and your colleagues have done with Hmisc and the Design and rms packages.  However, the sas.get function still appears to be broken on Windows platforms (or Windows is broken :-).  I know how to fix the problem, but I am always looking for approaches where I don't have to fix things.   It may well be that the better documentation provided by sas.get will prove to out weigh the inconvenience of having to source an edited version of sas.get for my regular use.

Daniel,

if the function is broken and needs to be fixed, why don't you report 
your findings (both the error with reproducible code) as well as your 
bugfixes to the package maintainer?

Best wishes,
Uwe



> As for moving data from R to SAS, I don't know of any methods other than the RODBC package with the SAS ODBC driver for writing SAS datasets.  Yes, I can write to csv or other file types that SAS can import, but if I can eliminate extra steps when going from R to SAS then that is a plus for me.
>
> Thanks again for the great tools,
>
> Dan
>
> Daniel Nordlund
> Bothell, WA USA
>
> ______________________________________________
> 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.



More information about the R-help mailing list