R 2.15.1 OS 10.7 Colleagues I have been an enthusiastic user of the sas7bdat package in R. However, several recent sas7bdat files sent to me from different sources cannot be read by the package. The error message is: Error in read.sas7bdat(FILENAME) : unknown host W32_7PRO please report bugs to sas7bdatRbugs at gmail.com I examined the file with a text editor and it contains 9.0301M1W32_7PRO in the second line. An older file that works successfully with the package contains 9.0101M3XP_PRO in the same position. Is this causing the failure? Is this something easy to fix? For the moment, I am using StatTransfer to convert the files. StatTransfer has no problem with the newer files suggesting that the problem might be trivial. I have contacted the package maintainer (matt.shotwell at vanderbilt.edu) twice without a response. Dennis Dennis Fisher MD P < (The "P Less Than" Company) Phone: 1-866-PLessThan (1-866-753-7784) Fax: 1-866-PLessThan (1-866-753-7784) www.PLessThan.com
I can't help troubleshoot the read.sas7bdat function, but if you have the fixed-width data and a SAS importation script, the SAScii package might help you work around this issue. :) On Thu, Oct 4, 2012 at 11:55 AM, Fisher Dennis <fisher@plessthan.com> wrote:> R 2.15.1 > OS 10.7 > > Colleagues > > I have been an enthusiastic user of the sas7bdat package in R. However, > several recent sas7bdat files sent to me from different sources cannot be > read by the package. The error message is: > Error in read.sas7bdat(FILENAME) : > unknown host W32_7PRO please report bugs to sas7bdatRbugs@gmail.com > > I examined the file with a text editor and it contains > 9.0301M1W32_7PRO > in the second line. An older file that works successfully with the > package contains > 9.0101M3XP_PRO > in the same position. > > Is this causing the failure? Is this something easy to fix? For the > moment, I am using StatTransfer to convert the files. StatTransfer has no > problem with the newer files suggesting that the problem might be trivial. > > I have contacted the package maintainer (matt.shotwell@vanderbilt.edu) > twice without a response. > > Dennis > > Dennis Fisher MD > P < (The "P Less Than" Company) > Phone: 1-866-PLessThan (1-866-753-7784) > Fax: 1-866-PLessThan (1-866-753-7784) > www.PLessThan.com > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
On Thu, Oct 4, 2012 at 4:55 PM, Fisher Dennis <fisher at plessthan.com> wrote:> R 2.15.1 > OS 10.7 > > Colleagues > > I have been an enthusiastic user of the sas7bdat package in R. However, several recent sas7bdat files sent to me from different sources cannot be read by the package. The error message is: > Error in read.sas7bdat(FILENAME) : > unknown host W32_7PRO please report bugs to sas7bdatRbugs at gmail.com > > I examined the file with a text editor and it contains > 9.0301M1W32_7PRO > in the second line. An older file that works successfully with the package contains > 9.0101M3XP_PRO > in the same position. > > Is this causing the failure? Is this something easy to fix? For the moment, I am using StatTransfer to convert the files. StatTransfer has no problem with the newer files suggesting that the problem might be trivial.Just having a look at the source code for Matt's sas7bdat package, there's a special bug report email:> sas7bdat:::BUGREPORT[1] "please report bugs to sas7bdatRbugs at gmail.com" Further, if you read the vignette("sas7bdat") you'll see a lot of technical stuff that has been reverse engineered about the sas format. The source code contains this chunk: # Host systems known to work KNOWNHOST <- c("WIN_PRO", "WIN_NT", "WIN_NTSV", "WIN_SRV", "WIN_ASRV", "XP_PRO", "XP_HOME", "NET_ASRV", "NET_DSRV", "NET_SRV", "WIN_98", "W32_VSPR", "WIN", "WIN_95", "X64_VSPR", "X64_ESRV") and it seems your data doesn't have a known host code. I suspect Matt has never seen a SAS file from a Windows 7 Pro box. Now, the code currently doesn't do anything dependent on the host, there's just a cautionary stop() that you have hit. You could edit read.sas7bdat, remove the stop (or add W32_7PRO to the known hosts), reinstall, and see if it works. Or more hackerly, edit the file and replace W32_7PRO with a valid KNOWNHOST of exactly the same length (so as not to upset the delicate binary balance). "W32_VSPR" would work. Be careful editing binary files with a text editor - it might try to wrap lines or mung your file in nasty ways. Barry
On Thu, Oct 4, 2012 at 6:07 PM, Nordlund, Dan (DSHS/RDA) <NordlDJ at dshs.wa.gov> wrote:> Looking at the source code on github, Matt has already added W32_7PRO to the list of known hosts. So, you could download the source tarball and build the package yourself, or just extract the SAS7bdat.R file from the tarball and source it into your R session. Otherwise, you will probably need to wait for the next update to be submitted to CRAN.Easy peasy. No need to wait. Just use devtools: install.packages("devtools") # from CRAN library(devtools) install_github("sas7bdat","BioStatMatt") Barry