SAS 9 Content Assessment now allows access to some of the Content Assessment results without the use of a Visual Analytics environment. A new tool previewAssessedContent will read selected results and export them to CSV files where they can be quickly reviewed. Let’s take a look at how you would use previewAssessedContent.
Content Assessment is updated monthly and can be downloaded from support.sas.com. It is a good practice to always get the latest version of Content Assessment. The PreviewAssessedContent application, released with the 2023.01, and is currently available for the results generated by the inventory and codeCheck applications.
In order to preview results the first thing we need to do is generate the results using the two applications that support previewAssessedContent:
The first step in using Content Assessment is to install and configure it. In this post, we will not cover those details, for an overview of Content Assessment and all of its applications check out this youtube video. The primary configuration step consists of editing two files. In the Content Assessment installation directory edit:
The location of the preview result output is determined by ASSESSMENT_PREVIEWSDIR setting in the setenv.yaml file.
With Content Assessment configured we can run inventory and codecheck. There are no parameters required for inventory. For codeCheck, we pass the directory containing the code we want to process.
codeCheck.exe --scan-tag basecode --source-location "d:\\workshop\\gelcorp"
inventoryContent.exe
Following the execution of the applications, we need to publish the results. The publishing step is always required, it:
publishAssessedContent.exe --datamart-type codecheck
publishAssessedContent.exe --datamart-type inventory
The next steps are usually loading the data to CAS on Viya and importing the Content Assessment Reports to Visual Analytic on Viya. (NOTE: as an alternative for inventory data can be loaded to LASR and surfaced in Visual Analytics in SAS 9.4)
These steps require access to a Visual Analytics environment. Many SAS 9 Customers will not have easy access to a Viya environment and EBI and EDI customers may not have access to a Visual Analytics environment in SAS 9.4. Customers have always had the option of sending the results to SAS for analysis. Now previewAssessedContent gives customers and consultants an additional option allowing them to independently and quickly access the results for Inventory and codeCheck.
To generate a preview run the previewAssessedContent application for inventory and codeCheck:
previewAssessedContent.exe --datamart-type codecheck
previewAssessedContent.exe --datamart-type inventory
Preview assessed content reads data from the published datamart and creates CSV files. By default, the CSV files are written to a sub-directory of the Content Assessment installation directory \assessment\preview\inventory\CSV for inventory and \assessment\preview\codecheck\CSV for codeCheck.
The format of the CSV files is documented in a readme file in each directory. For an inventory, the following CSV files are created.
The CSV files can then be used to quickly view and report on the results. In the simplest case, we can read the files into SAS 9.4 tables and report on the results. The simple SAS program below reports on the inventory results. It can be run from SAS 9.4 or Viya.
/* ************************************************************************************* */
/* Use Content Assessment Inventory data to generate a simple report */
/* ************************************************************************************* */
%let previewdir=D:\workshop\SAS9ContentAssessment\assessment\preview\inventory\CSVs;
DATA WORK.objects;
LENGTH SERVER_LABEL $4 Name $60 TypeName $31 Path $161 StorageType $14 Portfolio $21 Sellable_Offering $28 ;
FORMAT SERVER_LABEL $CHAR10. Name $CHAR60. TypeName $CHAR40. Path $CHAR200. StorageType $CHAR20. Portfolio $CHAR21. Sellable_Offering $CHAR28. ;
INFORMAT SERVER_LABEL $CHAR10. Name $CHAR60. TypeName $CHAR40. Path $CHAR200. StorageType $CHAR20. Portfolio $CHAR30. Sellable_Offering $CHAR30. ;
INFILE "&previewdir\objects.csv" LRECL=32767 FIRSTOBS=2 DLM=',' MISSOVER DSD ;
INPUT SERVER_LABEL : $CHAR4. Name: $CHAR60.TypeName : $CHAR31. Path : $CHAR161.StorageType : $CHAR14. Portfolio: $CHAR30.Sellable_Offering : $CHAR30. ;
label typeName = 'Type of Object'
;
RUN;
proc sort data=WORK.OBJECTS out=WORK.SORTTEMP;
by TypeName path name;
run;
title1 "Summary of SAS 9.4 Content by Object Type";
PROC TABULATE DATA=WORK.OBJECTS order=freq;
CLASS TypeName / ORDER=FREQ MISSING;
TABLE TypeName all = 'Total Objects' , N = 'Count' ;
;
RUN;
title1 'Basic SAS 9.4 Inventory by Object Type';
proc print data=WORK.SORTTEMP label;
var Path Name;
by TypeName;
run;
The example program outputs two sets of results from the CSV's. Firstly, a table summarizing the number of objects of each type in the SAS 9.4 environment.
Secondly, a detailed listing of the objects in SAS 9.4 broken down by type of object.
Codecheck results are also documented in a readme in the results directory. For codeCheck, the following CSV files are created and document the location of each element in the code that was scanned:
Again the results can be used to feed custom reports or even downstream processes that use the CSV files to drive changes to the code.
In this post, we have looked at the new Content Assessment feature PreviewAssessedContent. PreviewAssessed Content removes the need for a Visual Analytics environment to view Content Assessment inventory and codeCheck results. This is a nice new feature that makes Content Assessment results more accessible and allows customers and consultants to quickly access results in SAS 9.4.
Here are some links to additional information and some related Content about SAS 9.4 to Viya migration :
This is a welcome addition to the Content tool collection, very useful, thank you very much @GerryNelson .
@ronan you are very welcome.
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.