read.ssd               package:foreign               R Documentation

_O_b_t_a_i_n _a _D_a_t_a _F_r_a_m_e _f_r_o_m _a _S_A_S _P_e_r_m_a_n_e_n_t _D_a_t_a_s_e_t, _v_i_a _r_e_a_d._x_p_o_r_t

_D_e_s_c_r_i_p_t_i_o_n:

     Generates a SAS program to convert the ssd contents to SAS
     transport format and then uses 'read.xport' to obtain a dataframe.

_U_s_a_g_e:

     read.ssd(libname, sectionnames, 
        tmpXport=tempfile(), tmpProgLoc=tempfile(), sascmd="sas")

_A_r_g_u_m_e_n_t_s:

 libname: character string defining the SAS library (usually a
          directory reference)

sectionnames: character vector giving member names. These are files in
          the 'libname' directory. They will usually have a '.ssd0x' or
          '.sas7bdat' extension, which should be omitted.

tmpXport: character  string: location where temporary xport format
          archive should reside - defaults to a randomly named file in
          the session temporary directory, which will be removed.

tmpProgLoc: character  string: location where temporary conversion SAS
          program should reside - defaults to a randomly named file in
          session temporary directory, which will be removed on
          successful operation.

  sascmd: character string giving full path to SAS executable.

_D_e_t_a_i_l_s:

     Creates a SAS program and runs it.

_V_a_l_u_e:

     A data frame if all goes well, or NULL with warnings and some
     enduring side effects (log file for auditing)

_N_o_t_e:

     error handling is primitive

_A_u_t_h_o_r(_s):

     For Unix: VJ Carey <stvjc@channing.harvard.edu>

_S_e_e _A_l_s_o:

     'read.xport'

_E_x_a_m_p_l_e_s:

     ## if there were some files on the web we could get a real
     ## runnable example
     ## Not run: 
     R> list.files("trialdata")
      [1] "baseline.sas7bdat" "form11.sas7bdat"   "form12.sas7bdat"  
      [4] "form13.sas7bdat"   "form22.sas7bdat"   "form23.sas7bdat"  
      [7] "form3.sas7bdat"    "form4.sas7bdat"    "form48.sas7bdat"  
     [10] "form50.sas7bdat"   "form51.sas7bdat"   "form71.sas7bdat"  
     [13] "form72.sas7bdat"   "form8.sas7bdat"    "form9.sas7bdat"   
     [16] "form90.sas7bdat"   "form91.sas7bdat"  
     R> baseline<-read.ssd("trialdata","baseline")
     R> form90<-read.ssd("trialdata","form90")

     ## Or for a Windows example
     sashome <- "/Program Files/SAS/SAS 9.1"
     read.ssd(file.path(sashome, "core", "sashelp"), "retail",
              sascmd = file.path(sashome, "sas.exe"))
     ## End(Not run)

