<?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 Function to determine type of library member in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Function-to-determine-type-of-library-member/m-p/257302#M49371</link>
    <description>&lt;P&gt;Is there a function to&amp;nbsp;determine the type of a library member? I don't want to use dictionary tables (this information is in sashelp.vmember) but instead want to use (if possible) a funtion. For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;type = function('work.sasmacr');&lt;/P&gt;&lt;P&gt;put type=;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;would print 'CATALOG' &amp;nbsp;to the log.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Mar 2016 14:12:23 GMT</pubDate>
    <dc:creator>Roland_N</dc:creator>
    <dc:date>2016-03-17T14:12:23Z</dc:date>
    <item>
      <title>Function to determine type of library member</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-to-determine-type-of-library-member/m-p/257302#M49371</link>
      <description>&lt;P&gt;Is there a function to&amp;nbsp;determine the type of a library member? I don't want to use dictionary tables (this information is in sashelp.vmember) but instead want to use (if possible) a funtion. For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;type = function('work.sasmacr');&lt;/P&gt;&lt;P&gt;put type=;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;would print 'CATALOG' &amp;nbsp;to the log.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2016 14:12:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-to-determine-type-of-library-member/m-p/257302#M49371</guid>
      <dc:creator>Roland_N</dc:creator>
      <dc:date>2016-03-17T14:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: Function to determine type of library member</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-to-determine-type-of-library-member/m-p/257304#M49372</link>
      <description>&lt;P&gt;There isn't a function for this, why would you need one, there is only datasets and catalogs? &amp;nbsp;Use the metadata libraries to ascertain these, why not?&lt;/P&gt;
&lt;PRE&gt;data _null_;
  set sashelp.vmember (where=(libname="SASHELP" and MEMNAME="AC"));
  put memtype;
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Mar 2016 14:25:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-to-determine-type-of-library-member/m-p/257304#M49372</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-03-17T14:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: Function to determine type of library member</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-to-determine-type-of-library-member/m-p/257309#M49374</link>
      <description>&lt;P&gt;No, not in the function list.&lt;/P&gt;
