An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20081212/e13e0e60/attachment.pl>
sas.get function in Hmsic 3.4-4 vs. 3.0-12
4 messages · Larry Ma, David Winsemius, Daniel Nordlund
Could the R Windows FAQ 2.16 be relevant? http://cran.r-project.org/bin/windows/base/rw-FAQ.html#R-can_0027t-find-my-file -- D Winsemius
On Dec 12, 2008, at 11:34 PM, Larry Ma wrote:
Dear R Users, I have just installed R 2.8 today and also updated the Hmisc package to the latest 3.4-4 version. However, the sas.get function no longer works in the new Hmsic 3.4-4. Below is a sample code and output from the old and new, but the old one worked. Can someone tell me how sas.get should be used in Hmisc 3.4-4. Thanks, Larry Package Hmisc version 3.0-12
a1 <- sas.get("C:\\Temp", mem="one")
Read 2 records
Read 1 record
Warning message:
C:\Temp/formats.sc? or formats.sas7bcat not found. Formatting
ignored.
in: sas.get("C:\\Temp", mem = "one")
a1
x y 1 1 2 Package Hmisc version 3.4-4
a1 <- sas.get("C:\\Temp", mem="one")
The filename, directory name, or volume label syntax is incorrect.
Error in sas.get("C:\\Temp", mem = "one") : SAS job failed with
status 1
In addition: Warning messages:
1: In sas.get("C:\\Temp", mem = "one") :
C:\Temp/formats.sc? or formats.sas7bcat not found. Formatting
ignored.
2: In shell(cmd, wait = TRUE, intern = output) :
'"sas" "C:\DOCUME~1\malarry\LOCALS~1\Temp\Rtmp84GyYh
\SaS2ea6bb3.3.sas" -log "_temp_.log"' execution failed with error
code 1
[[alternative HTML version deleted]]
______________________________________________ R-help at 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.
-----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Larry Ma Sent: Friday, December 12, 2008 8:34 PM To: r-help at r-project.org Subject: [R] sas.get function in Hmsic 3.4-4 vs. 3.0-12 Dear R Users, I have just installed R 2.8 today and also updated the Hmisc package to the latest 3.4-4 version. However, the sas.get function no longer works in the new Hmsic 3.4-4. Below is a sample code and output from the old and new, but the old one worked. Can someone tell me how sas.get should be used in Hmisc 3.4-4. Thanks, Larry Package Hmisc version 3.0-12
a1 <- sas.get("C:\\Temp", mem="one")
Read 2 records
Read 1 record
Warning message:
C:\Temp/formats.sc? or formats.sas7bcat not found.
Formatting ignored.
in: sas.get("C:\\Temp", mem = "one")
a1
x y 1 1 2 Package Hmisc version 3.4-4
a1 <- sas.get("C:\\Temp", mem="one")
The filename, directory name, or volume label syntax is incorrect.
Error in sas.get("C:\\Temp", mem = "one") : SAS job failed
with status 1
In addition: Warning messages:
1: In sas.get("C:\\Temp", mem = "one") :
C:\Temp/formats.sc? or formats.sas7bcat not found.
Formatting ignored.
2: In shell(cmd, wait = TRUE, intern = output) :
'"sas"
"C:\DOCUME~1\malarry\LOCALS~1\Temp\Rtmp84GyYh\SaS2ea6bb3.3.sas
" -log "_temp_.log"' execution failed with error code 1
[[alternative HTML version deleted]]
Larry, I presume your unstated OS is some version of MS Windows (it probably doesn't matter which, in this case). If you search R-help for "sas.get" you will find a lot of posts dealing with the fact that sas.get() does not work out of the box on Windows. This has been true for some time, so I am surprised that it worked for you prior to upgrading to R-2.8.0 and Hmisc 3.4-4. Anyway, from the Rgui console select Help, then search.r-project.org, and search for sas.get. The following post has the solution to your problem. http://finzi.psych.upenn.edu/R/Rhelp02a/archive/97413.html Hope this is helpful, Dan Daniel Nordlund Bothell, WA USA
Dan,
Thanks for the link. Here is what I learned:
#1 new Hmsic sas.get which didn't work
status <- sys(paste(shQuote(sasprog), shQuote(sasin), "-log",
shQuote(log.file)), output = FALSE)
#2 old Hmsic which worked, and you can replace the following line in the new
sas.get
status <- sys(paste(sasprog, sasin, "-log", log.file), output = FALSE)
#3 revision suggested by others
status <- system(paste(shQuote(sasprog), shQuote(sasin), "-log",
shQuote(log.file)))
I am not sure why, but both #2 and #3 worked.
Kind regards,
Larry
----- Original Message -----
From: "Daniel Nordlund" <djnordlund at verizon.net>
To: <r-help at r-project.org>
Sent: Saturday, December 13, 2008 6:24 AM
Subject: Re: [R] sas.get function in Hmsic 3.4-4 vs. 3.0-12
-----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Larry Ma Sent: Friday, December 12, 2008 8:34 PM To: r-help at r-project.org Subject: [R] sas.get function in Hmsic 3.4-4 vs. 3.0-12 Dear R Users, I have just installed R 2.8 today and also updated the Hmisc package to the latest 3.4-4 version. However, the sas.get function no longer works in the new Hmsic 3.4-4. Below is a sample code and output from the old and new, but the old one worked. Can someone tell me how sas.get should be used in Hmisc 3.4-4. Thanks, Larry Package Hmisc version 3.0-12
a1 <- sas.get("C:\\Temp", mem="one")
Read 2 records
Read 1 record
Warning message:
C:\Temp/formats.sc? or formats.sas7bcat not found.
Formatting ignored.
in: sas.get("C:\\Temp", mem = "one")
a1
x y 1 1 2 Package Hmisc version 3.4-4
a1 <- sas.get("C:\\Temp", mem="one")
The filename, directory name, or volume label syntax is incorrect.
Error in sas.get("C:\\Temp", mem = "one") : SAS job failed
with status 1
In addition: Warning messages:
1: In sas.get("C:\\Temp", mem = "one") :
C:\Temp/formats.sc? or formats.sas7bcat not found.
Formatting ignored.
2: In shell(cmd, wait = TRUE, intern = output) :
'"sas"
"C:\DOCUME~1\malarry\LOCALS~1\Temp\Rtmp84GyYh\SaS2ea6bb3.3.sas
" -log "_temp_.log"' execution failed with error code 1
[[alternative HTML version deleted]]
Larry, I presume your unstated OS is some version of MS Windows (it probably doesn't matter which, in this case). If you search R-help for "sas.get" you will find a lot of posts dealing with the fact that sas.get() does not work out of the box on Windows. This has been true for some time, so I am surprised that it worked for you prior to upgrading to R-2.8.0 and Hmisc 3.4-4. Anyway, from the Rgui console select Help, then search.r-project.org, and search for sas.get. The following post has the solution to your problem. http://finzi.psych.upenn.edu/R/Rhelp02a/archive/97413.html Hope this is helpful, Dan Daniel Nordlund Bothell, WA USA
______________________________________________ R-help at 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.