BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ornulfth
Calcite | Level 5

Background:

I have made a "metadata solution" that serves some main areas/needs in our organization

1. Give business analyst and data scientists etc. overview and fast access to all data and visualisation on our Viya solution

2. show relationship(data lineage) from visualisation(reports/analysis) to CAS tables, Users and data elements(columns) 

3. Keep track of report usage, table/files usage and table usage and column changes on cas tables.  

4. To be continued....

 

https://developer.sas.com/apis/rest/Visualization/

The solution uses the rest API and some other SAS function to collect this data a I have built a visual analytics dashboard/report with search option for all metadata elements. To get control over all our business data and insight is something we have been looking for many years now. Finally we are getting somewhere with this problem. I believe many organisations have the same issue.

 

Question: I am trying to find the report summary/description element in the rest api and data columns that are in use in a report. Has anyone looked into this?

I can list out all kinds of details about a report, graphs, tables, calculated elements, sections, columns available(in datasource) etc. but not summary text or used columns...

Get report content metadata:

PROC HTTP clear_cache METHOD = "GET" oauth_bearer=sas_services OUT = rcontent
URL = "&BASE_URI/reports/reports/&id/content";
HEADERS "Accept" = "application/vnd.sas.report.content+json";
RUN;

The rcontent libname have n number of tables with all kinds of report metadata but still haven´t found what I´m looking for:-)

 

Search for anything.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
joeFurbee
Community Manager

Hi @ornulfth

I played around with a basic report I created and was able to locate a few things you may find of interest. Using the 'content' endpoint: /reports/reports/&reportid/content returns an XML file. In the file I see the report summary in the <TextTemplates> section:

<TextTemplates>
    <TextTemplate type="detail">
        <TemplateDefinition>
            <![CDATA[This report lists the average salary of position players in MLB during the 2008 season.]]>
        </TemplateDefinition>
    </TextTemplate>
</TextTemplates>

In the <BusinessItems> element, I see the columns used in the report used in the Category, Measure, or Group section:

            <BusinessItems>
                <RelationalDataItem name="bi150" base="bi103"/>
                <RelationalDataItem name="bi152" base="bi122"/>
            </BusinessItems>

The "base" parameter corresponds to the DataItem name parameter in the <BusinessItemFolder> section of the <DataSources> element:

    <DataSources>
        <DataSource label="MLB2008" type="relational" name="ds7">
            <CasResource server="cas-shared-default" library="CASUSER(jofurb)" table="MLB2008" locale="en_US"/>
            <BusinessItemFolder>
                <DataItem name="bi103" xref="POS" usage="categorical"/>
                <DataItem name="bi122" label="Average SALARY" xref="SALARY" aggregation="average"/>
                <DataItem name="bi10" xref="3B"/>......

Is that the metadata your searching for? If so, could you parse those values out of the XML? 

 


Join us for SAS Community Trivia
SAS Bowl XXXVIII, SAS Programming: Getting Started
Wednesday, February 14, 2024, at 10 a.m. ET | #SASBowl

View solution in original post

2 REPLIES 2
joeFurbee
Community Manager

Hi @ornulfth

I played around with a basic report I created and was able to locate a few things you may find of interest. Using the 'content' endpoint: /reports/reports/&reportid/content returns an XML file. In the file I see the report summary in the <TextTemplates> section:

<TextTemplates>
    <TextTemplate type="detail">
        <TemplateDefinition>
            <![CDATA[This report lists the average salary of position players in MLB during the 2008 season.]]>
        </TemplateDefinition>
    </TextTemplate>
</TextTemplates>

In the <BusinessItems> element, I see the columns used in the report used in the Category, Measure, or Group section:

            <BusinessItems>
                <RelationalDataItem name="bi150" base="bi103"/>
                <RelationalDataItem name="bi152" base="bi122"/>
            </BusinessItems>

The "base" parameter corresponds to the DataItem name parameter in the <BusinessItemFolder> section of the <DataSources> element:

    <DataSources>
        <DataSource label="MLB2008" type="relational" name="ds7">
            <CasResource server="cas-shared-default" library="CASUSER(jofurb)" table="MLB2008" locale="en_US"/>
            <BusinessItemFolder>
                <DataItem name="bi103" xref="POS" usage="categorical"/>
                <DataItem name="bi122" label="Average SALARY" xref="SALARY" aggregation="average"/>
                <DataItem name="bi10" xref="3B"/>......

Is that the metadata your searching for? If so, could you parse those values out of the XML? 

 


Join us for SAS Community Trivia
SAS Bowl XXXVIII, SAS Programming: Getting Started
Wednesday, February 14, 2024, at 10 a.m. ET | #SASBowl

ornulfth
Calcite | Level 5

Hi!  Thanks, this was spot on!!! I found it in the table TEXTTEMPLATES_TEMPLATEDEFINITI in the value column:-)

 

Thanks again!!!😀

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 858 views
  • 1 like
  • 2 in conversation