&lt;P&gt;Please state why you don't wish to use system tables.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2016 14:34:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-to-determine-type-of-library-member/m-p/257309#M49374</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-03-17T14:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: Function to determine type of library member</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-to-determine-type-of-library-member/m-p/257341#M49379</link>
      <description>&lt;P&gt;Using SCL I want to delete all member from the work library. This is my program:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;init:&lt;BR /&gt;dcl sashelp.classes.sasfilelist_c.class memobj;&lt;BR /&gt;dcl num rc i memcount;&lt;BR /&gt;dcl char member;&lt;BR /&gt;&lt;BR /&gt;memobj = _new_ sashelp.classes.sasfilelist_c();&lt;BR /&gt;memobj.library = 'work';&lt;BR /&gt;memcount = memobj._count();&lt;BR /&gt;do i = 1 to memcount;&lt;BR /&gt;member= memobj._getItem(i);&lt;BR /&gt;rc = delete(member);&lt;BR /&gt;end;&lt;BR /&gt;&lt;BR /&gt;memobj._term();&lt;BR /&gt;return;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this will only&amp;nbsp;delete data sets because the 'delete'-function takes as second argument the member type (default is data set). So I need to know the member type to pass to the delete statement in order to delete all members.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I could do this in a submit-block using proc datasets but I don't want anything to appear in the log or log buffer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By the way in response to RW9: there are more types than only data and catalog, for example view, mddb etc.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2016 15:49:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-to-determine-type-of-library-member/m-p/257341#M49379</guid>
      <dc:creator>Roland_N</dc:creator>
      <dc:date>2016-03-17T15:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: Function to determine type of library member</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-to-determine-type-of-library-member/m-p/257348#M49386</link>
      <description>&lt;P&gt;Ah, so your using SAS/AF. &amp;nbsp;I am afraid I haven't used that in many years, hadn't thought anyone was still using it. &amp;nbsp;I would suggest your best bet is still to do this in SAS code. &amp;nbsp;Best of luck. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2016 16:22:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-to-determine-type-of-library-member/m-p/257348#M49386</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-03-17T16:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Function to determine type of library member</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-to-determine-type-of-library-member/m-p/257413#M49417</link>
      <description>&lt;P&gt;You could use the EXIST function on each member name. By default this checks for datasets. If it returns a 0 return code then you can assume that the member type is not DATA so you could then try EXIST for the member type CATALOG. It's a bit clunky but should work.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2016 18:51:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-to-determine-type-of-library-member/m-p/257413#M49417</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-03-17T18:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: Function to determine type of library member</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-to-determine-type-of-library-member/m-p/257427#M49423</link>
      <description>If it's important not to use submitted Sas code, you could browse sashelp.vmember by function calls. Very awkward IMO but should meet your requirements.</description>
      <pubDate>Thu, 17 Mar 2016 19:37:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-to-determine-type-of-library-member/m-p/257427#M49423</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-03-17T19:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: Function to determine type of library member</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-to-determine-type-of-library-member/m-p/257491#M49448</link>
      <description>&lt;P&gt;Or Maybe you could use PROC FCMP + dictionary table to build such function .&lt;/P&gt;</description>
      <pubDate>Fri, 18 Mar 2016 01:56:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-to-determine-type-of-library-member/m-p/257491#M49448</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-03-18T01:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: Function to determine type of library member</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-to-determine-type-of-library-member/m-p/257525#M49454</link>
      <description>&lt;P&gt;If you want to hide your actions from the log, consider writing a shell script and calling that with call system or X.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Mar 2016 07:36:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-to-determine-type-of-library-member/m-p/257525#M49454</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-03-18T07:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: Function to determine type of library member</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-to-determine-type-of-library-member/m-p/257636#M49470</link>
      <description>&lt;P&gt;Yes, I probably have to use dictionary tables. I'll solve it that way in combination with Ksharp's suggestion and write my own funtion.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Mar 2016 14:52:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-to-determine-type-of-library-member/m-p/257636#M49470</guid>
      <dc:creator>Roland_N</dc:creator>
      <dc:date>2016-03-18T14:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: Function to determine type of library member</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-to-determine-type-of-library-member/m-p/257721#M49515</link>
      <description>&lt;P&gt;this page contains code for each of the existence functions&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sascommunity.org/wiki/Macro_Exist" target="_blank"&gt;http://www.sascommunity.org/wiki/Macro_Exist&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am still unclear how you are going to use this knowledge.&lt;/P&gt;&lt;P&gt;if you have a list of filename.ext of the files in a Windows folder,&lt;/P&gt;&lt;P&gt;then the extention tells you the type:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data&amp;amp;colon; .sasbdat&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;catalog: sasbcat&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ron Fehd&amp;nbsp; reuse maven&lt;/P&gt;</description>
      <pubDate>Fri, 18 Mar 2016 23:57:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-to-determine-type-of-library-member/m-p/257721#M49515</guid>
      <dc:creator>Ron_MacroMaven</dc:creator>
      <dc:date>2016-03-18T23:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: Function to determine type of library member</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-to-determine-type-of-library-member/m-p/257935#M49574</link>
      <description>&lt;P&gt;I am not interested in the existence, I know already the member exists. I want to know the type of a library member. As explained earlier I need that information because I want to delete member from SCL. And the scl delete function takes two arguments:&amp;nbsp;name (the name of member to delete) and type (the type of member to delete).&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2016 10:57:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-to-determine-type-of-library-member/m-p/257935#M49574</guid>
      <dc:creator>Roland_N</dc:creator>
      <dc:date>2016-03-21T10:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: Function to determine type of library member</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-to-determine-type-of-library-member/m-p/257936#M49575</link>
      <description>&lt;P&gt;If you have a variable MEMNAME with the name of the member then just loop over values of MEMTYPE in DATA, CATALOG, VIEW, ... and call the EXIST() function with MEMNAME and MEMTYPE until you find out what MEMTYPE to use for the call to the DELETE() function.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2016 11:34:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-to-determine-type-of-library-member/m-p/257936#M49575</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-03-21T11:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: Function to determine type of library member</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-to-determine-type-of-library-member/m-p/258007#M49615</link>
      <description>&lt;P&gt;That's not a very robust solution: what if SAS introduces a new type? Then you have to change the program to include the name of that new type. I prefer to use the dictionnary tables.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2016 16:49:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-to-determine-type-of-library-member/m-p/258007#M49615</guid>
      <dc:creator>Roland_N</dc:creator>
      <dc:date>2016-03-21T16:49:12Z</dc:date>
    </item>
  </channel>
</rss>

