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 XLIII, The New SAS Developer Portal
Wednesday, August 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 XLIII, The New SAS Developer Portal
Wednesday, August 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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1035 views
  • 1 like
  • 2 in conversation