<?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 Wild Cards in Proc Contents? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Wild-Cards-in-Proc-Contents/m-p/242478#M45013</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to do a proc contents on &lt;U&gt;many&lt;/U&gt; datasets(&lt;U&gt;NOT ALL&lt;/U&gt;) within the same library.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want something like this. Proc contents on all datasets in sashelp library starting with "c"&lt;/P&gt;
&lt;P&gt;The below code definitely does not work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc contents data = sashelp.c : ;&lt;/P&gt;
&lt;P&gt;run;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I do this?&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jan 2016 21:59:46 GMT</pubDate>
    <dc:creator>ArpitSharma</dc:creator>
    <dc:date>2016-01-08T21:59:46Z</dc:date>
    <item>
      <title>Wild Cards in Proc Contents?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Wild-Cards-in-Proc-Contents/m-p/242478#M45013</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to do a proc contents on &lt;U&gt;many&lt;/U&gt; datasets(&lt;U&gt;NOT ALL&lt;/U&gt;) within the same library.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want something like this. Proc contents on all datasets in sashelp library starting with "c"&lt;/P&gt;
&lt;P&gt;The below code definitely does not work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc contents data = sashelp.c : ;&lt;/P&gt;
&lt;P&gt;run;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I do this?&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2016 21:59:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Wild-Cards-in-Proc-Contents/m-p/242478#M45013</guid>
      <dc:creator>ArpitSharma</dc:creator>
      <dc:date>2016-01-08T21:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: Wild Cards in Proc Contents?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Wild-Cards-in-Proc-Contents/m-p/242485#M45015</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
set sashelp.vtable;
where libname='SASHELP' &amp;amp; memname=:'C';
call execute(cats('proc contents data=',libname,'.',memname,'; run;'));
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Jan 2016 22:24:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Wild-Cards-in-Proc-Contents/m-p/242485#M45015</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-01-08T22:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: Wild Cards in Proc Contents?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Wild-Cards-in-Proc-Contents/m-p/242513#M45021</link>
      <description>&lt;P&gt;What output do you want from proc contents? It may be worth grabbing the info from SASHELP.VCOLUMN/VTABLE rather than pull from proc contents.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jan 2016 02:46:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Wild-Cards-in-Proc-Contents/m-p/242513#M45021</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-09T02:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: Wild Cards in Proc Contents?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Wild-Cards-in-Proc-Contents/m-p/242520#M45023</link>
      <description>Thank You for your suggestion.
Yes I get what you are trying to say but I am sorry I did not put exactly what I wanted.

In the question when I say "sashelp" what I actually mean is ANY library.

Not every library will have a vtable within it.

Over here you are suggesting something very specific for sashelp.vtable , which is not exactly what I meant.


I hope now I am explaining it more precisely.
Sorry for misleading info above.

Regards</description>
      <pubDate>Sat, 09 Jan 2016 03:39:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Wild-Cards-in-Proc-Contents/m-p/242520#M45023</guid>
      <dc:creator>ArpitSharma</dc:creator>
      <dc:date>2016-01-09T03:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: Wild Cards in Proc Contents?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Wild-Cards-in-Proc-Contents/m-p/242523#M45024</link>
      <description>&lt;P&gt;SASHELP.VTABLE exists always, as far as I know.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It might help your understanding of what this suggestion gives you if you view this table. It's essentially&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC PRINT DATA=SASHELP.VTABLE;RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Either way, you can modify the where statement to choose any assigned library you want. You could also get rid of the library='SASHELP'&amp;nbsp;piece of the where statement altogether to see all tables in all libraries you have assigned. e.g.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  set sashelp.vtable;
  where memname=:'C';
  call execute(cats('proc contents data=',libname,'.',memname,'; run;'));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 09 Jan 2016 04:29:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Wild-Cards-in-Proc-Contents/m-p/242523#M45024</guid>
      <dc:creator>JoshB</dc:creator>
      <dc:date>2016-01-09T04:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: Wild Cards in Proc Contents?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Wild-Cards-in-Proc-Contents/m-p/242538#M45029</link>
      <description>&lt;P&gt;Hello, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/325"&gt;@ArpitSharma﻿&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It appears that I should have commented my suggestion a little more. Thanks to &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/50008"&gt;@JoshB﻿&lt;/a&gt;&amp;nbsp;for stepping in during the night (in my time zone).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, the SET statement reading SASHELP.VTABLE is the constant part of the suggested data _null_ step. It was just coincidence that library SASHELP occurred in your example, too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SASHELP.VTABLE is one of more than 30 SQL views on the so called DICTIONARY tables. These, in turn, are "special read-only PROC SQL tables or views [which] retrieve information about all the SAS libraries, SAS data sets, SAS system options, and external files that are associated with the current SAS session" (&lt;A href="http://support.sas.com/documentation/cdl/en/sqlproc/69049/HTML/default/viewer.htm#n02s19q65mw08gn140bwfdh7spx7.htm" target="_blank"&gt;online documentation&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;So, there is a lot of information, namely metadata, available through these views.&amp;nbsp;As &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza﻿&lt;/a&gt;&amp;nbsp;suggested, the information you are looking for could most likely be retrieved directly from the DICTIONARY tables. This would be particularly convenient if you want to store or process those metadata.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;However, if you just want to quickly look through selected PROC CONTENTS outputs on the screen, my suggested code should work well for you.&amp;nbsp;Please note how flexible the WHERE condition is: You can filter by any combination of the 40+ variables in SASHELP.VTABLE, using operators and SAS functions to specify your selection criteria.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example: If you are interested in the PROC CONTENTS outputs of all datasets&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 20px;"&gt;excluding views&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 20px;"&gt;in all libraries whose librefs start with "PROJ"&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 20px;"&gt;which have been modified within the previous month&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 20px;"&gt;whose names contain the substring "LAB"&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 20px;"&gt;whose dataset labels do not contain the substring "2015"&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 20px;"&gt;excluding small files &amp;lt;256 KB, unless they have at least 500 observations or more than 10 variables&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 20px;"&gt;...&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;you could easily adapt the WHERE clause to match exactly these selection requirements (using variables &lt;BR /&gt;MEMTYPE, LIBNAME, MODATE, MEMNAME, MEMLABEL, FILESIZE, NOBS, NVAR, etc. of SASHELP.VTABLE).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you can see, this goes far beyond what could be achieved with "wild cards in proc contents."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jan 2016 13:46:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Wild-Cards-in-Proc-Contents/m-p/242538#M45029</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-01-09T13:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: Wild Cards in Proc Contents?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Wild-Cards-in-Proc-Contents/m-p/242567#M45036</link>
      <description>Proc contents and sashelp.vtable use the same source of information. If you have a server, certain information is not includes in either proc contents or the dictionary tables.</description>
      <pubDate>Sat, 09 Jan 2016 18:13:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Wild-Cards-in-Proc-Contents/m-p/242567#M45036</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-09T18:13:59Z</dc:date>
    </item>
  </channel>
</rss>

