Part II Re: [R] read.ssd {foreign} (Reading a permanent SAS dataset into an R data frame)
Stephen Arthur
sarthur67 at yahoo.com
Fri Dec 20 17:26:03 CET 2002
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)
More information about the R-help
mailing list