[R] sas.get problem : the saga continues.

John Kane jrkrideau at yahoo.ca
Fri Apr 13 22:37:07 CEST 2007


#Continuing my sas.get saga.  Hmisc has been been
updated however I am still
getting the same problem. I seem to have aa SAS
problem  as well as
 an R problem.  There seems to be something dodgy in
the SAS data or
format files since SAS will not read the file unless I
use
 LIBNAME library = 'F:\testsas'
 Something like
 LIBNAME dd1 = 'F:\testsas'
 will not work and it should whereas Libname
dd1="C:\Temp\testsas"  does.
 
However I still cannot get sas.get to read a simple
file which does work with
LIBNAME dd1 = 'F:\testsas' .  Can anyone see if I am
misreading the Help or
making some kind of stupid typing mistake? I also have
tried running it on the
C drive with no luck. Thanks

Windows XP, R 2.4.1

 ###### EXAMPLE  #########
 #### SAS PROGRAM for simple file.  ###
libname  LIBRARY 'F:\testsas';
proc format library= LIBRARY;
value catfmt 1 = "Siam"
             2 = "Persian"
             3 = "Cougar";
value dogfmt 1 = "Lab"
             2 = "Collie"
             3 = "Coyote";
run;
data library.animals;
   input cat dog;
   datalines;
1 3
2 2
3 1
;

Data LIBRARY.doms;
 set LIBRARY.Animals ;
 format cat catfmt. dog  dogfmt.;
 proc freq;
 run;
 
#####
#   Apply sas.get

library(Hmisc)
mydata <- sas.get(library="F:/testsas", mem="doms",
             format.library="F:/testsas",
  sasprog = '"C:/Program Files/SAS/SAS 9.1/sas.exe"')

RESULTS

> library(Hmisc)
> mydata <- sas.get(library="C:/Temp/testsas",
mem="doms",
+              format.library="C:/Temp/testsas",
+   sasprog = '"C:/Program Files/SAS/SAS
9.1/sas.exe"')
The filename, directory name, or volume label syntax
is incorrect.
Error in sas.get(library = "C:/Temp/testsas", mem =
"doms", format.library = "C:/Temp/testsas",  :
        SAS job failed with status 1
In addition: Warning message:
'cmd' execution failed with error code 1 in:
shell(cmd, wait = TRUE, intern = output)



More information about the R-help mailing list