s-news
[Top] [All Lists]

SUMMARY: reading SAS datasets with Splus

To: s-news@lists.biostat.wustl.edu
Subject: SUMMARY: reading SAS datasets with Splus
From: "Matt J. VanVlack" <mjv@numeric.com>
Date: Mon, 25 Jun 2001 15:58:30 -0400 (EDT)
Reply-to: "Matthew J. Van Vlack" <mjv@numeric.com>
Thanks to those who responded to my posting (Carlos Alzola, Chris Barker,
Jason Connor, Frank Harrell, Don MacQueen, and Jim Pratt), and to
Insightful Tech Support who responded to a separate email.  I have found 2
solutions:

1. (from Insightful) Run Splus version 6.0.1 instead of 6.0.

2. (from Frank Herrell, with similar suggestions by others) Use sas.get
from the latest version of the Hmisc library.



Matt Van Vlack



**********************************************************************

Original posting was:



Hi,

First, my apologies in advance if this post is off-topic for this list.

I am a moderately experienced SAS programmer who is new to Splus.  I am
trying to read SAS datasets into Splus using the importData function.  It
works fine when the SAS fields are set to 8 bytes per record (the default
for numeric types), but has trouble when set to lower precision.  For
example:

> version
Version 6.0 Release 1 for Sun SPARC, SunOS 5.6 : 2000 
> z <- importData("./size8ds.sas7bdat")
> z
    x   y 
1 3.2 5.6
2 1.0 7.7

So far, so good.  But when the SAS dataset has been stored with 4 bytes per 
field:


> z <- importData("./size4ds.sas7bdat") 
> z
              x             y 
1 5.308098e-315 5.312242e-315
2 5.299809e-315 5.314962e-315


One obvious solution to my problem is to save the SAS datasets with 8 bytes
per field.  However, I have a large amount of data in SAS (both in terms of
number of datasets and total bytes), and most of it is stored with 4 bytes
per numeric field, so I'd like to avoid this path if possible.

Any suggestions?


Thanks,
Matt Van Vlack

****************************************
Matthew J. Van Vlack
Senior Research Analyst
Numeric Investors, L.P.
Cambridge, MA  02142
(617) 577-1166
mjv@numeric.com
http://www.numeric.com
****************************************



P.S.  The SAS is version 8 for Solaris, if that is relevant.  The SAS code
used to generate the above datasets is:

data "./size8ds";
   x = 3.2; y = 5.6; output;
   x = 1.0; y = 7.7; output;
   length x y 8;
run;



data "./size4ds";
   x = 3.2; y = 5.6; output;
   x = 1.0; y = 7.7; output;
   length x y 4;
run;

<Prev in Thread] Current Thread [Next in Thread>
  • SUMMARY: reading SAS datasets with Splus, Matt J. VanVlack <=