Part II Re: [R] read.ssd {foreign} (Reading a permanent SAS d ataset into an R data frame)

Pfaff, Bernhard
Fri, 20 Dec 2002 17:39:19 -0000

try:

library(foreign)
read.ssd("J:\\QM\\Reports\\Sarthur\\SAS_Application\\SAS_Data_Sets","use")

instead, hth, Merry Christmas, Bernhard

-----Original Message-----
From: Stephen Arthur [mailto:sarthur67 at yahoo.com]
Sent: 20 December 2002 16:55
To: ripley at stats.ox.ac.uk; rossini at blindglobe.net
Cc: r-help at stat.math.ethz.ch; stvjc at channing.harvard.edu
Subject: Part II Re: [R] read.ssd {foreign} (Reading a permanent SAS
dataset into an R data frame)


Hello,

I adopted the suggestion to use the R command

> foreign

before the

>
read.ssd("J:\\QM\\Reports\\Sarthur\\SAS_Application\\SAS_Data_Sets","use")

statement (notice, I am at work now, so the directory
structure changes).  Do I need any of the other
read.ssd parameters to get this statement to work,
because...

... I get the following error message in R:

"
SAS failed.  SAS program at
C:\TEMP\Rtmp12421\file21582.sas
a log and other error products should be in the
vicinity
NULL
Warning messages:
1: sas not found
2: SAS return code was -1 in:
read.ssd("J:\\QM\\Reports\\Sarthur\\SAS_Application\\SAS_Data_Sets",

>
"

Why am I getting the message "sas not found", when I
have SAS installed on my machine?

I checked the PROC COPY SAS program generated in the
indicated temporary file:

"
libname src2rd
'J:\QM\Reports\Sarthur\SAS_Application\SAS_Data_Sets';
libname rd xport 'C:\TEMP\Rtmp12421\file14817';
proc copy in=src2rd out=rd;
select use ;
"

SAS log

"
NOTE: SAS initialization used:
      real time           4.64 seconds
      cpu time            0.73 seconds
"

Can anyone help me get to the next step of this
process?  I believe I am close to getting R to read
SAS permanent data sets directly, which I would really
like to be able to do.

Thanks,

Stephen



--- ripley at stats.ox.ac.uk wrote:
> On Thu, 19 Dec 2002, Stephen Arthur wrote:
>
> > I just downloaded and installed R 1.6.1 on my
> Windows
> > machine where I also run SAS.
> >
> > I want to use the 'read.ssd' function so that I
> can
> > convert a permanent SAS data set into an R data
> frame.
> >

> > C:\Program
> > Files\R\rw1061\library\foreign\html\read.ssd.html
> >
> > When I run the first R command, in the example, on
> my
> > SAS library:
> >
> > > list.files("C:\\My Documents\\SAS_Data_Sets")
> >
> > I get the correct output.
> >
> > When I run the second R command, in the example,
> >
> > > read.ssd("C:\\My
> Documents\\SAS_Data_Sets","use")
> >

> 2) To use a package you need to use e.g.
>
> library(foreign)

______________________________________________
R-help at stat.math.ethz.ch mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help


----------------------------------------------------------------------
If you have received this e-mail in error or wish to read our e-mail
disclaimer statement and monitoring policy, please refer to
http://www.drkw.com/disc/email/ or contact the sender.
----------------------------------------------------------------------