Have you ever needed to search for a report or a specific table but you could not find what you were looking for? Then this post is for you! To start, there are two types of searches that you can perform: a keyword search and a faceted search.
This is the search that you are probably most familiar with. You type in search terms freeform. For example, I might be looking for a report whose name contains the words forecast and solution. However, when I search for forecast solution, the results also display all reports containing either of those keywords. This is because the space (as well as the hyphen and underscore) separates keywords in a keyword search. The search submits each keyword as a separate, independent value:
It seems like the more search terms we enter in a keyword search, the more results we see. We have two options to narrow down the results:
Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.
When we enclose the search term in quotation marks, words separated by spaces are no longer treated as separate keywords. Therefore, the search only returns results matching the whole search term. Here, I find the exact report I am looking for.
The second option to reduce search results is to use the + (must) operator when performing a faceted search. More on this later.
If you only know part of a word that appears in a report name, you can always use a wildcard in your search. For example, let us pretend that I am bad with spelling and forget what the first two and last two letters in the word Forecast are. I search for *reca*:
Note that while these are examples of searching for a report, you can also perform a keyword search for data in the same way.
Sometimes, a simple keyword search might not narrow down the results enough. In this situation, we can resort to a faceted search. A faceted search does not just search the name of an asset, but also other metadata. In this example, I want to find a suitable data source for a new report I am building.
To follow along, create a new report and add data as shown below:
The search on the Choose Data window proposes some example facets. For the full documentation, click Help.
For example, imagine you are looking for a table containing a specific column: Customer ID. I can perform the following search: Column.name:"Customer ID"n. Note that Customer ID is the name of a column. As it contains a space, we need to reference it by using (single or double) quotation marks followed by an n. This is called a name literal.
Imagine I now need to narrow down the search more, looking for tables from a specific library, I can add another facet and search for column.name: "Customer ID"n library.name:VISUAL:
However, just like in the previous section, this returns results that match each condition independently. That is, all data from the VISUAL library and/or data with the Customer ID column. The same rules I covered in the keyword search section also apply here. Spaces, hyphens and underscores separate keywords and each keyword is searched separately. We can use (single or double) quotation marks to avoid this, and we can use wildcards.
In this situation, we can use the + (must) operator in front of every facet. Note this operator only works when prepended to a search facet. Therefore, we need to modify our search to the following: +column.name: "Customer ID"n +library.name:VISUAL
There are a huge number of facets you can search on, including date accessed, date modified or created, the privacy status of columns, the completeness (proportion of non-missing values), and more! See the documentation for a full overview.
I will now give another example for a faceted search, but to search for a report. I return to the situation from the first section, where I wanted to search for a report containing the words forecast and solution. I could perform the following faceted search: +Name: forecast +Name: solution. In this case, I prefer using the solution presented earlier, searching for "forecast solution" (with quotation marks).
It is possible to combine a keyword and faceted search. For example, if I wanted to search for tables containing Hurricane from the VISUAL library, I could write: hurricane +library.name:VISUAL
As mentioned, a faceted search on data searches the metadata of tables. Since SAS Viya does not feature a permanent metadata server as in SAS 9, the faceted search for data relies on a discovery agent crawling through SAS Viya and recording the metadata of all assets. This discovery agent needs to be set up and run periodically. This is something that the SAS Administrator is usually responsible for, but you can also create your own discovery agent. Here is a simplified guide on the steps to take. In the SAS Viya Applications Menu, click on Discover Information Assets:
Next, on the left pane, click on the Discovery Agent pane and select New at the top right. Configure your discovery agent to crawl through the relevant caslibs and then click on New Discovery Agent. For this example, I have selected Public.
Click on Configuration. To speed up the discovery agent, you can optionally add a filter to specify which assets the discovery agent should analyze.
Click on Analysis Options. If you are purely interested in searching for reports and data, you can set the Analysis mode to Basic metadata. The default Data profile also calculates summary statistics and data quality metrics for columns, which you can consult from Information Catalog. This can be extremely useful but can take some processing time depending on the size of your environment. For conducting faceted searches, basic metadata is more than enough.
Shows the Analysis options in the new Discovery Agent Configuration. Analysis mode: Basic metadata,
check: analyze unloaded table (optional). Click on Run now.
You can also tick the box Analyze unloaded tables. Tables in SAS Viya can be on disk (unloaded) or in-memory (loaded in memory). By ticking this box, you collect the basic metadata for both. Click on Run now. It is also possible to schedule to re-run this periodically. For more information on these steps, read the documentation.
As you can see with a bit of knowledge we can perform extremely powerful searches for reports and data. But it doesn't stop here. You can search for virtually any asset on SAS Viya using these methods and facets. Furthermore, with SAS Information Catalog, you can find detailed information on columns, including summary statistics, privacy information, data quality and much more! See the further reading section for material on this.
3 Steps to Catalog and Discover Analytic Assets with SAS Information Catalog
What is New in the SAS Information Catalog
Find more articles from SAS Global Enablement and Learning here.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.