In SAS Viya 3.4 as an Administrator, you can add a customized Quality Knowledge Base (QKB) to your installation. In SAS Viya, you can use the QKB to perform data quality operations (e.g., parse and standardize) on your data either in SAS Data Studio or using code in SAS Studio. As part of these data quality operations, you may want to use some custom rules and logic which means you need to customize the QKB definitions.
For more information on SAS Data Quality in SAS Viya, refer to its documentation.
The high-level steps to add a customized QKB in SAS Viya are:
A QKB must be in the QARC (QKB Archive) format to be imported to a CAS Server in SAS Viya. As part of the SAS Data Quality or SAS Data Preparation offering a command-line tool is provided to convert your QKB to this format. The tool is located on your CAS Controller at: /opt/sas/viya/home/SASFoundation/utilities/bin/. In my installation, the CAS Controller is located on server sascas01.
Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.
To create a QARC file, locate the directory of your customized QKB.
Once you have located the directory that contains your customized QKB, then copy the directory and all of its contents to a location where the CAS Controller has access to it. For my installation, the CAS Controller is located on server sascas01 and I have copied the customized QKB directory and its contents to /home/maquee/CI29_qkb1_customized.
Now that I have copied the customized QKB to location which the CAS Controller can access, the next step is to create the QARC file for the customized QKB. To do this, you need to issue the following commands on your CAS Controller:
cd /opt/sas/viya/home/SASFoundation/utilities/bin/
Note: The first command changes the directory to the location of the QARC tool on the CAS Controller and the second command creates the QARC file.
Below are the commands I issued on my CAS Controller (sascas01), to create the CI29_qkb1_customized.qarc file in the /home/maquee/ directory on the CAS Controller.
cd /opt/sas/viya/home/SASFoundation/utilities/bin/
Note: It will take several minutes to create the QARC file.
Note: In order to import the QKB file using the user interface, you must copy the QARC file to a location accessible from your local machine. In my case, I have copied the QARC file I created in the previous section to my C:\ drive in the CI29_QKB_Customized folder.
Next, log on to SAS Environment Manager as an Administrator to the Viya installation where you want to add the customized QKB. You must have SAS Administrator privileges in order to import a QKB QARC file into SAS Viya. When signing in, select Yes to assume the group SASAdministrators, so you have the appropriate privileges.
Once you are signed into to SAS Environment Manager, then select the Quality Knowledge Bases tab.
To import a QARC file, select and navigate to where the QARC file for the customized QKB is located by using the Browse button.
Enter the target name and location for the QKB. Select Import to import the file.
Note: It will take several minutes to import the QARC file.
Once the import is complete, confirm that the imported QKB is now listed.
Note: Only the default QKB can be used in SAS Data Studio. In a future article, I will discuss how to use a non-default QKB in SAS Studio.
After importing the QKB, if you want to designate the newly imported QKB as the default QKB for your CAS server, then add (or change) the following lines at the end of the casconfig_usermods.lua file located at /opt/sas/viya/config/etc/cas/default/ and then restart the CAS Controller.
cas.dqSetupLoc="DefaultQKBName"
Note: The DefaultQKBName must match the name found on the Quality Knowledge Bases tab on SAS Environment Manager. The DefaultLocale is the 5-character QKB locale abbreviation. For example, ENUSA = English-United States and ESESP = Spanish-Spain.
Below is my modified casconfig_usermods.lua file to set my imported Customized QKB as the new default QKB.
After editing this file, I restart my CAS Controller for the change to take effect by issuing the following command:
Note: It may take a few minutes for the CAS Controller to restart.
Finally, I return to the Quality Knowledge Bases tab in SAS Environment Manager and refresh the display to confirm that the Customized QKB is now set as the default QKB.
Refer to the QKB Management section in the SAS Viya 3.4: Administration guide for more information.
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!
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.