<?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: SAS program to remove metadata registration of all unloaded tables from multiple LASR libraries. in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/SAS-program-to-remove-metadata-registration-of-all-unloaded/m-p/469283#M13369</link>
    <description>&lt;P&gt;Hi Sergie,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I would use a data step to find all the appropriate Libraries and add them to a set of macro variables and then loop thru them. Here is a very rough draft of the code (I'm sorry if I made any typo, I don't have a mean to run it at the moment):&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%MACRO LASRLibs;

  data _null_;
  
    length uri $60. name $60.;

    count = metadata_getnobj("OMSOBJ:SASLibrary@?Name contains 'LASR'", 1, uri);
    do i = 1 to count;
      rc = metadata_getnobj("OMSOBJ:SASLibrary@?Name contains 'LASR'", i, uri);
      rc = metadata_getattr(uri, 'Name', name);
      call symputx(cats('LIBRARY_', i), name);
      call symputx('LIBRARY_COUNT', i);
    end;
  run;

  %DO I = 1 %TO &amp;amp;LIBRARY_COUNT.;
    proc metalib;
       omr (LIBRARY="&amp;amp;&amp;amp;LIBRARY_&amp;amp;I..");
       update_rule = (delete noadd noupdate);
       report = ( type=summary );
       /*noexec;*/
    run;
  %END;
%MEND;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 11 Jun 2018 15:24:04 GMT</pubDate>
    <dc:creator>ybolduc</dc:creator>
    <dc:date>2018-06-11T15:24:04Z</dc:date>
    <item>
      <title>SAS program to remove metadata registration of all unloaded tables from multiple LASR libraries.</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/SAS-program-to-remove-metadata-registration-of-all-unloaded/m-p/468309#M13351</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are using the SAS code below to remove metadata registration of tables which are unloaded from the LASR server.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc metalib;
   omr (LIBRARY="Visual Analytics Public LASR");
   update_rule = (delete noadd noupdate);
   report = ( type=summary );
   /*noexec;*/
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However we are using more than 10+ LASR libraries for different departments. So we want to create a SAS program that checks all LASR libraries automatically and remove the metadata registration of unloaded tables from different LASR libraries.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there an effecient way to perform this action ? We won't copy past the code above each time when we create a new LASR library.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 10:56:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/SAS-program-to-remove-metadata-registration-of-all-unloaded/m-p/468309#M13351</guid>
      <dc:creator>sergie89</dc:creator>
      <dc:date>2018-06-07T10:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: SAS program to remove metadata registration of all unloaded tables from multiple LASR libraries.</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/SAS-program-to-remove-metadata-registration-of-all-unloaded/m-p/469283#M13369</link>
      <description>&lt;P&gt;Hi Sergie,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I would use a data step to find all the appropriate Libraries and add them to a set of macro variables and then loop thru them. Here is a very rough draft of the code (I'm sorry if I made any typo, I don't have a mean to run it at the moment):&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%MACRO LASRLibs;

  data _null_;
  
    length uri $60. name $60.;

    count = metadata_getnobj("OMSOBJ:SASLibrary@?Name contains 'LASR'", 1, uri);
    do i = 1 to count;
      rc = metadata_getnobj("OMSOBJ:SASLibrary@?Name contains 'LASR'", i, uri);
      rc = metadata_getattr(uri, 'Name', name);
      call symputx(cats('LIBRARY_', i), name);
      call symputx('LIBRARY_COUNT', i);
    end;
  run;

  %DO I = 1 %TO &amp;amp;LIBRARY_COUNT.;
    proc metalib;
       omr (LIBRARY="&amp;amp;&amp;amp;LIBRARY_&amp;amp;I..");
       update_rule = (delete noadd noupdate);
       report = ( type=summary );
       /*noexec;*/
    run;
  %END;
%MEND;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Jun 2018 15:24:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/SAS-program-to-remove-metadata-registration-of-all-unloaded/m-p/469283#M13369</guid>
      <dc:creator>ybolduc</dc:creator>
      <dc:date>2018-06-11T15:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: SAS program to remove metadata registration of all unloaded tables from multiple LASR libraries.</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/SAS-program-to-remove-metadata-registration-of-all-unloaded/m-p/469285#M13370</link>
      <description>&lt;P&gt;Hi Sergie89,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I would do this using a data step to find out all the libraries and them populate a list of macvars. I would then look thru that list of macvars invoking the proc metalib for each of them. Here is a quick draft of what it would look like (please note, I don't have the opportunity to test the code at the moment so it may not run AS IS but should be pretty close to it):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%MACRO LASRLibs;

  data _null_;
  
    length uri $60. name $60.;

    count = metadata_getnobj("OMSOBJ:SASLibrary@?Name contains 'LASR'", 1, uri);
    do i = 1 to count;
      rc = metadata_getnobj("OMSOBJ:SASLibrary@?Name contains 'LASR'", i, uri);
      rc = metadata_getattr(uri, 'Name', name);
      call symputx(cats('LIBRARY_', i), name);
      call symputx('LIBRARY_COUNT', i);
    end;
  run;

  %DO I = 1 %TO &amp;amp;LIBRARY_COUNT.;
    proc metalib;
       omr (LIBRARY="&amp;amp;&amp;amp;LIBRARY_&amp;amp;I..");
       update_rule = (delete noadd noupdate);
       report = ( type=summary );
       /*noexec;*/
    run;
  %END;
%MEND;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Jun 2018 15:27:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/SAS-program-to-remove-metadata-registration-of-all-unloaded/m-p/469285#M13370</guid>
      <dc:creator>ybolduc</dc:creator>
      <dc:date>2018-06-11T15:27:58Z</dc:date>
    </item>
  </channel>
</rss>

