<?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 WRS-Report (.srx) &amp;gt;&amp;gt; IMAP &amp;gt;&amp;gt;&amp;gt; Datasets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/WRS-Report-srx-gt-gt-IMAP-gt-gt-gt-Datasets/m-p/844292#M333783</link>
    <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;
&lt;P&gt;programmatically, I am trying to create an overview as of which dataset(s) is/are the basis for a given IMAP, and in turn, which IMAP(s) is/are the basis for a given Web Report Studio Report (*.srx).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So far, I only found this:&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Web-Report-Studio/list-all-srx-reports-in-a-sas-9-4-ebi-install/m-p/394874#M2402" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SAS-Web-Report-Studio/list-all-srx-reports-in-a-sas-9-4-ebi-install/m-p/394874#M2402&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;But I cannot really work with the xml, do I ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does anyone have a sample code using the "metadata_" functions of SAS Base?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Nov 2022 07:45:55 GMT</pubDate>
    <dc:creator>FK1</dc:creator>
    <dc:date>2022-11-15T07:45:55Z</dc:date>
    <item>
      <title>WRS-Report (.srx) &gt;&gt; IMAP &gt;&gt;&gt; Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WRS-Report-srx-gt-gt-IMAP-gt-gt-gt-Datasets/m-p/844292#M333783</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;
&lt;P&gt;programmatically, I am trying to create an overview as of which dataset(s) is/are the basis for a given IMAP, and in turn, which IMAP(s) is/are the basis for a given Web Report Studio Report (*.srx).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So far, I only found this:&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Web-Report-Studio/list-all-srx-reports-in-a-sas-9-4-ebi-install/m-p/394874#M2402" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SAS-Web-Report-Studio/list-all-srx-reports-in-a-sas-9-4-ebi-install/m-p/394874#M2402&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;But I cannot really work with the xml, do I ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does anyone have a sample code using the "metadata_" functions of SAS Base?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 07:45:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WRS-Report-srx-gt-gt-IMAP-gt-gt-gt-Datasets/m-p/844292#M333783</guid>
      <dc:creator>FK1</dc:creator>
      <dc:date>2022-11-15T07:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: WRS-Report (.srx) &gt;&gt; IMAP &gt;&gt;&gt; Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WRS-Report-srx-gt-gt-IMAP-gt-gt-gt-Datasets/m-p/844293#M333784</link>
      <description>&lt;P&gt;Have you tried reading the xml file with a libname statement? If this won't work, you could use metadata_getnobj together with other metadata-function in a data step. Unfortunately i don't have any code processing the reports.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 07:46:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WRS-Report-srx-gt-gt-IMAP-gt-gt-gt-Datasets/m-p/844293#M333784</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-11-15T07:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: WRS-Report (.srx) &gt;&gt; IMAP &gt;&gt;&gt; Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WRS-Report-srx-gt-gt-IMAP-gt-gt-gt-Datasets/m-p/844296#M333786</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15475"&gt;@andreas_lds&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I seem to have the wrong xml-object, since I do not get any results returned. This is, what I have, so far:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Liste der verfügbaren Reports */
data work._md_reports (keep=report_id report_name report_metadatenpfad report_type);

FORMAT report_id report_name report_metadatenpfad report_type	 ;

	length 
        type id report_uri turi_id parenttree_id $50. 
        report_name folder pfolder path report_metadatenpfad  report_type $255. 
        report_id $17.
    ;

	call missing(of _character_);


    report_obj="omsobj:SASReport?[@PublicType='Report']";     /* "*[@PublicType='Report']" */
	report_count=metadata_resolve(report_obj,type,id);

	if report_count ge 1 then do i=1 to report_count;
		rc=metadata_getnobj(report_obj,i,report_uri);
		rc=metadata_getattr(report_uri,"Name",report_name);
		rc=metadata_getattr(report_uri,"Id",report_id);
        rc=metadata_getattr(report_uri,"PublicType",report_type);

        rc=metadata_getnasn(report_uri,"Trees",1,turi_id);
        rc=metadata_getattr(turi_id,"Name",folder);

        path=folder;

    	parent_rc=metadata_getnasn(turi_id,"ParentTree",1,parenttree_id); /* Determine if the metadata folder is top-level */

    	if parent_rc &amp;gt; 0 then do while (parent_rc &amp;gt; 0); /* If not, this loop assembles the metadata path, as these are nested "Tree" objects. */
    		rc=metadata_getattr(parenttree_id,"Name",pfolder);
    		path=cats(pfolder,"\",path);
    		parent_rc=metadata_getnasn(parenttree_id,"ParentTree",1,parenttree_id);
    	end;


        report_metadatenpfad=cats("\", path);

		output;
	end;

label 
        report_name           = "Name des Reports."
        report_id             = "URI des Reports."
        report_metadatenpfad  = "Speicherort im Metadatenbaum."
        report_type           = "Ausprägung der Eigenschaft 'Type' des Report-Objektes."


;

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Nov 2022 08:12:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WRS-Report-srx-gt-gt-IMAP-gt-gt-gt-Datasets/m-p/844296#M333786</guid>
      <dc:creator>FK1</dc:creator>
      <dc:date>2022-11-15T08:12:54Z</dc:date>
    </item>
  </channel>
</rss>

