<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to check catalogs and datasets present in a folder ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-catalogs-and-datasets-present-in-a-folder/m-p/15423#M2038</link>
    <description>seems a bit cheeky to add to an ArtC posting but feel it is worth offering PROC SQL.&lt;BR /&gt;
An SQL where clause testing just LIBNAME will be very much faster than the equivalent data step.&lt;BR /&gt;
In sql sashelp.vcolumn should provide information more quickly if the sql has a WHERE clause explicitly restricting the query to named libraries. If functions or expressions in the where clause can only be satisfied by reading table information (like nobs, last modified date or column format) then sql will be just as slow as the data step.&lt;BR /&gt;
 &lt;BR /&gt;
peterC</description>
    <pubDate>Thu, 06 May 2010 07:47:53 GMT</pubDate>
    <dc:creator>Peter_C</dc:creator>
    <dc:date>2010-05-06T07:47:53Z</dc:date>
    <item>
      <title>How to check catalogs and datasets present in a folder ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-catalogs-and-datasets-present-in-a-folder/m-p/15415#M2030</link>
      <description>Is there any way to check are there any SAS catalogs and datasets present in a folder ?</description>
      <pubDate>Tue, 04 May 2010 20:09:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-catalogs-and-datasets-present-in-a-folder/m-p/15415#M2030</guid>
      <dc:creator>anandbillava</dc:creator>
      <dc:date>2010-05-04T20:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to check catalogs and datasets present in a folder ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-catalogs-and-datasets-present-in-a-folder/m-p/15416#M2031</link>
      <description>Use the folder in an libname statement, then check sashelp.vmember.&lt;BR /&gt;
&lt;BR /&gt;
Untested:&lt;BR /&gt;
&lt;BR /&gt;
[pre]libname check "path";&lt;BR /&gt;
&lt;BR /&gt;
proc sql print;&lt;BR /&gt;
  select count(*) as CatalogCount&lt;BR /&gt;
    from sashelp.vmember &lt;BR /&gt;
    where libname = "CHECK" and memtype = "CATALOG";&lt;BR /&gt;
  select count(*) as DatasetCount&lt;BR /&gt;
    from sashelp.vmember &lt;BR /&gt;
    where libname = "CHECK" and memtype = "DATA";&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
libname check clear;[/pre]</description>
      <pubDate>Wed, 05 May 2010 07:01:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-catalogs-and-datasets-present-in-a-folder/m-p/15416#M2031</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2010-05-05T07:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to check catalogs and datasets present in a folder ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-catalogs-and-datasets-present-in-a-folder/m-p/15417#M2032</link>
      <description>You can use the FILEEXIST function to test if a directory/folder path exists.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 05 May 2010 09:04:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-catalogs-and-datasets-present-in-a-folder/m-p/15417#M2032</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-05-05T09:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to check catalogs and datasets present in a folder ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-catalogs-and-datasets-present-in-a-folder/m-p/15418#M2033</link>
      <description>Fileexisits can be used when you want to check a specific dataset or catalog. &lt;BR /&gt;
I think checking for an entry in vmember is ideal.</description>
      <pubDate>Wed, 05 May 2010 15:57:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-catalogs-and-datasets-present-in-a-folder/m-p/15418#M2033</guid>
      <dc:creator>anandbillava</dc:creator>
      <dc:date>2010-05-05T15:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to check catalogs and datasets present in a folder ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-catalogs-and-datasets-present-in-a-folder/m-p/15419#M2034</link>
      <description>Any body knows how to check in which platform the dataset or the catalogs are created ?</description>
      <pubDate>Wed, 05 May 2010 16:40:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-catalogs-and-datasets-present-in-a-folder/m-p/15419#M2034</guid>
      <dc:creator>anandbillava</dc:creator>
      <dc:date>2010-05-05T16:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to check catalogs and datasets present in a folder ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-catalogs-and-datasets-present-in-a-folder/m-p/15420#M2035</link>
      <description>Hi:&lt;BR /&gt;
  That information is contained in either the Engine/Host output object from PROC CONTENTS, or in the DATAREPNAME variable from SASHELP.VTABLE or the DICTIONARY. equivalent of SASHELP.VTABLE. To create a SAS dataset from an ODS output object, use the ODS OUTPUT statement. To create a SAS dataset from a query against the SASHELP or DICTIONARY dataset, use SQL techniques, as shown previously.&lt;BR /&gt;
