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:
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.
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.
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.
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.
The DQ - Create QKB Reference Tables custom step is located here. Select to download the .step file.
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.
Open the custom step in its own tab.
Enter the desired name for the SAS Library and select the SAS Server path you created for the output tables.
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.
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.
In the Contents area enter the following:
/* Custom QKB Reference Tables */
libname SASDQREF "/qkb/reference/path" ;
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.
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.
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.
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.
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!
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.