BookmarkSubscribeRSS Feed

SAS Viya: Create SAS Quality Knowledge Base (QKB) Definition Reference Tables for Customized QKB

Started ‎10-20-2023 by
Modified ‎10-20-2023 by
Views 400

In a previous article, I demonstrated how you can use a SAS Quality Knowledge Base (QKB) reference table in a custom step. Those reference tables are based on an out-of-the-box QKB. What if you have a customized QKB? In this blog, I show how you can create the QKB definition reference tables for your customized QKB. Then, you could use those custom QKB reference tables in custom steps or in the SAS-delivered QKB steps (e.g., Match Codes).

 

  The high-level steps to create the data quality reference library for a customized QKB are:

  • Add the Customized QKB to SAS Compute as Default QKB
  • Create a Folder on the SAS Server for the Reference Tables
  • Run the DQ - Create QKB Reference Tables Custom Step
  • Add the Created QKB Reference Tables Location to SAS Studio AUTOEXEC


Add the Customized QKB to SAS Compute as Default QKB

The DQ - Create QKB Reference Tables custom step analyzes the default QKB in SAS Compute to create the QKB reference tables. Therefore, follow the steps in this article to set your customized QKB as the default for SAS Compute.  

 

Create a Folder on the SAS Server for the Reference Tables

Next, you need to create a folder on the SAS Server to save the output data sets for the QKB reference tables. In SAS Studio, on the Explorer tab, navigate to the SAS Server location where you want to create the folder. Right-click and select New folder. Note: You should be logged in as a SAS Administrator to perform this function.

 

1_QKBRef.jpg

Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.

 

Enter the name of the folder you want to create and select OK.

 

2_QKBRef-1.jpg

 

Make note of the location of the SAS Server folder; you will need it when you run the custom step to create the QKB reference tables.

 

3_QKBRef.jpg

 

Run the Create QKB Reference Tables Custom Step

The DQ - Create QKB Reference Tables custom step is located here. Select 1_icon_QKBRef.jpg  to download the .step file.

 

4_QKBRef.jpg

 

In SAS Studio log on as a SAS Administrator. Navigate to the Explorer tab, upload the DQ - Create QKB Reference Tables.step to a SAS Content folder.

5a_QKBRef.jpg

 

Open the custom step in its own tab.

 

5b_QKBRef.jpg

 

Enter the desired name for the SAS Library and select the SAS Server path you created for the output tables.

 

6_QKBRef.jpg

 

Run the custom step and view its results. The specified SAS library is created with the QKB reference tables for each of the definition types. In my customized QKB there is a parse definition at the English language level called Clothing and it has the tokens of: Department, Item, Color, and Size.

 

7_QKBRef.jpg

 

Add the Created QKB Reference Tables Location to SAS Studio AUTOEXEC

After running this custom step, you may want to consider adding libname SASDQREF "path-containing-your-QKB-Reference-Tables"; to your autoexec in SAS Studio or SAS Environment Manager. This results in the Data Quality steps that use the QKB to utilize your newly created reference tables. I am going to do this in SAS Environment Manager, so it is available for all SAS Studio users.

 

In SAS Environment Manager on the Configuration page, select Compute Service. Edit the sas.compute.server: autoexec_code section. Note: You should be logged in as a SAS Administrator to perform this function.

 

8_QKBRef.jpg

 

In the Contents area enter the following:

 

/* Custom QKB Reference Tables */
libname SASDQREF "/qkb/reference/path" ;

9_QKBRef-1.jpg

 

Log out of all SAS Compute sessions. Must re-open compute session for change to take effect. I sign-out and close my browser with Viya. I re-open and sign back into my Viya installation. The SASDQREF Library with my custom QKB reference files should now be listed anytime a new SAS Compute session is started.

 

10_QKBRef-1.jpg

 

Now, any steps that use the QKB (e.g., Match Codes) now reference my customized QKB reference tables. As shown in the screen shot below, the Match Codes step allows me to select my custom match code definition of Clothing.

 

11_QKBRef (1).jpg

 

Summary

The DQ - Create QKB Reference Tables custom step analyzes the default QKB in SAS Compute to create the QKB reference tables. You can then use these reference tables based on your customized QKB in the supplied QKB steps or in your own custom steps. For more information, please refer to this blog.

 

Acknowledgements

Thanks to Charles Norman, Brant Kay, and Nicolas Robert for their assistance with the Program code for this custom step.

 

Find more articles from SAS Global Enablement and Learning here.

Version history
Last update:
‎10-20-2023 08:17 AM
Updated by:
Contributors

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Tags