&lt;BR /&gt;
  User group papers that outline how to use SASHELP.VCOLUMNS or DICTIONARY.COLUMNS will probably also have information on these tables as well.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Wed, 05 May 2010 20:07:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-catalogs-and-datasets-present-in-a-folder/m-p/15420#M2035</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-05-05T20:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to check catalogs and datasets present in a folder ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-catalogs-and-datasets-present-in-a-folder/m-p/15421#M2036</link>
      <description>Does anybody know why querying vcolumns table is very slow.</description>
      <pubDate>Thu, 06 May 2010 01:13:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-catalogs-and-datasets-present-in-a-folder/m-p/15421#M2036</guid>
      <dc:creator>anandbillava</dc:creator>
      <dc:date>2010-05-06T01:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to check catalogs and datasets present in a folder ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-catalogs-and-datasets-present-in-a-folder/m-p/15422#M2037</link>
      <description>SASHELP.VCOLUMNS is a VIEW and as such is built when requested.  Since it contains one row for every variable, in every table, in every library available to SAS, it can take awhile.  PROC CONTENTS with an OUT= option for a specific libref is usually faster.&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc contents data=mylib._all_ out=cont;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
See today's tip of the Day on sasCommunity.org.</description>
      <pubDate>Thu, 06 May 2010 02:35:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-catalogs-and-datasets-present-in-a-folder/m-p/15422#M2037</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2010-05-06T02:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to check catalogs and datasets present in a folder ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-catalogs-and-datasets-present-in-a-folder/m-p/15423#M2038</link>
      <description>seems a bit cheeky to add to an ArtC posting but feel it is worth offering PROC SQL.&lt;BR /&gt;
An SQL where clause testing just LIBNAME will be very much faster than the equivalent data step.&lt;BR /&gt;
In sql sashelp.vcolumn should provide information more quickly if the sql has a WHERE clause explicitly restricting the query to named libraries. If functions or expressions in the where clause can only be satisfied by reading table information (like nobs, last modified date or column format) then sql will be just as slow as the data step.&lt;BR /&gt;
 &lt;BR /&gt;
peterC</description>
      <pubDate>Thu, 06 May 2010 07:47:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-catalogs-and-datasets-present-in-a-folder/m-p/15423#M2038</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-05-06T07:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to check catalogs and datasets present in a folder ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-catalogs-and-datasets-present-in-a-folder/m-p/15424#M2039</link>
      <description>Good point Peter.  In the DATA step the WHERE is applied after the view instructions have been executed (even a WHERE= on the SET statement), however in a SQL step, the WHERE is applied as the table is being built from the view.  Thus using the view in a SQL step, with a WHERE, can result in huge savings.</description>
      <pubDate>Thu, 06 May 2010 19:19:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-catalogs-and-datasets-present-in-a-folder/m-p/15424#M2039</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2010-05-06T19:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to check catalogs and datasets present in a folder ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-catalogs-and-datasets-present-in-a-folder/m-p/15425#M2040</link>
      <description>From personal experience the fastest way to get info on SAS files is to use the DICTIONARY tables directly in SQL. For example:&lt;BR /&gt;
&lt;BR /&gt;
proc sql noprint;&lt;BR /&gt;
  select name into :var_name separated by ' ' from dictionary.columns&lt;BR /&gt;
     where upcase(libname)='SASHELP' and upcase(memname)='CLASS';&lt;BR /&gt;
quit;&lt;BR /&gt;
%put &amp;amp;var_name;&lt;BR /&gt;
&lt;BR /&gt;
This example builds a variable list for the selected table and stores it into a macro variable. It is a very handy technique that can be used for a variety of purposes.</description>
      <pubDate>Fri, 07 May 2010 02:32:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-catalogs-and-datasets-present-in-a-folder/m-p/15425#M2040</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2010-05-07T02:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to check catalogs and datasets present in a folder ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-catalogs-and-datasets-present-in-a-folder/m-p/15426#M2041</link>
      <description>The following example is closer to what you want:&lt;BR /&gt;
&lt;BR /&gt;
proc sql noprint;&lt;BR /&gt;
  select memname into :mem_list separated by ' ' from dictionary.members&lt;BR /&gt;
     where upcase(libname)='SASHELP' ;&lt;BR /&gt;
quit;&lt;BR /&gt;
%put &amp;amp;mem_list;&lt;BR /&gt;
&lt;BR /&gt;
You can limit the types of SAS files to search on by using MEMTYPE in the WHERE clause.</description>
      <pubDate>Fri, 07 May 2010 02:50:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-catalogs-and-datasets-present-in-a-folder/m-p/15426#M2041</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2010-05-07T02:50:55Z</dc:date>
    </item>
  </channel>
</rss>

