[18945] in s-news-athena
Re: [S] sas.get and formats
daemon@ATHENA.MIT.EDU (Frank E Harrell Jr)
Sat Aug 14 15:41:03 1999
Message-Id: <37B5C2F8.6F7CD52E@virginia.edu>
Date: Sat, 14 Aug 1999 15:26:48 -0400
From: Frank E Harrell Jr <fharrell@virginia.edu>
Mime-Version: 1.0
To: ecm@skew2.kellogg.nwu.edu
Cc: s-news@wubios.wustl.edu
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Dear Dr. Ed,
Your question seems more appropriate for a SAS group. SAS users can
tell you all about formats.sct files.
The version of sas.get that is in the Hmisc library (available from StatLib)
will read formats.sct and will convert customized formatted variables to
S-Plus factor variables, assuming you associated the correct formats
with the correct variables somewhere along the line, using a FORMAT
or ATTRIB statement in SAS.
When working with the dataset in SAS, you should not be executing
PROC FORMAT cntlin every time.
-Frank Harrell
ecm@skew2.kellogg.nwu.edu wrote:
> Dear s-news readers,
>
> I uses Splus Ver 3.4, Release 1 under the HP-UX 9.0.5.
>
> I have a SAS data set with user-defined formats (they show up in my
> contents). When working with this data set in sas I execute the
> following code at the beginning of every program:
> proc format cntlin=curr.fmts; run;
>
> How can I read this data set into splus? When I use the sas.get
> command I get a sas error message saying that the user-defined
> formats are undefined. The help page for sas.get mentions
> format.library: The UNIX directory containing the file
> formats.sct, which contains the definitions of the user
> defined formats used in this dataset. By default, we look
> for the formats in the same directory as the data. N.B.
> The user defined formats must be available (so SAS can
> read the data), but they are not used by this version of
> sas.get.
>
> How does this work? What is a formats.sct file? As far as I can
> tell, this is not documented under proc format of the sas procedures
> manual. I've tried linking fmts.ssd01 to formats.sct and also
> placing the proc format command that creates fmts.ssd01 in
> formats.sct.
>
> I could easily fix the problem by removing the association between
> the variables and the user-defined variables from the data set, but
> then I have to respecify the formats every time I do an analysis in
> sas.
>
> Given that splus seems to ignore the user-defined formats anyway,
> why isn't there a
> format _all_;
> statement in the %sas_get macro so that sas doesn't worry about the
> formats in the first place? Also, I am using the variables= option
> in splus and none of the particular variables I am keeping are
> assigned user-defined formats. It would seem like the %sas_get
> macro should put a keep= statement when it sets the sas data set,
> e.g. set &library.&data(keep=&variables)
> This would also clear up the problem without using the
> library.format option.
>
> Ed Malthouse
> Dr. Edward C. Malthouse
> Assistant Professor
> Integrated Marketing Communications Department
> Medill School of Journalism
> 1908 Sheridan Road
> Evanston, IL 60208-1290
> Tele: 847-467-3376
> Fax: 847-491-5925
>
> -----------------------------------------------------------------------
> This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
> send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
> message: unsubscribe s-news
--
Frank E Harrell Jr
Professor of Biostatistics and Statistics
Division of Biostatistics and Epidemiology
Department of Health Evaluation Sciences
University of Virginia School of Medicine
http://hesweb1.med.virginia.edu/biostat
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news