<?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 Finding Libname of a dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Finding-Libname-of-a-dataset/m-p/428344#M105758</link>
    <description>&lt;P&gt;In my site we've multiple libraries and multiple datasets. If I want to find the library for some particular dataset, I manually looking at each of library to find if the dataset which I'm looking for is available. Is there any way to find the&amp;nbsp;&lt;SPAN&gt;library of some particular dataset programmatically?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jan 2018 12:56:20 GMT</pubDate>
    <dc:creator>Babloo</dc:creator>
    <dc:date>2018-01-17T12:56:20Z</dc:date>
    <item>
      <title>Finding Libname of a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-Libname-of-a-dataset/m-p/428344#M105758</link>
      <description>&lt;P&gt;In my site we've multiple libraries and multiple datasets. If I want to find the library for some particular dataset, I manually looking at each of library to find if the dataset which I'm looking for is available. Is there any way to find the&amp;nbsp;&lt;SPAN&gt;library of some particular dataset programmatically?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 12:56:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-Libname-of-a-dataset/m-p/428344#M105758</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-01-17T12:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Libname of a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-Libname-of-a-dataset/m-p/428350#M105760</link>
      <description>&lt;P&gt;Depends on the OS.&amp;nbsp; You're more likely to find it by searching withing Windows Explorer, grep (linux/unix) or something like those.&amp;nbsp; You certainly can use proc datasets to see all the datasets in a particular library, though.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 13:17:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-Libname-of-a-dataset/m-p/428350#M105760</guid>
      <dc:creator>tomrvincent</dc:creator>
      <dc:date>2018-01-17T13:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Libname of a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-Libname-of-a-dataset/m-p/428353#M105762</link>
      <description>&lt;P&gt;a long time ago, i&amp;nbsp;find table sizes for each table in each predefined library.&amp;nbsp; i found a bit of starter code that i then modified.&amp;nbsp; this is what i am currently using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table VATableSize as&lt;BR /&gt;select libname, memname as TableName, nobs, filesize, obslen, nobs*obslen as Bytes, crdate, modate&lt;BR /&gt;from dictionary.tables&lt;BR /&gt;where NOT(libname IN ('MAPS','MAPSGFK','MAPSSAS','SAMPSIO','SASHELP', 'STPSAMP', 'WORK'))&lt;BR /&gt;ORDER BY FileSize Desc;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE:&amp;nbsp; i run this&amp;nbsp;in a program a few times a day, and dump the output to SAS Visual Analytics so that i can kinda keep tabs on various users data storage tendencies.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 13:24:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-Libname-of-a-dataset/m-p/428353#M105762</guid>
      <dc:creator>utrocketeng</dc:creator>
      <dc:date>2018-01-17T13:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Libname of a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-Libname-of-a-dataset/m-p/428355#M105763</link>
      <description>&lt;P&gt;You can query sashelp.vtable:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sql;
   select LibName, MemName
      from sashelp.vtable
         where MemName = 'CLASS'
   ;
quit;&lt;/PRE&gt;
&lt;P&gt;The name of the Dataset must be in upcase.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 13:31:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-Libname-of-a-dataset/m-p/428355#M105763</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2018-01-17T13:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Libname of a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-Libname-of-a-dataset/m-p/428357#M105765</link>
      <description>&lt;P&gt;If you want to find the directory where dataset MYDATA is located, do this on UNIX:&lt;/P&gt;
&lt;PRE&gt;find / -name mydata.sas7bdat&lt;/PRE&gt;
&lt;P&gt;It's best to run this command as the superuser, because you'll get lots of messages about directories where you lack permissions otherwise.&lt;/P&gt;
&lt;P&gt;Now, if you have a defined base directory for all your libraries, you can start there:&lt;/P&gt;
&lt;PRE&gt;find /sasbase -name mydata.sas7bdat&lt;/PRE&gt;
&lt;P&gt;And you'll only need a userid that has read/execute permissions on all the subdirectories there.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 13:33:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-Libname-of-a-dataset/m-p/428357#M105765</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-01-17T13:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Libname of a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-Libname-of-a-dataset/m-p/428359#M105766</link>
      <description>&lt;P&gt;The problem with the dictionary.tables ( &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/6777"&gt;@utrocketeng&lt;/a&gt;) and sashelp.vtable ( &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15475"&gt;@andreas_lds&lt;/a&gt;) approaches is that they only work on currently assigned libraries. They won't find any .sas7bdat files in directories where you do not have an active libname on.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 13:37:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-Libname-of-a-dataset/m-p/428359#M105766</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-01-17T13:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Libname of a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-Libname-of-a-dataset/m-p/428387#M105774</link>
      <description>&lt;P&gt;The OP did say 'libraries' and not 'directories', so I think the solutions offered will work.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 14:51:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-Libname-of-a-dataset/m-p/428387#M105774</guid>
      <dc:creator>tomrvincent</dc:creator>
      <dc:date>2018-01-17T14:51:09Z</dc:date>
    </item>
  </channel>
</rss>

