BookmarkSubscribeRSS Feed

SAS Content Assessment: quickly accessing results

Started ‎04-24-2023 by
Modified ‎04-24-2023 by
Views 2,663

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. 

 

Run Content Assessment Applications

 

In order to preview results the first thing we need to do is generate the results using the two applications that support previewAssessedContent:

 

  • inventory scans SAS 9 systems and documents the type and volume of content.
  • codeCheck examines SAS 9 programs to determine compatibility with SAS Viya, including elements not supported​ or that may have processing restrictions in Viya and the location of physical paths in the code.​

 

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:

 

  • metaparms.sas to provide the connection information to the SAS 9.4 metadata server.​
  • setenv.yaml to provide the main configuration file for all content assessment applications.​ (NOTE: not all settings in this file apply to all applications)

 

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

 

 

 

 

 

gn_preview_01.png

 

Following the execution of the applications, we need to publish the results. The publishing step is always required, it:

 

  • aggregates results for deployments into a single datamart​
  • supports encrypting results​
  • can create an archive file to share the results with SAS (zip or tgz).​

 

 

 

 

 

publishAssessedContent.exe --datamart-type codecheck
publishAssessedContent.exe --datamart-type inventory

 

 

 

 

 

gn_preview_02.png

 

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.

 

Preview the Assessed Content

 

To generate a preview run the previewAssessedContent application for inventory and codeCheck:

 

 

 

 

 

previewAssessedContent.exe --datamart-type codecheck
previewAssessedContent.exe --datamart-type inventory

 

 

 

 

 

gn_preview_03b.png

 

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.

 

gn_preview_04.png

 

The format of the CSV files is documented in a readme file in each directory. For an inventory, the following CSV files are created.

 

  • objects.csv: objects in the 9.4 deployment
  • servers.csv: servers in the 9.4 deployment
  • deployments.csv:  deployed products  and their version and details of hotfixes installed
  • licenses.csv: licensed products and their license expiration date

 

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. 

 

gn_preview_05.png

 

 Secondly, a detailed listing of the objects in SAS 9.4 broken down by type of object. 

 

gn_preview_06.png

 

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:

 

  • grids.csv  grid-type restrictions 
  • hardpaths.csv  hard-coded paths
  • incompatibles.csv incompatible code elements
  • compatibles.csv  compatible code
  • warnings.csv  code elements that may not run ootb in secure Viya environments 
  • unique_engines.csv unique engines 

 

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.

 

Conclusion

 

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 :

 

 

Comments

This is a welcome addition to the Content tool collection, very useful, thank you very much @GerryNelson .

@ronan you are very welcome.

Version history
Last update:
‎04-24-2023 07:52 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