[R] Problems importing Unix SAS .ssd04 file to R (Win)

johannes rara johannesraja at gmail.com
Tue Oct 20 09:26:24 CEST 2009


Hello,

I'm trying to import a SAS file made using SAS on Unix. Currently I'm
using SAS on Windows and I'm trying to import that .ssd04 file to R.
The file name of the file is testfile.ssd04 and it is located in
'M:\sasuser'. I'm using Windows XP and R 2.91. Basically what I'm
doing is

############ r code ##############
> library(foreign)
> sashome <- "C:/Program Files/SAS Institute/SAS/V8"
> folder_for_datafiles <- "M:/sasuser"
> read.ssd(folder_for_datafiles, "testfile", sascmd=file.path(sashome, "sas.exe"))

SAS failed.  SAS program at
C:\DOCUME~1\jrara\LOCALS~1\Temp\RtmpAAxO3X\file41bb5af1.sas
The log file will be file41bb5af1.log in the current directory
NULL
Warning message:
In read.ssd(folder_for_datafiles, "testfile", sascmd = file.path(sashome,  :
  SAS return code was 2
>
##################################

This temporary SAS file 'file41bb5af1.sas' looks like this

############ sas code #############
option validvarname = v6;libname src2rd 'M:/sasuser';
libname rd xport 'C:\DOCUME~1\jrara\LOCALS~1\Temp\RtmpAAxO3X\file6df11649';
proc copy in=src2rd out=rd;
select testfile ;
##################################

Any ideas what I'm doing wrong?


> sessionInfo()
R version 2.9.1 (2009-06-26)
i386-pc-mingw32

locale:
LC_COLLATE=Finnish_Finland.1252;LC_CTYPE=Finnish_Finland.1252;LC_MONETARY=Finnish_Finland.1252;LC_NUMERIC=C;LC_TIME=Finnish_Finland.1252

attached base packages:
[1] graphics  grDevices utils     datasets  grid      stats
methods   base

other attached packages:
[1] foreign_0.8-38 gregmisc_2.1.1 gplots_2.7.1   caTools_1.9
bitops_1.0-4.1 gtools_2.6.1   gmodels_2.15.0 gdata_2.6.1

loaded via a namespace (and not attached):
[1] MASS_7.2-49
>




More information about the R-help mailing list