Date: Thu, 28 Aug 2003 08:20:44 -0400
Reply-To: Paige Miller <paige.miller@KODAK.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Paige Miller <paige.miller@KODAK.COM>
Organization: Eastman Kodak Company
Subject: Re: Obtaining names of data sets contained within a library
Content-Type: text/plain; charset=us-ascii; format=flowed
Cacialli, Doug wrote:
> Hello everyone,
>
> I'm working on a macro that requires I know the names of all data sets
> contained within a specified library. The library of interest is being
> created using the ODBC engine and libname statement. I'd like the user to
> be able to simply specify the library name and then programmatically
> determine what's inside. What I've currently got is this:
>
> proc datasets library = somelib nolist;
> contents data = somelib._all_ out = work.libcontent noprint;
> run;
>
> proc sql noprint;
> select distinct libcontent.MEMNAME
> into :SETLIST separated by ' '
> from libcontent
> where (substr(MEMNAME,1,3) ^= 'qry') and
> (substr(MEMNAME,1,4) ^= 'MSys');
> quit;
>
> The 'where' sub-clause is necessary to eliminate any queries and other
> assorted nonsense not actually generated from a table in my Access database.
> The library name (e.g., 'somelib') and data set name (e.g., 'libcontent')
> are actually macro parameters ... I've hard coded them here for convenience.
>
> I'm wondering if anyone has a better (or different) way of easily obtaining
> the contents of a library. Any input would be great. Thanks!
data a;
set sashelp.vmember(where=(memtype='DATA' & libname = 'SOMELIB'));
run;
--
Paige Miller
Eastman Kodak Company
paige.miller@kodak.com
http://www.kodak.com
"It's nothing until I call it!" -- Bill Klem, NL Umpire
"When you get the choice to sit it out or dance, I hope you dance" --
Lee Ann Womack
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
|