[Rd] foreign::read.ssd and long names (PR#9631)

jhallman at frb.gov jhallman at frb.gov
Mon Apr 23 20:23:15 CEST 2007


Full_Name: Jeff Hallman
Version: 2.4.1
OS: Linux
Submission from: (NULL) (132.200.32.34)


read.ssd() invokes PROC COPY to create an xport file, but PROC COPY has some
annoying limitations that read.ssd() should deal with.  The first is that PROC
COPY doesn't work with member names (the sectionnames argument to read.ssd)
longer than 8 characters.  The second is that PROC COPY also fails if any of the
columns in the dataset being copied are too long, unless you first set (in SAS)
"option validvarname = v6;".  

I'm including here a rewritten read.ssd() that deals with these two issues.  The
sectionnames 8-character limitation is dealt with by creating symbolic links
with shorter names.  The problem with long column names is handled by adding SAS
code to set "option validvarname = v6", which shortens column names that are too
long while still keeping them unique within the dataset.  A further enhancement
might be to use PROC CONTENTS to retrieve the full-length column names and then
assign them as the column names of the returned data.frames, but that seems to
be more effort than its worth.



More information about the R-devel mailing list