Example: Data Step View of Web Reports in Metadata



This example provides data step code that will query the SAS Metadata and return a list of registered SAS Web Reports.  The code as-is will create a data step view in the work library, so each time it is accessed it will dynamically query the SAS Metadata.

How to use it

The data step code below assumes that the connection to your Metadata Server has already been configured using the following System Options:

If you are running this code via an IOM client (e.g. Enterprise Guide, DI Studio, etc.) then these options will already be set to the user you have logged into SAS with.  If you are running this code from Base SAS you will need to issue an OPTIONS statement to set them.
Because access to the SAS Metadata requires security authorisation, the list of Web Reports returned will be dependent on what the user specified in the METAUSER/METAPASS options can access.


WRS List



* Purpose: Create a dynamic view of Web Reports registered in Metadata
* Notes  : You must establish a Metadata connection prior to running
data work.wrslist(drop=_: label="Web Report Studio List") / view=work.wrslist;
  length id $17 _uri name description _modified _created location _location $256;
  length created modified 8;
  format created modified datetime.;
  label id="Metadata ID"
        name="Report Name"
        location="Folder Location"
        modified="Last Modified";
  call missing(id, _uri, name, description, _modified, _created, _location);
  do while(_n le _nobj);
    * Get folder object the current WRS is in *;
    * Get folder name the current WRS is in *;
    * Loop up the folder hierarchy *;
    do while (_tree>0);
      * Get the parent folder object *;
      if _tree > 0 then do;
        * If there was a parent folder, get the name *;
        * Construct the path *;
    end* Folder Hierachy *;
    location = '/'||location;
Sample files and code examples are provided by Scorpio Software Services "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that Scorpio Software Services shall not be liable for any damages whatsoever arising out of their use of this material.
Was this article helpful?
0 out of 0 found this helpful


Powered by Zendesk