Adrian Dusa wrote:> Dear all,
>
> I am trying to import a SAS file into R (in fact I only need the value
labels
> from the formats file), using Hmisc package, but I get this error:
>
> my.sas <- sas.get("/home/adi/3", "fis1_sgg")
> sh: sas: not found
> Error in sas.get("/home/adi/3", "fis1_sgg") :
> SAS job failed with status 32512
>
> I read some past discussions and I get the impression that sas.get() needs
the
> full path to the SAS executable, but I don't have that because I am
using
> Linux.
>
> Is it possible to use sas.get() without having SAS installed?
Since sas.get is trying to execute sas the answer is a definite no
unless you use the sas.get option to run SAS on another machine to
produce the input ASCII files needed by sas.get. Also investigate
sasxport.get if you have SAS version 5 transport files to import.
See also http://biostat.mc.vanderbilt.edu/SASexportHowto
As SAS never got it right in allowing for full metadata to be included
in a SAS dataset, you often have to run PROC FORMAT CNTLOUT=... to
convert format libraries to SAS datasets so that programs such as
sasxport.get can assign value labels [if you have SAS installed, sas.get
runs PROC CONTENTS for you.]. SPSS and Stata have always been ahead of
SAS in this regard.
Note that the excellent Stat/Transfer commercial product will convert
from almost any SAS dataset format to compact R binary objects,
including variable labels the way the Hmisc package handles them. If
you have another way to convert from SAS to Stata or SPSS, R is great at
readying those formats.
Frank
>
> Or alternatively, is there another function to import the formats into R?
>
> Thanks in advance for any hint,
> Adrian
>
--
Frank E Harrell Jr Professor and Chair School of Medicine
Department of Biostatistics Vanderbilt University