Date: Wed, 28 Apr 2004 13:35:31 -0400
Reply-To: Bruce Johnson <bjohnson@SOLUCIENT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Bruce Johnson <bjohnson@SOLUCIENT.COM>
Subject: Re: PROC CONTENTS or DATASETS--Easy question
Content-Type: text/plain; charset="us-ascii"
Here's an easy way, but not very elegant...
Proc contents data=rdata._all_ noprint out=temp;
Proc print data=temp;
var memname name varnum format nobs;
That will get you the dataset name (memname), the variable name (name),
the number of variables (varnum..select the highest number), the format
of the variable (format), and the number of observations (nobs).
Now, you could so some fancy coding and create a report with this
information as well. It all depends on how pretty it needs to be.
Bruce A. Johnson
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Sent: Wednesday, April 28, 2004 12:21 PM
Subject: PROC CONTENTS or DATASETS--Easy question
How do I use proc contents or datasets to read in the contents of a
(1) Create a printout with ONLY the data set name, #obs, #variables, and
format associated with each variable
(2) Create a dataset with ONLY the info in (1) above?
I've been experimenting with various options with both proc contents and
proc datasets, but I'm getting too little or too much info rather than
JUST the info in (1) above. This can't be too hard! Can someone advise
me on the propoer options to use with either of these PROCs to get the
info I need?
For example, I am reading in the contents of an Access database. When I
use the following:
libname rdata odbc
proc contents directory data= rdata._all_ out=temp ;
I get WAY more info in both the output and the data set than I need.
Also, in the data set #obs is missing (not sure why) and #variables
isn't included (instead each variable is listed).
Adding other options to this so far hasn't given me what I'm looking
This message is a private communication. It may contain information that is confidential
and legally protected from disclosure. If you are not an intended recipient, please do
not read, copy or use this message or any attachments, and do not disclose them to others.
Please notify the sender of the delivery error by replying to this message, and then
delete it and any attachments from your system.
(rev eXclaimer 2x)