Are you thinking about migrating your environment over to SAS Viya but don’t know if your current architecture will be supported? Luckily, with the help of the SAS 9 Content Assessment Tool, we can help to alleviate some of those worries.
If you look at our documentation on the SAS 9 Content Assessment Tool, you’ll see that there is a fairly large amount of information to parse through. However, each section is designed to cover a different application within the SAS 9 Content Assessment Tool to help assist in your transition. Before diving in and running all the applications, first ask yourself a few questions:
- What is your goal with using the SAS 9 Content Assessment Tool?
- Are you simply wanting to count (inventory) what is in your environment?
- Do you want a more detailed explanation (profile) about the items that exist in your deployment?
- Are you wanting to know if your current SAS code will transition (code check) correctly to SAS Viya?
These are all important questions to consider before choosing which application to run and for what purpose. In this guide, I will show you an average use case for running the SAS 9 Content Assessment Tool and how we will check if our environment is Viya-ready.
Download and unpack the tool
Before we can access SAS Content Assessment, we will first need to download and unpack the tool itself. The latest download available at the time of this article is version 2021.1.2 and can be downloaded from the SAS 9 Content Assessment 2021.1.3 support site.
We will be downloading the Linux version for our purposes:
You will then want to unpack the tar file using the Linux command below:
tar zxvf /SAS9ContentAssessment/SAS9ContentAssessment.2021.1.2.lax.tgz
The resulting unpacked files should produce the “assessment” and “migration” files:
Now that we have successfully unpacked the Content Assessment tool, we can proceed to modifying the setenv.yaml and metaparms.sas files for configuration.
Set up the configuration
We’ll start by specifying specific configuration information necessary to run the Content Assessment tool successfully. Let’s modify the setenv.yaml file first:
We are required to set explicit values for each key-value pair that is denoted with an asterisk. However, both the SAS_CATALOGSDIR and ENTERPRISE_GUIDE_PROJECTSDIR only need values specified if you intend to gather this content. This means, for this example, we will be setting values for:
We have modified the file in our text editor of choice Notepad++:
*We do not have any SAS Enterprise Guide projects to gather for this particular example so we will leave this field blank.
*Same for this one
Once you have set these values, you can Save and Close the file and proceed to editing metaparms.sas.
In this file, specific values must be defined. These values are written in italics:
In this case, we will be specifying additional values to help distinguish which host machines we are running the Content Assessment Tool on:
Once you have set these values, you can Save and Close the file.
Task #1: Inventory Content
Now that we have filled in the required values for the configuration files, we can begin with running the applications within SAS Content Assessment Tool. We will first begin with running Inventory Content. In summary, Inventory Content performs the following:
- It determines what licensed products are installed.
- It examines the SAS Deployment Registry for various actions and items.
- It enumerates all file system content.
- It enumerates SAS metadata, such as:
- SAS metadata objects contained in SAS folders
- SAS server and SAS application server contexts
- ACTs and ACEs
We will go ahead and run Inventory Content by navigating to our unpacked tool directory:
Then we will run the script:
[sas@trcv037 assessment]$ ./inventoryContent
Running the script should show multiple check like that below:
Now that Inventory Content has completed, it should have products 3 different datasets:
We can confirm this by navigating to the path for inventory as defined in the setenv.yaml file: ASSESSMENT_DATAMARTDIR/inventory/METADATALABEL.
We have completed the Inventory Content task.
Task #2: Profile Content
Running the Profile Content application will allow us profile SAS objects and SAS content. To run the Profile Content application, you will need to navigate to the unpacked tool directory and issue the command:
The process will look similar to:
Note: If you are running a version of SAS earlier than 9.4 M3, you will need to run the Relationship Loader by adding the command option --load-relationships
This will produce multiple SAS datasets in the output defined for ASSESSMENT_DATAMARTDIR/profile/METADATALABEL.
We have now completed the Profile Content task.
Task #3: Code Check
The goal of the Code Check application is to check SAS code for SAS Viya incompatibilities. During the process Code Check performs the following actions:
- It classifies any file in the starting directory and any subdirectories that have an extension of .SAS as SAS code. It adds it to the list of files to be scanned.
- It searches the files for keywords that have been identified as not compatible in SAS Viya.
- It searches the files for hardcoded paths in statements such as LIBNAME, INFILE, FILENAME, %INC, and %INCLUDE. These occurrences might not cause errors, but they are gathered so that they can be validated.
When executing the codeCheck command, you will have a few options available to you. You can use the --scan-tag option to distinguish separate runs from Code Checks across different directories.
Then there’s the --source-location which is required to target the directory in which you scan for code.
Finally, there’s the --sources-file option if you have several directories you would like to scan all at once.
In our instance, we will simply point to one directory to gather our code and distinguish this run with a unique scan tag. We’ll run the following command:
./codeCheck --scan-tag exampleGather --source-location /home/sas/My_SAS_Files
You can see that we are targeting the directory: /home/sas/My_SAS_Files. This directory contains 5 example programs that we would like to check:
After executing the command, you should see the following generated from the script:
And two datasets created for each scan tag in the Code Check datamart:
We have now completed our run of the Code Check application.
Task #4: Publish Assessed Content
Now that we have finished running Inventory, Profile, and Code Check, we can now choose to Publish and Merge our content so that we can view the results in a more readable format. If Inventory, Profile or Code Check has been run on more than one machine, we would need to aggregate all the resulting datasets to one location and run publishAssessedContent on that directory. However, in our instance, we have only generated the results on one machine so this is not necessary.
When running the publishAssessedContent command, you will need to specify which datamart type you are targeting. For example, for Code Check, we would specify the Code Check datamart type:
./publishAssessedContent --datamart-type codecheck
The datamart-type value would change for Inventory and Profile.
When executing the publishAssessedContent command, the result looks like this:
You can see that Publish found the resulting datasets generated from Code Check and merged and published them to the respective datamart.
If we go to that datamart location we can see that some additional datasets were generated:
Once you have the datasets generated in this manner, you can choose to import these by following the steps in our Importing the Data Mart documentation.
You can also choose to encrypt your result using the --encryption option. You can specify either:
When using this method, an assessment-key.sas file is created in the location the tool was unpacked.
If you are coordinating with your SAS success team to plan a road map to SAS Viya, you will likely be requested to provide these datamarts. To do so, you will need to run the --create-uploads option with the original command. For example:
$ ./SAS9ContentAssessment/assessment/publishAssessedContent --create-uploads
--datamart-type profile --encrypt-aes
The result is three upload files that are created:
These will be delivered to your SAS success team by following the steps in our documentation.
READ MORE | THE SAS 9 CONTENT ASSESSMENT TOOL
WATCH ON YOUTUBE | SAS 9 CONTENT ASSESSMENT DEMO
READ MORE | SYSTEM EVALUATION TOOL HELPS WITH SAS 9.4 UPGRADE-IN-PLACE PLANNING
How to use the SAS® 9 Content Assessment Tool was published on SAS Users.