<?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: Reading a metadata tree in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-metadata-tree/m-p/570121#M17469</link>
    <description>&lt;P&gt;Here you go:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
length id folder_uri job_uri member_uri uri $ 20
       type prop value $ 256;
length name _uri location _location $200;
call missing(name, _uri, location, _location, uri);
call missing(id, type, folder_uri, job_uri, member_uri, prop, value);
rc = metadata_pathobj(' ', '/DIP Data Management/5000 Processes/10 Raw Ingestion', 'Folder', type, _uri);
do n = 1 by 1 while(metadata_getnasn(_uri, 'Members', n, member_uri) &amp;gt; 0);
   put n= _uri= member_uri=;
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The output I get shows that it's&amp;nbsp;&lt;EM&gt;nearly&lt;/EM&gt; there - but not quite. I know the number of members, but the uri returned from &lt;EM&gt;getnasn&lt;/EM&gt; is the folder's one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; n=1 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
 n=2 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
 n=3 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
 n=4 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
 n=5 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
 n=6 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
 n=7 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
 n=8 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
 n=9 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
 n=10 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
 n=11 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
 n=12 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
 n=13 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
 n=14 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
 n=15 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
etc...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 30 Jun 2019 20:24:38 GMT</pubDate>
    <dc:creator>LaurieF</dc:creator>
    <dc:date>2019-06-30T20:24:38Z</dc:date>
    <item>
      <title>Reading a metadata tree</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-metadata-tree/m-p/569281#M17441</link>
      <description>&lt;P&gt;When we move from dev to test (and to prod), our Hadoop and CAS libraries and jobs have to be manually patched because the text strings contained within the library references frustratingly don't remap to the test properties and associations, like it would with a real DBMS. (Old man shouting at clouds)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The library bit is relatively easy, because I can read through all the&amp;nbsp;&lt;EM&gt;&lt;I&gt;&lt;FONT style="background-color: #ffffff;"&gt;"omsobj: SASLibrary?@Id contains '.'"&lt;/FONT&gt;&lt;/I&gt;&lt;/EM&gt;&lt;FONT style="background-color: #ffffff;"&gt; entries where the engine is&amp;nbsp;&lt;EM&gt;CAS, HADOOP&lt;/EM&gt; or&amp;nbsp;&lt;EM&gt;IMPALA&lt;/EM&gt;, then walk my way though the associated data and set the attributes and properties and patch them. The execution time is virtually instantaneous, and works well.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the jobs (and it's mainly the CAS ones that are causing me grief) are proving problematic. I have three or so metadata folders whose &lt;EM&gt;uri&lt;/EM&gt;s I can identify with&amp;nbsp;&lt;EM&gt;metadata_pathobj&lt;/EM&gt;. I can determine the number of members of each tree, using&amp;nbsp;&lt;EM&gt;metadata_getnasn&lt;/EM&gt; with&amp;nbsp;&lt;EM&gt;Members&lt;/EM&gt; as the association. In fact &lt;FONT style="background-color: #ffffff;"&gt;&lt;EM&gt;do n = 1 by 1&lt;/EM&gt; while(&lt;/FONT&gt;&lt;FONT style="background-color: #ffffff;"&gt;&lt;EM&gt;metadata_getnasn(_uri, 'Members', n, member_uri&lt;/EM&gt;&lt;/FONT&gt;&lt;EM&gt;) &amp;gt; 0)&lt;/EM&gt; loops the expected 20 times (for the particular folder I'm initially interested in. But nothing shows up in&amp;nbsp;&lt;EM&gt;member_uri&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What am I missing? Am I using the wrong association? How do I walk through a tree? (If you'll excuse the expression)&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 20:43:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-metadata-tree/m-p/569281#M17441</guid>
      <dc:creator>LaurieF</dc:creator>
      <dc:date>2019-06-26T20:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a metadata tree</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-metadata-tree/m-p/569370#M17448</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/17429"&gt;@LaurieF&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just as an opinion: You normally don't have that many metadata library definitions so setting up environment specific paths and eventually also configuration options is a one time task. I'm used to add such things to a migration instructions document.&lt;/P&gt;
