Thomas, As F Harrel in a preceding message told me that you are the maintainer of Hmisc package, I write directly to you, with copy to the Rhelp list in case someone encountered the same problem and find some benefit in the response. I used quite often the function sas.get in Hmisc library which I is very, very useful. But, as trying to reuse it today it seems not to function anymore. I tried everything I could imagine this afternoon, with no success. Here is my last test. 'datatest' is a very simple SAS dataset (V9.1) with only 3 variables, 100 obs, no format. Sas.get produces this ouput :> bs2m <- sas.get(library="C:/test","datatest")Syntaxe du nom de fichier, de r?pertoire ou de volume incorrecte. Error in sas.get(library = "C:/test", "datatest") : SAS job failed with status 1 In addition: Warning message: 'cmd' execution failed with error code 1 in: shell(cmd, wait = TRUE, intern = output) In the R temp directory there is only one file : SaS678418be.3.sas, containing the usual SAS program (macro and macro call). I can run it from R with :> sys("sas -sysin C:/Temp/RtmpuC23qb/SaS678418be.3.sas")character(0) and I get two files with dict (SaS678418be.1.sas) and data (SaS678418be.2.sas). So the SAS step seems to work fine. Do you have an idea of what went wrong ? I tried to run old R progs with sas.get which used to work, and have the same problem. Thank you in advance.> version_ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 2 minor 4.0 year 2006 month 10 day 03 svn rev 39566 language R version.string R version 2.4.0 (2006-10-03)
The workaround you point seems to be the solution for the moment. I not sure I will have time (and courage) to try to figure out where the bug comes from. Hope a more literate R programmer than me is willing to dive in... Thank you for your answer. 2006/12/12, Agustin Calatroni <acalatro at rhoworld.com>:> Jean, I saw your email to the R-help mailing list. I also notice the > problem a few months back and email the maintainer (Charles Dupont) but > never got a response. Since I used the function a lot and in order to > avoid the error I use version 3.0-12 instead of updating the a newer > version. To download the earlier version use the following site: > http://cran.r-project.org/bin/windows/contrib/2.2/ If you figure out > another way around the problem I will be interested in knowing the solution. > > Sincerely, > > > -- Agustin Calatroni > > Agustin Calatroni wrote: > > I been having the following problem when I updated the Hmisc package > > from version 3.0-12 to version 3.1-1. > > > > Create dataset under SAS: > > data a; > > do i = 1 to 100; > > x = rannor(0); > > output; > > end; > > run; > > > > Hmisc version 3.0-12: > > library(Hmisc) > > sas.get('C:\\Documents and Settings\\novell\\My Documents\\SAS > > Temp\\_TD3428','a') > > > > NO PROBLEM > > > > Hmisc version 3.1-1: > > library(Hmisc) > > sas.get('C:\\Documents and Settings\\novell\\My Documents\\SAS > > Temp\\_TD3428','a') > > > > The filename, directory name, or volume label syntax is incorrect. > > Error in sas.get("C:\\Documents and Settings\\novell\\My Documents\\SAS > > Temp\\_TD3428", : > > SAS job failed with status 1 > > In addition: Warning message: > > 'cmd' execution failed with error code 1 in: shell(cmd, wait = TRUE, > > intern = output) > > > > R.Version() > > $platform > > [1] "i386-pc-mingw32" > > $arch > > [1] "i386" > > $os > > [1] "mingw32" > > $system > > [1] "i386, mingw32" > > $status > > [1] "" > > $major > > [1] "2" > > $minor > > [1] "3.1" > > $year > > [1] "2006" > > $month > > [1] "06" > > $day > > [1] "01" > > $`svn rev` > > [1] "38247" > > $language > > [1] "R" > > $version.string > > [1] "Version 2.3.1 (2006-06-01)" > > > > Thanks for Hmisc and Design packages, they are an invaluable resource. > > Sorry if this is a stupid question and I missed something obvious. > > > >
_______________________________________________________________________________________ After digging around in the sas.get code, I found a change that seems to be causing the problem: old version: ... status <- sys(paste(sasprog, sasin, "-log", log.file), output = FALSE) ... new version: ... status <- sys(paste(shQuote(sasprog), shQuote(sasin), "-log", shQuote(log.file)), output = FALSE) ... For some reason, sys() bombs when given a command string with quotes in it. The string works fine when pasted into a command line window, so maybe it's a problem with the WinXP commmand interpreter? In any case, changing the sys() call to system() seems to fix the problem. ... status <- system(paste(shQuote(sasprog), shQuote(sasin), "-log", shQuote(log.file))) ... -- Hong Ooi Senior Research Analyst, IAG Limited 388 George St, Sydney NSW 2000 +61 (2) 9292 1566 -----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Jean Vidal Sent: Wednesday, 13 December 2006 8:02 PM To: acalatro at rhoworld.com Cc: r-help at stat.math.ethz.ch Subject: Re: [R] Problem with sas.get function in Hmisc The workaround you point seems to be the solution for the moment. I not sure I will have time (and courage) to try to figure out where the bug comes from. Hope a more literate R programmer than me is willing to dive in... Thank you for your answer. 2006/12/12, Agustin Calatroni <acalatro at rhoworld.com>:> Jean, I saw your email to the R-help mailing list. I also notice the > problem a few months back and email the maintainer (Charles Dupont)but> never got a response. Since I used the function a lot and in order to > avoid the error I use version 3.0-12 instead of updating the a newer > version. To download the earlier version use the following site: > http://cran.r-project.org/bin/windows/contrib/2.2/ If you figure out > another way around the problem I will be interested in knowing thesolution.> > Sincerely, > > > -- Agustin Calatroni > > Agustin Calatroni wrote: > > I been having the following problem when I updated the Hmisc package > > from version 3.0-12 to version 3.1-1. > > > > Create dataset under SAS: > > data a; > > do i = 1 to 100; > > x = rannor(0); > > output; > > end; > > run; > > > > Hmisc version 3.0-12: > > library(Hmisc) > > sas.get('C:\\Documents and Settings\\novell\\My Documents\\SAS > > Temp\\_TD3428','a') > > > > NO PROBLEM > > > > Hmisc version 3.1-1: > > library(Hmisc) > > sas.get('C:\\Documents and Settings\\novell\\My Documents\\SAS > > Temp\\_TD3428','a') > > > > The filename, directory name, or volume label syntax is incorrect. > > Error in sas.get("C:\\Documents and Settings\\novell\\MyDocuments\\SAS> > Temp\\_TD3428", : > > SAS job failed with status 1 > > In addition: Warning message: > > 'cmd' execution failed with error code 1 in: shell(cmd, wait = TRUE, > > intern = output) > > > > R.Version() > > $platform > > [1] "i386-pc-mingw32" > > $arch > > [1] "i386" > > $os > > [1] "mingw32" > > $system > > [1] "i386, mingw32" > > $status > > [1] "" > > $major > > [1] "2" > > $minor > > [1] "3.1" > > $year > > [1] "2006" > > $month > > [1] "06" > > $day > > [1] "01" > > $`svn rev` > > [1] "38247" > > $language > > [1] "R" > > $version.string > > [1] "Version 2.3.1 (2006-06-01)" > > > > Thanks for Hmisc and Design packages, they are an invaluableresource.> > Sorry if this is a stupid question and I missed something obvious. > > > >______________________________________________ R-help at stat.math.ethz.ch 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. _______________________________________________________________________________________ The information transmitted in this message and its attachme...{{dropped}}
Hello Hong, Thanks a lot for the solution you sent. It works fine now. 2006/12/14, Hong Ooi <Hong.Ooi at iag.com.au>:> > _______________________________________________________________________________________ > > Note: This e-mail is subject to the disclaimer contained at the bottom of this message. > _______________________________________________________________________________________ > > > After digging around in the sas.get code, I found a change that seems to > be causing the problem: > > old version: > > ... > status <- sys(paste(sasprog, sasin, "-log", log.file), > output = FALSE) > ... > > new version: > > ... > status <- sys(paste(shQuote(sasprog), shQuote(sasin), "-log", > shQuote(log.file)), output = FALSE) > ... > > > For some reason, sys() bombs when given a command string with quotes in > it. The string works fine when pasted into a command line window, so > maybe it's a problem with the WinXP commmand interpreter? In any case, > changing the sys() call to system() seems to fix the problem. > > ... > status <- system(paste(shQuote(sasprog), shQuote(sasin), "-log", > shQuote(log.file))) > ... > > > -- > Hong Ooi > Senior Research Analyst, IAG Limited > 388 George St, Sydney NSW 2000 > +61 (2) 9292 1566 > -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Jean Vidal > Sent: Wednesday, 13 December 2006 8:02 PM > To: acalatro at rhoworld.com > Cc: r-help at stat.math.ethz.ch > Subject: Re: [R] Problem with sas.get function in Hmisc > > The workaround you point seems to be the solution for the moment. > I not sure I will have time (and courage) to try to figure out where > the bug comes from. Hope a more literate R programmer than me is > willing to dive in... > > Thank you for your answer. > > 2006/12/12, Agustin Calatroni <acalatro at rhoworld.com>: > > Jean, I saw your email to the R-help mailing list. I also notice the > > problem a few months back and email the maintainer (Charles Dupont) > but > > never got a response. Since I used the function a lot and in order to > > avoid the error I use version 3.0-12 instead of updating the a newer > > version. To download the earlier version use the following site: > > http://cran.r-project.org/bin/windows/contrib/2.2/ If you figure out > > another way around the problem I will be interested in knowing the > solution. > > > > Sincerely, > > > > > > -- Agustin Calatroni > > > > Agustin Calatroni wrote: > > > I been having the following problem when I updated the Hmisc package > > > from version 3.0-12 to version 3.1-1. > > > > > > Create dataset under SAS: > > > data a; > > > do i = 1 to 100; > > > x = rannor(0); > > > output; > > > end; > > > run; > > > > > > Hmisc version 3.0-12: > > > library(Hmisc) > > > sas.get('C:\\Documents and Settings\\novell\\My Documents\\SAS > > > Temp\\_TD3428','a') > > > > > > NO PROBLEM > > > > > > Hmisc version 3.1-1: > > > library(Hmisc) > > > sas.get('C:\\Documents and Settings\\novell\\My Documents\\SAS > > > Temp\\_TD3428','a') > > > > > > The filename, directory name, or volume label syntax is incorrect. > > > Error in sas.get("C:\\Documents and Settings\\novell\\My > Documents\\SAS > > > Temp\\_TD3428", : > > > SAS job failed with status 1 > > > In addition: Warning message: > > > 'cmd' execution failed with error code 1 in: shell(cmd, wait = TRUE, > > > intern = output) > > > > > > R.Version() > > > $platform > > > [1] "i386-pc-mingw32" > > > $arch > > > [1] "i386" > > > $os > > > [1] "mingw32" > > > $system > > > [1] "i386, mingw32" > > > $status > > > [1] "" > > > $major > > > [1] "2" > > > $minor > > > [1] "3.1" > > > $year > > > [1] "2006" > > > $month > > > [1] "06" > > > $day > > > [1] "01" > > > $`svn rev` > > > [1] "38247" > > > $language > > > [1] "R" > > > $version.string > > > [1] "Version 2.3.1 (2006-06-01)" > > > > > > Thanks for Hmisc and Design packages, they are an invaluable > resource. > > > Sorry if this is a stupid question and I missed something obvious. > > > > > > > > > ______________________________________________ > R-help at stat.math.ethz.ch 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. > > _______________________________________________________________________________________ > > The information transmitted in this message and its attach...{{dropped}}