“How do I list all of the SAS® Visual Analytics reports that use a particular SAS table?”
I was asked this question today and thought of at least 2 ways to answer it. The first is to build a query to use in the Metacoda Metadata Explorer Plug-in and the second is to use the SAS 9.4 Relationship Reporting tools. In this post I’ll show example for both techniques.
Metacoda Metadata Explorer Plug-in
The Metadata Explorer Plug-in is a free plug-in from Metacoda that is used to search for and browse SAS metadata within SAS Management Console. In addition to simple text-based searches, you can also use advanced XMLSELECT style queries. Finding SAS Visual Analytics reports that are associated with a specific SAS table requires these more advanced and expressive queries.
Here is the query we can use to find VA reports that use a named table:
{{{ Transformation[@PublicType='Report.BI'][CustomAssociations/CustomAssociation/AssociatedObjects/PhysicalTable[@Name='Source_Table']] }}}
Breaking down this query, we are looking for SAS Visual Analytics Reports (Transformation type objects with a PublicType attribute value of Report.BI that are associated (through the CustomAssociations association) with CustomAssociation objects and those CustomAssociation objects are in turn associated (through the AssociatedObjects association) with PhysicalTable objects that have the name Source_Table.
Pasting this query into the Metadata Explorer Plug-in generates a list of those VA reports that can then be exported to a CSV file.
For more information on the Metadata Explorer Plug-in see the following resources:
- Product page: Metacoda Metadata Explorer Plug-in
- Blog post: Metacoda’s Metadata Explorer Plug-in
- Blog post: Finding Private User Folders for Deleted SAS Platform Users
- XMLSELECT section in the SAS 9.4 Open Metadata Interface documentation
SAS 9.4 Relationship Reporting Tool
The second method uses the standard SAS 9.4 Relationship Reporting Tools that are used to query and report on the dependency relationships between SAS metadata objects. This is useful for lineage or impact analysis.
First you have to make sure the relationships database is up to date with a command like this:
/opt/sasva73/sashome/SASPlatformObjectFramework/9.4/tools/admin/sas-relationship-loader -host sasva73lnx01 -port 7980 -user sasadm@saspw -password mypass -loadAll
Then you can generate a list of VA reports that depend upon a specific table using a command like so:
/opt/sasva73/sashome/SASPlatformObjectFramework/9.4/tools/sas-relationship-reporter -host sasva73lnx01 -port 7980 -user sasadm@saspw -password mypass -report impact -folder "/Shared Data/SAS Visual Analytics/Public/LASR" -name "Source_Table" -types Table -rel {-depth 1} -relContent {-types "Report.BI"}
Breaking this command down, we are generating an impact report (listing other objects that depend upon or require the specified object) for a table (-types Table) named ‘Source_Table’ (-name) located in the folder “/Shared Data/SAS Visual Analytics/Public/LASR” (-folder). We only want to show direct dependants (-rel {-depth 1}) that are VA reports (-relContent {-types “Report.BI”}).
The output will look something like this:
"/Shared Data/SAS Visual Analytics/Public/LASR/Source_Table" (Table) Impacts: "/Vegas Enterprises/Director Reports/Source Table Report" (Report.BI)
For more information on the SAS 9.4 Relationship Reporting Tools see the following resources:
- Gerry Nelson’s blog post: Relationships are easy – for SAS objects!
- Using the Batch Relationship Reporting Tools section in the SAS 9.4 Intelligence Platform: System Administration Guide
I hope you’ve found one or both of these methods useful. If you have any comments, or know of any other ways of finding VA reports that depend upon a table, please post a comment below.
Paul
Thanks for another great example on how use the XMLSELECT.
No problem Bruno! It’s nice to hear you found it useful.