&lt;P&gt;You don't have to change any jobs as these should be using the library definition from the environment they are linked to.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 09:33:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-metadata-tree/m-p/569370#M17448</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-06-27T09:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a metadata tree</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-metadata-tree/m-p/569671#M17458</link>
      <description>&lt;P&gt;I'm afraid you've missed the point. I was talking about how to read members in a tree.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The other problem, which I've already solved, was to show that I do know how to navigate my way through metadata functions. In that particular case we have 20-30 entries, and each one previously had to be updated every time we did a migration - the import function &lt;EM&gt;did not&lt;/EM&gt; update them to the correct values. This is beyond a manual process and has no part in a migration document.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 23:59:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-metadata-tree/m-p/569671#M17458</guid>
      <dc:creator>LaurieF</dc:creator>
      <dc:date>2019-06-27T23:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a metadata tree</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-metadata-tree/m-p/569705#M17460</link>
      <description>&lt;P&gt;Previously, to understand metadata tree I used Base SAS software "metadata browser" should be there in the menu. Hope this blog explains enough about that.&lt;/P&gt;&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sgf/2013/02/06/two-methods-for-editing-sas-metadata/" target="_blank"&gt;https://blogs.sas.com/content/sgf/2013/02/06/two-methods-for-editing-sas-metadata/&lt;/A&gt;&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>Fri, 28 Jun 2019 06:04:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-metadata-tree/m-p/569705#M17460</guid>
      <dc:creator>Rama_V</dc:creator>
      <dc:date>2019-06-28T06:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a metadata tree</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-metadata-tree/m-p/569925#M17463</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/17429"&gt;@LaurieF&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please post the code that is not working. I guess your problem might be that you have not declared a length for the &lt;EM&gt;member_uri&lt;/EM&gt; variable and initiated it to blank before the loop, but it is difficult to say without acces to the code.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2019 18:09:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-metadata-tree/m-p/569925#M17463</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2019-06-28T18:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a metadata tree</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-metadata-tree/m-p/570121#M17469</link>
      <description>&lt;P&gt;Here you go:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
length id folder_uri job_uri member_uri uri $ 20
       type prop value $ 256;
length name _uri location _location $200;
call missing(name, _uri, location, _location, uri);
call missing(id, type, folder_uri, job_uri, member_uri, prop, value);
rc = metadata_pathobj(' ', '/DIP Data Management/5000 Processes/10 Raw Ingestion', 'Folder', type, _uri);
do n = 1 by 1 while(metadata_getnasn(_uri, 'Members', n, member_uri) &amp;gt; 0);
   put n= _uri= member_uri=;
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The output I get shows that it's&amp;nbsp;&lt;EM&gt;nearly&lt;/EM&gt; there - but not quite. I know the number of members, but the uri returned from &lt;EM&gt;getnasn&lt;/EM&gt; is the folder's one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; n=1 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
 n=2 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
 n=3 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
 n=4 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
 n=5 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
 n=6 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
 n=7 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
 n=8 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
 n=9 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
 n=10 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
 n=11 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
 n=12 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
 n=13 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
 n=14 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
 n=15 _uri=A5IKCEC7.AA00008A member_uri=OMSOBJ:Job\A5IKCEC7.
etc...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Jun 2019 20:24:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-metadata-tree/m-p/570121#M17469</guid>
      <dc:creator>LaurieF</dc:creator>
      <dc:date>2019-06-30T20:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a metadata tree</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-metadata-tree/m-p/570122#M17470</link>
      <description>&lt;P&gt;Sadly I haven't been able to get Global Hosting to switch it on for me...&lt;/P&gt;</description>
      <pubDate>Sun, 30 Jun 2019 20:27:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-metadata-tree/m-p/570122#M17470</guid>
      <dc:creator>LaurieF</dc:creator>
      <dc:date>2019-06-30T20:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a metadata tree</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-metadata-tree/m-p/571194#M17513</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/17429"&gt;@LaurieF&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just in case you haven't resolved this yet:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your code works for me. You just need to increase the length for member_uri so the returned string doesn't get truncated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;EM&gt;but the uri returned from&amp;nbsp;getnasn&amp;nbsp;is the folder's one&lt;/EM&gt;"&lt;/P&gt;
&lt;P&gt;Look again at the log you've posted. That's only the repository ID. After that the string is truncated.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 09:39:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-metadata-tree/m-p/571194#M17513</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-07-04T09:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a metadata tree</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-metadata-tree/m-p/571199#M17516</link>
      <description>&lt;P&gt;Really? I'm an idiot! Thanks very much.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't wait to get to work tomorrow morning to try it out.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 09:51:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-metadata-tree/m-p/571199#M17516</guid>
      <dc:creator>LaurieF</dc:creator>
      <dc:date>2019-07-04T09:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a metadata tree</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-metadata-tree/m-p/571277#M17524</link>
      <description>&lt;P&gt;And it works - well spotted. I owe you a beer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, down to examining the stuff about each job. Seats upright, table stowed, ready to extend this metaphor too far...&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 19:53:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-metadata-tree/m-p/571277#M17524</guid>
      <dc:creator>LaurieF</dc:creator>
      <dc:date>2019-07-04T19:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a metadata tree</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-metadata-tree/m-p/636834#M19069</link>
      <description>&lt;P&gt;I added a macro to the &lt;A href="https://github.com/macropeople/macrocore" target="_blank" rel="noopener"&gt;macrocore&lt;/A&gt; library that performs this very function.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To execute:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* compile macro */
filename mc url "https://raw.githubusercontent.com/macropeople/macrocore/master/meta/mm_tree.sas";
%inc mc;

/* execute */
%mm_tree(root=/my/path, outds=iwantthisdataset)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Apr 2020 11:10:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Reading-a-metadata-tree/m-p/636834#M19069</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2020-04-02T11:10:33Z</dc:date>
    </item>
  </channel>
</rss>

