Hi,
I am trying to read a SAS version 9.1.3 SAS dataset into R (to preserve
the SAS labels), but am unable to do so (I have read in a CSV version).
I first created a transport file using the SAS code:
libname ces2 'D:\CES Analysis\Data';
filename transp 'D:\CES Analysis\Data\fadata.xpt';
/* create a transport file - R cannot read file created by proc cport */
proc cport data=ces2.fadata file=transp;
run;
I then tried to read it in R using:
SAS failed. SAS program at
D:\DOCUME~1\re06572\LOCALS~1\Temp\RtmpLqCVUx\file72ae2cd6.sas
The log file will be file72ae2cd6.log in the current directory
Warning messages:
1: In system(paste(sascmd, tmpProg)) : "sas" not found
2: In read.ssd("D:\\CES Analysis\\Data", "fadata") :
SAS return code was -1
sascmd=file.path(sashome, "sas.exe"))
SAS failed. SAS program at
D:\DOCUME~1\re06572\LOCALS~1\Temp\RtmpLqCVUx\file6df11649.sas
The log file will be file6df11649.log in the current directory
Warning message:
In read.ssd(file.path(sashome, "core", "sashelp"), "fadata", sascmd =
file.path(sashome, :
SAS return code was 2
Is there any way I can read in a SAS version 9 dataset in R, so that I
can preserve the SAS labels?
If I have to change the SAS variable names to be 8 characters or less,
to create a SAS version 6 transport file, I could probably do without
the SAS labels as I have already read in the data into R from a CSV
file.
Thanks in advance for any help.
Jude
___________________________________________
Jude Ryan
Director, Client Analytic Services
Strategy & Business Development
UBS Financial Services Inc.
1200 Harbor Boulevard, 4th Floor
Weehawken, NJ 07086-6791
Tel. 201-352-1935
Fax 201-272-2914
Email: jude.ryan at ubs.com
Please do not transmit orders or instructions regarding a UBS account by e-mail. The information provided in this e-mail or any attachments is not an official transaction confirmation or account statement. For your protection, do not include account numbers, Social Security numbers, credit card numbers, passwords or other non-public information in your e-mail. Because the information contained in this message may be privileged, confidential, proprietary or otherwise protected from disclosure, please notify us immediately by replying to this message and deleting it from your computer if you have received this communication in error. Thank you.
UBS Financial Services Inc.
UBS International Inc.
UBS Financial Services Incorporated of Puerto Rico
UBS AG
-----Original Message-----
From: r-help-bounces at r-project.org
[mailto:r-help-bounces at r-project.org] On Behalf Of jude.ryan at ubs.com
Sent: Wednesday, December 03, 2008 1:40 PM
To: r-help at r-project.org
Cc: juderyan61 at yahoo.com
Subject: [R] reading version 9 SAS datasets in R
Hi,
I am trying to read a SAS version 9.1.3 SAS dataset into R
(to preserve
the SAS labels), but am unable to do so (I have read in a CSV
version).
I first created a transport file using the SAS code:
libname ces2 'D:\CES Analysis\Data';
filename transp 'D:\CES Analysis\Data\fadata.xpt';
/* create a transport file - R cannot read file created by
proc cport */
proc cport data=ces2.fadata file=transp;
run;
I then tried to read it in R using:
SAS failed. SAS program at
D:\DOCUME~1\re06572\LOCALS~1\Temp\RtmpLqCVUx\file72ae2cd6.sas
The log file will be file72ae2cd6.log in the current directory
Warning messages:
1: In system(paste(sascmd, tmpProg)) : "sas" not found
2: In read.ssd("D:\\CES Analysis\\Data", "fadata") :
SAS return code was -1
sascmd=file.path(sashome, "sas.exe"))
SAS failed. SAS program at
D:\DOCUME~1\re06572\LOCALS~1\Temp\RtmpLqCVUx\file6df11649.sas
The log file will be file6df11649.log in the current directory
Warning message:
In read.ssd(file.path(sashome, "core", "sashelp"), "fadata", sascmd =
file.path(sashome, :
SAS return code was 2
Is there any way I can read in a SAS version 9 dataset in R, so that I
can preserve the SAS labels?
If I have to change the SAS variable names to be 8 characters or less,
to create a SAS version 6 transport file, I could probably do without
the SAS labels as I have already read in the data into R from a CSV
file.
Thanks in advance for any help.
Jude
___________________________________________
Jude Ryan
Director, Client Analytic Services
Strategy & Business Development
UBS Financial Services Inc.
1200 Harbor Boulevard, 4th Floor
Weehawken, NJ 07086-6791
Tel. 201-352-1935
Fax 201-272-2914
Email: jude.ryan at ubs.com
Jude,
Since it appears that you have access to SAS, I would look at using the sas.get() function in the Hmisc package. While the function appears to still be broken in the Windows version, there is an easy fix that has been posted to R-help in the past. If you want to try this, you can search the R-help archives for posts on sas.get or you can email me off-list and I will send you the fix with instructions. This will avoid any v6 limitations.
Hope this is helpful,
Dan
Daniel J. Nordlund
Washington State Department of Social and Health Services
Planning, Performance, and Accountability
Research and Data Analysis Division
Olympia, WA 98504-5204
Hi,
I am trying to read a SAS version 9.1.3 SAS dataset into R (to preserve
the SAS labels), but am unable to do so (I have read in a CSV version).
I first created a transport file using the SAS code:
libname ces2 'D:\CES Analysis\Data';
filename transp 'D:\CES Analysis\Data\fadata.xpt';
Try
FILENAME transp SASV5XPT 'D:\CES Analysis\Data\fadata.xpt';
Frank
/* create a transport file - R cannot read file created by proc cport */
proc cport data=ces2.fadata file=transp;
run;
I then tried to read it in R using:
SAS failed. SAS program at
D:\DOCUME~1\re06572\LOCALS~1\Temp\RtmpLqCVUx\file72ae2cd6.sas
The log file will be file72ae2cd6.log in the current directory
Warning messages:
1: In system(paste(sascmd, tmpProg)) : "sas" not found
2: In read.ssd("D:\\CES Analysis\\Data", "fadata") :
SAS return code was -1
sascmd=file.path(sashome, "sas.exe"))
SAS failed. SAS program at
D:\DOCUME~1\re06572\LOCALS~1\Temp\RtmpLqCVUx\file6df11649.sas
The log file will be file6df11649.log in the current directory
Warning message:
In read.ssd(file.path(sashome, "core", "sashelp"), "fadata", sascmd =
file.path(sashome, :
SAS return code was 2
Is there any way I can read in a SAS version 9 dataset in R, so that I
can preserve the SAS labels?
If I have to change the SAS variable names to be 8 characters or less,
to create a SAS version 6 transport file, I could probably do without
the SAS labels as I have already read in the data into R from a CSV
file.
Thanks in advance for any help.
Jude
___________________________________________
Jude Ryan
Director, Client Analytic Services
Strategy & Business Development
UBS Financial Services Inc.
1200 Harbor Boulevard, 4th Floor
Weehawken, NJ 07086-6791
Tel. 201-352-1935
Fax 201-272-2914
Email: jude.ryan at ubs.com
Please do not transmit orders or instructions regarding a UBS account by e-mail. The information provided in this e-mail or any attachments is not an official transaction confirmation or account statement. For your protection, do not include account numbers, Social Security numbers, credit card numbers, passwords or other non-public information in your e-mail. Because the information contained in this message may be privileged, confidential, proprietary or otherwise protected from disclosure, please notify us immediately by replying to this message and deleting it from your computer if you have received this communication in error. Thank you.
UBS Financial Services Inc.
UBS International Inc.
UBS Financial Services Incorporated of Puerto Rico
UBS AG
______________________________________________
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.
Frank E Harrell Jr Professor and Chair School of Medicine
Department of Biostatistics Vanderbilt University
Hi,
I am trying to read a SAS version 9.1.3 SAS dataset into R (to preserve
the SAS labels), but am unable to do so (I have read in a CSV version).
I first created a transport file using the SAS code:
libname ces2 'D:\CES Analysis\Data';
filename transp 'D:\CES Analysis\Data\fadata.xpt';
/* create a transport file - R cannot read file created by proc cport */
proc cport data=ces2.fadata file=transp;
run;
I then tried to read it in R using:
SAS failed. SAS program at
D:\DOCUME~1\re06572\LOCALS~1\Temp\RtmpLqCVUx\file72ae2cd6.sas
The log file will be file72ae2cd6.log in the current directory
Warning messages:
1: In system(paste(sascmd, tmpProg)) : "sas" not found
2: In read.ssd("D:\\CES Analysis\\Data", "fadata") :
SAS return code was -1
sascmd=file.path(sashome, "sas.exe"))
SAS failed. SAS program at
D:\DOCUME~1\re06572\LOCALS~1\Temp\RtmpLqCVUx\file6df11649.sas
The log file will be file6df11649.log in the current directory
Warning message:
In read.ssd(file.path(sashome, "core", "sashelp"), "fadata", sascmd =
file.path(sashome, :
SAS return code was 2
Is there any way I can read in a SAS version 9 dataset in R, so that I
can preserve the SAS labels?
If I have to change the SAS variable names to be 8 characters or less,
to create a SAS version 6 transport file, I could probably do without
the SAS labels as I have already read in the data into R from a CSV
file.
Thanks in advance for any help.
Jude
___________________________________________
Jude Ryan
Director, Client Analytic Services
Strategy & Business Development
UBS Financial Services Inc.
1200 Harbor Boulevard, 4th Floor
Weehawken, NJ 07086-6791
Tel. 201-352-1935
Fax 201-272-2914
Email: jude.ryan at ubs.com
Please do not transmit orders or instructions regarding a UBS account
by e-mail. The information provided in this e-mail or any attachments
is not an official transaction confirmation or account statement. For
your protection, do not include account numbers, Social Security
numbers, credit card numbers, passwords or other non-public
information in your e-mail. Because the information contained in this
message may be privileged, confidential, proprietary or otherwise
protected from disclosure, please notify us immediately by replying to
this message and deleting it from your computer if you have received
this communication in error. Thank you.
UBS Financial Services Inc.
UBS International Inc.
UBS Financial Services Incorporated of Puerto Rico
UBS AG
______________________________________________
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.
Frank E Harrell Jr Professor and Chair School of Medicine
Department of Biostatistics Vanderbilt University