Skip to content

read.ssd {foreign} (Reading a permanent SAS dataset into an R data frame)

3 messages · Stephen Arthur, Brian Ripley

#
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.

I downloaded and installed the package 'foreign' on my
machine, which includes the 'read.ssd' function.

I read the instructions, and followed the example
closely in the R documentation.

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:
I get the correct output.

When I run the second R command, in the example,
I get the following message,

'Error: couldn't find function "read.ssd"'

Why is R saying it can not find the function
'read.ssd' when I downloaded it and I see it in my
file system?

Thanks for your help,

Stephen
#
On Thu, 19 Dec 2002, Stephen Arthur wrote:

            
1) Foreign shipped with R 1.6.1 for Windows, so you did not need to
download it.

2) To use a package you need to use e.g.

library(foreign)

When you have time, please do read `An Introduction to R'.
#
Hello,

I adopted the suggestion to use the R command
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: