<?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: check if stored process exists in Metaserver folder in Developers</title>
    <link>https://communities.sas.com/t5/Developers/check-if-stored-process-exists-in-Metaserver-folder/m-p/144232#M4073</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm assuming you just want to scan a metadata folder to see whether or not it contains stored processes? The following example is more generic but creates a single table which lists all stored processes found in metadata (across all folders). You can adjust the code or simply filter for the folder you are after. As you mentioned the final list of reports is dependent on the permissions of the given user (if you are planning to run this as part of a Stored Process you don't need to have the meta* options):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13844915053153357" jivemacro_uid="_13844915053153357"&gt;
&lt;P&gt;options metaserver="localhost"&lt;BR /&gt; metaport=8561&lt;BR /&gt; metauser="&lt;A _jive_internal="true" href="https://communities.sas.com/mailto:sasadm@saspw"&gt;myuser&lt;/A&gt;"&lt;BR /&gt; metapass="mypass"&lt;BR /&gt; metarepository="Foundation";&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;data reports;&lt;BR /&gt; length label $200 path $500 tmp $500;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; length uri $256 asnuri $256;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; nobj=1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; n=1;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;keep label path;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do while(nobj &amp;gt;= 0);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nobj=metadata_getnobj("omsobj:ClassifierMap?@Id contains '.' and @PublicType eq 'StoredProcess'",n,uri);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rc=metadata_getattr(uri,"Name",label);&lt;BR /&gt;&amp;nbsp; rc=metadata_getnasn(uri,"Trees",1,asnuri);&lt;BR /&gt;&amp;nbsp; arc=metadata_getattr(asnuri,"Name",path);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; /* walk through all the trees on this ClassifierMap object. */&lt;BR /&gt;&amp;nbsp; rc = 1;&lt;BR /&gt;&amp;nbsp; do while(rc&amp;gt;0);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; rc=metadata_getnasn(asnuri,"ParentTree",1,asnuri);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arc=metadata_getattr(asnuri,"Name",tmp);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if (rc&amp;gt;0) then path = trim(tmp) || "/" || trim(path);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; /* building the stored process full qualified path*/&lt;BR /&gt;&amp;nbsp; path = "/" || trim(path) || "/" || trim(label) || "(StoredProcess)";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; n=n+1;&lt;BR /&gt;&amp;nbsp; output;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Nov 2013 04:59:02 GMT</pubDate>
    <dc:creator>FalkoSchulz</dc:creator>
    <dc:date>2013-11-15T04:59:02Z</dc:date>
    <item>
      <title>check if stored process exists in Metaserver folder</title>
      <link>https://communities.sas.com/t5/Developers/check-if-stored-process-exists-in-Metaserver-folder/m-p/144230#M4071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope that somebody can help me to find a solution for my problem. I hope it is not complicated but somehow I'm just not able to solve it:&lt;/P&gt;&lt;P&gt;There are some Reports that are created with stored processes and stored on metaserver under Reports -&amp;gt; Special&lt;/P&gt;&lt;P&gt;We have created the permission-concept that gives some users possibility to open this Folder, others don't even see that it exists.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I would like to create a link from one Stored Process to those but show then (links) only if the user can see the Folder.&lt;/P&gt;&lt;P&gt;there are many ways to open directory, count files, check if the file can be opened etc. However, the problem is that all examples are made on windows (local) server. I have a unix server and I don't know where those files are...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I haven't found a way to check if a folder or a directory or a file inside it exists using only meta-path.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there a way?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for sharing ideas.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Nov 2013 19:39:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/check-if-stored-process-exists-in-Metaserver-folder/m-p/144230#M4071</guid>
      <dc:creator>ajuvaba</dc:creator>
      <dc:date>2013-11-14T19:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: check if stored process exists in Metaserver folder</title>
      <link>https://communities.sas.com/t5/Developers/check-if-stored-process-exists-in-Metaserver-folder/m-p/144231#M4072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Reading your question it is a SAS-metadata question.&lt;/P&gt;&lt;P&gt;That has nothing to do with Windows or Unix Specifics although the word folder is used.&lt;/P&gt;&lt;P&gt;It is that more than one thing can share the same name. You are ajuvaba, is that name solely used for you? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not get the intention of your question, or what you ar trying to solve.&lt;/P&gt;&lt;P&gt;With normal usage the user only can select the thing he can see.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some idea for reporting:&lt;/P&gt;&lt;P&gt;Do A export metadata from the path with the user having limitation (creating a package).&lt;/P&gt;&lt;P&gt;Use the log of that process as it generates a listing of all it could see. &lt;/P&gt;&lt;P&gt;You could build it all yourself on low-level interfaces. &lt;A class="active_link" href="http://support.sas.com/documentation/cdl/en/omaref/64859/HTML/default/viewer.htm#n1olex64fe3kszn1cpudzy7jymy7.htm" title="http://support.sas.com/documentation/cdl/en/omaref/64859/HTML/default/viewer.htm#n1olex64fe3kszn1cpudzy7jymy7.htm"&gt;SAS(R) 9.4 Open Metadata Interface: Reference and Usage&lt;/A&gt;&lt;/P&gt;&lt;P&gt;or with datastep interface &lt;A href="http://support.sas.com/documentation/cdl/en/lrmeta/64857/HTML/default/viewer.htm#p1kjy5liyi86w8n1vfopazyeb70u.htm" title="http://support.sas.com/documentation/cdl/en/lrmeta/64857/HTML/default/viewer.htm#p1kjy5liyi86w8n1vfopazyeb70u.htm"&gt;SAS(R) 9.4 Language Interfaces to Metadata&lt;/A&gt; . I would classify this as to diificult.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Nov 2013 20:03:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/check-if-stored-process-exists-in-Metaserver-folder/m-p/144231#M4072</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2013-11-14T20:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: check if stored process exists in Metaserver folder</title>
      <link>https://communities.sas.com/t5/Developers/check-if-stored-process-exists-in-Metaserver-folder/m-p/144232#M4073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm assuming you just want to scan a metadata folder to see whether or not it contains stored processes? The following example is more generic but creates a single table which lists all stored processes found in metadata (across all folders). You can adjust the code or simply filter for the folder you are after. As you mentioned the final list of reports is dependent on the permissions of the given user (if you are planning to run this as part of a Stored Process you don't need to have the meta* options):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13844915053153357" jivemacro_uid="_13844915053153357"&gt;
&lt;P&gt;options metaserver="localhost"&lt;BR /&gt; metaport=8561&lt;BR /&gt; metauser="&lt;A _jive_internal="true" href="https://communities.sas.com/mailto:sasadm@saspw"&gt;myuser&lt;/A&gt;"&lt;BR /&gt; metapass="mypass"&lt;BR /&gt; metarepository="Foundation";&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;data reports;&lt;BR /&gt; length label $200 path $500 tmp $500;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; length uri $256 asnuri $256;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; nobj=1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; n=1;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;keep label path;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do while(nobj &amp;gt;= 0);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nobj=metadata_getnobj("omsobj:ClassifierMap?@Id contains '.' and @PublicType eq 'StoredProcess'",n,uri);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rc=metadata_getattr(uri,"Name",label);&lt;BR /&gt;&amp;nbsp; rc=metadata_getnasn(uri,"Trees",1,asnuri);&lt;BR /&gt;&amp;nbsp; arc=metadata_getattr(asnuri,"Name",path);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; /* walk through all the trees on this ClassifierMap object. */&lt;BR /&gt;&amp;nbsp; rc = 1;&lt;BR /&gt;&amp;nbsp; do while(rc&amp;gt;0);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; rc=metadata_getnasn(asnuri,"ParentTree",1,asnuri);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arc=metadata_getattr(asnuri,"Name",tmp);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if (rc&amp;gt;0) then path = trim(tmp) || "/" || trim(path);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; /* building the stored process full qualified path*/&lt;BR /&gt;&amp;nbsp; path = "/" || trim(path) || "/" || trim(label) || "(StoredProcess)";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; n=n+1;&lt;BR /&gt;&amp;nbsp; output;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Nov 2013 04:59:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/check-if-stored-process-exists-in-Metaserver-folder/m-p/144232#M4073</guid>
      <dc:creator>FalkoSchulz</dc:creator>
      <dc:date>2013-11-15T04:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: check if stored process exists in Metaserver folder</title>
      <link>https://communities.sas.com/t5/Developers/check-if-stored-process-exists-in-Metaserver-folder/m-p/144233#M4074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you very much for quick answers. the example code is exactly what I need. now I understand what I have to do - walk through the metadata. I already tried it and it gives me exactly what I need.&lt;/P&gt;&lt;P&gt;Fantastic.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Nov 2013 09:38:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/check-if-stored-process-exists-in-Metaserver-folder/m-p/144233#M4074</guid>
      <dc:creator>ajuvaba</dc:creator>
      <dc:date>2013-11-15T09:38:42Z</dc:date>
    </item>
  </channel>
</rss>

