%MM_CreateModelDataset Macro

Creates a data set that contains information about models. SAS Model Manager can provide information for the champion model or for all models that are in the specified model repository path. The repository path that you specify can be MMRoot, an organizational folder, a project, a version, or a model. The data set contains the information for models that exist under the specified path.

Syntax

%MM_CreateModelDataset (mDatasetName = name-of-data-set,
smmPath=folder-project-verion-or-model-path <isChampion=Y | N><, Trace=ON | OFF>);

Arguments

mDatasetName = name-of-data-set

specifies the name of the data set that the macro creates. The macro can be created in a data set that you specify by using a two-level name in the form libref.filename.

Default mDatasetName=work.models

smmPath=folder-project-version-or-model-path

specifies the path from which to obtain the model data. If the path is a folder, the data set contains model information for all models under that folder unless isChampion=Y. If isChampion=Y, the information that is returned is for only the champion model. If the path is a project, the data set contains model information for models under that project. If the path is a version, the data set contains model information for models under that version. If the path is a model, the data set contains model information for only that model.

Default MMRoot

isChampion=Y | N

specifies whether the information that is returned contains information for only the champion model or for all models.

Y specifies that the information that is returned is for only the champion model.
N specifies that the information that is returned is for all models.
Default Y

Trace=ON | OFF

specifies whether to supply verbose trace messages to the SAS log.

Default OFF
Example Trace=on

Details

By default, the %MM_CreateModelDataset returns data only about the champion model. If you want information about models other than the champion model, specify isChampion=N. The data set that is created contains these variables:
Algorithm Name ScoreCodeType
CreationDate Owner Template
Description ProductionDate TemplateFileName
ExpirationDate ProjectName Tool
FolderName ProjectPath UserProperties
Function ProjectState VersionName
ModelLabel ProjectURL VersionState
ModelUUID ProjectUUID isChampion
Modeler PublishedDate isDefaultVersion
ModificationDate RetiredDate isPublished

Example

Extracting Model Information
/*****************************************************/
/* Create a data set to contain model information    */
/*****************************************************/

Options nomlogic nomprint nospool;

/*****************************************************/
/* Load and access the Model Management macro code. */
/*****************************************************/

Filename MMAccess catalog 'SASHELP.modelmgr.AccessMacros.source';
%include MMAccess;

/******************************************************/
/* Specify the location of the data set and model     */ 
/* path.                                              */
/******************************************************/

libname modelDS 'c:\myModel\ModelInfo';
%let hmeq1 = //ModelManagerModelRepos/MMRoot/HomeEquity/HMEQ/1.0;

/******************************************************/
/* Set to detect failure in case macro load fails     */
/* and create the model data set.                     */
/******************************************************/

%let _MM_RC= -1; 

%MM_CreateModelDataset(mDatasetName=modelDS.models, 
    smmpath=//ModelManagerDefaultRepo/MMRoot/DDHMEQ/HMEQ/1.0/Models/
              Regression,
    Trace=ON);

/****************************************************/
/* Display the defined variables. */
/****************************************************/

Options nosource;
%PUT _MM_RC = &_MM_RC;
Options source;
Last updated: February 14, 2017