Registers a model to an existing version in the SAS Model Manager model hierarchy.
specifies the SAS Model Manager UUID for an existing version in the SAS Model Manager model repository.
Default | the value of the _MM_CId macro variable |
Note | This argument is required. |
specifies the SAS Model Manager model template that was used to register and validate this model.
Default | For models that were registered using the EMModelPackage parameter, the template is set according to the information that is contained within the named SAS Enterprise Miner model package file. |
Models that were registered using the LogisticOutModelTable parameter are registered with the Classification template. | |
All other registrations default to the AnalyticalModel template. |
specifies a SAS file reference that points to the SAS Enterprise Miner model package file (SPK) that contains the model to be registered.
Note | The EMModelPackage argument is required unless you use the ReportDir argument, the ScoreDataStepCode argument, or the ScoreProgram argument to specify the model code filename. If two or more of these arguments are used, the order of priority is ReportDir, EMMModelPackage, ScoreProgram, and then ScoreDataStepCode. |
specifies a SAS file reference for the model score code that is a fragment of SAS code that can be included in a DATA step. A DATA step fragment contains no DATA, PROC, or RUN statements.
Note | The ScoreDataStepCode argument is required unless you use the EMModelPackage argument, the ReportDir argument, or the ScoreProgram argument to specify the model code filename. If two or more of these arguments are used the order of priority is ReportDir, EMMModelPackage, ScoreProgram, and then ScoreDataStepCode. |
specifies a SAS file reference for a text file containing the SAS program, including all step code that is required for successful execution of the model score code.
Note | The ScoreProgram argument is required unless you use the EMModelPackage argument, the ReportDir argument, or the ScoreDataStepCode argument to specify the model code filename. If two or more of these arguments are used the order of priority is ReportDir, EMMModelPackage, ScoreProgram, and then ScoreDataStepCode. |
specifies a two-level SAS data set reference in the form libref.filename that points to a model input data sample table. The input data sample table is a table that contains all model input variables and is used to create the inputvar.xml file that is required for model registration. The input data sample table is not required for models that were imported as SAS Enterprise Miner package files.
Note | The InDataSamp argument is required unless you use the InDataInfo argument. |
Tip | When you use the %MM_Register macro to register a model, the inputvar.xml file should contain only input variables for the model that you are registering. If the input data sample table includes variables that are not used by the model, use the KeepInVars argument to remove these variables. If no variables are specified by the KeepInVars argument, SAS filters the target variables from the table specified by the InDataSamp argument. |
See | KeepInVars argument |
specifies a two-level SAS data set reference in the form libref.filename that points to a model input variable metadata table. The input variable metadata table should be in the form of a CONTENTS procedure output file, which has the columns NAME, TYPE, LENGTH, LABEL, FORMAT, LEVEL, and ROLE. Each row of the table is a variable. The model input variable metadata table is used to create the inputvar.xml file that is required for model registration.
Note | The InDataInfo argument must be specified unless you use the InDataSamp argument. |
Tip | When you use the %MM_Register macro to register a model, the inputvar.xml file should contain only variables for the model that you are registering. If no variables are specified in the KeepInVars argument, SAS filters the target variables from the table specified by the InDataInfo argument. |
See | The CONTENTS Procedure in the Base SAS Procedures Guide |
specifies a two-level SAS data set reference in the form libref.filename that points to a model output data sample table. The output data sample table should contain all variables that are created or modified by the model and is used to create the outputvar.xml file that is required for model registration. The output data sample table is not required for models that were imported as SAS Enterprise Miner package files.
Interaction | If the output data sample table includes variables that are created or modified by the model, use the KeepOutVars argument to remove these variables. If no variables are specified in the KeepOutVars argument, SAS filters the input variables and the target variables from the table that is specified by the OutDataSamp argument. |
Note | The OutDataSamp argument must be specified unless you use the OutDataInfo argument. |
See | KeepOutVars argument |
specifies a two-level SAS data set reference in the form libref.filename that points to a model output variable metadata table. The output variable metadata table should contain all of the variables that are created or modified by the model. The SAS file should be in the form of the CONTENTS procedure output file, which has the columns NAME, TYPE, LENGTH, LABEL, FORMAT, LEVEL, and ROLE. Each row of the table contains a variable. The output variable metadata table is used to create the outputvar.xml file that is required for model registration.
Interaction | If no variables are specified by the KeepOutVars argument, SAS filters the input variables and target variables from the table that is specified by the OutDataInfo argument. |
Note | The OutDataInfo argument must be specified unless you use the OutDataSamp argument. |
specifies a two-level SAS data set reference in the form libref.filename. The data set reference points to a SAS table that contains the model target variable. The SAS file should contain the variable that was used as the model target during training. The SAS file is used to create the target variable information in the targetvar.xml file that is used for SAS Model Manager model registration.
Tip | If the target data sample table includes other variables that are not model target variables, use the KeepTargetVars argument to remove these variables. |
See | KeepTargetVars argument |
specifies a two-level SAS data set reference in the form libref.filename. The data set reference points to a SAS table that contains the model's target variable and its metadata. The SAS file should be in the form of the CONTENTS procedure output file, which has the columns NAME, TYPE, LENGTH, LABEL, FORMAT, LEVEL, and ROLE. Each row of the table contains a variable. The metadata in the SAS file is used to create the target variable information in the target.xml file that is used for SAS Model Manager model registration.
specifies a two-level SAS data set reference in the form libref.filename. The data set reference points to a SAS file that contains the training data that is used for a model created by the LOGISTIC procedure. The training data sample must be an exact sample of the training data that is submitted to the LOGISTIC procedure. When the TrainingDataSamp argument and the LogisticOutModelTable argument are specified, the %MM_Register macro can derive the input, output, and target variables to create the inputvar.xml file, the ouputvar.xml file, and the targetvar.xml file.
specifies a two-level SAS data set reference in the form libref.filename that points to a LOGISTIC procedure fit table that was created by using the PROC LOGISTIC OUTMODEL= statement, and is suitable for use with the PROC LOGISTIC INMODEL statement. If the TrainingDataSamp argument is specified, then SAS generates the input, output, and target variable metadata from this table. In this case, the InDataSamp and OutDataSamp arguments do not need to be specified.
Note | This argument is required only if the model is created by the LOGISTIC procedure using the OUTMODEL statement. |
specifies an absolute file path to the EMREPORT directory that was created by the SAS Enterprise Miner batch code. All SAS Enterprise Miner model packages that are named miningResult.spk and that reside in a subdirectory of the EMREPORT directory are registered to the target version. The ReportDir argument is valid only for use with SAS Enterprise Miner model package files.
Note | The ReportDir argument is required unless you use the EMModelPackage argument, the ScoreDataStepCode argument, or the ScoreProgram argument to specify the model code filename. If two or more of these arguments are used the order of priority is ReportDir, EMMModelPackage, ScoreProgram, and then ScoreDataStepCode. |
specifies a list of input variables or columns that are retained in the model's inputvar.xml file. Only variables from the table that is specified by the InDataSamp argument can be specified in this list.
See | InDataSamp argument |
specifies a list of variables or columns that are retained in the model's outputvar.xml file. Only variables from the table that is specified by the OutDataSamp argument can be specified in this list.
See | OutDataSamp argument |
specifies a list of variables or columns that are retained in the model's targetvar.xml file. Only variables from the tables that are specified by the TargetDataSamp argument can be specified in this list.
See | TargetDataSamp argument |
specifies the name of the model, which is used as the value of the model Name property on the General tab of the Models Properties page.
Note | This argument is required. |
specifies a description of the model, which is used as the value of the model Description property on the General tab of the Models Properties page.
specifies a model's label, which is used as the value for the model Model label property on the Specific tab of the Models Properties page. model-label is a text string that is used as the label for the selected model in the model assessment charts that SAS Model Manager creates. If model-label is not specified, SAS Model Manager uses the text string that is specified for the ModelName argument.
specifies the model's subject, which is used as the value for the model Subject property on the Specific tab of the Models Properties page. model-subject provide an additional description for a model, such as a promotional or campaign code. This property is not tied to any computational action by SAS Model Managerr.
specifies the model's computation algorithm, which is used as the value of the model Algorithm property on the Specific tab of the Models Properties page.
Example | Algorithm=Decision Tree |
specifies the model's function class, which is used as the value for the model Function on the Specific tab of the Models Properties page. Valid values are Classification, Prediction, Association, Clustering, Sequence, Forecasting, TextMining, Transformation, and EMCreditScoring.
specifies the SAS Model Manager user ID for the person who created the model, which is used as the value of the model Modeler property on the Specific tab of the Models Properties page.
specifies the modeling tool that was used to create the model, and that is used as the value of the model Tool property on the Specific tab of the Models Properties page.
specifies the version of the tool that was used to create the model, and that is used as the value of the model Tool version property on the Specific tab of the Models Properties page.
specifies whether to supply verbose trace messages to the SAS log.
Default | OFF |
Example | trace=on |
Required Information
|
Argument
|
Usage
|
---|---|---|
model name
|
ModelName
|
Specify the name of
the model, which is used to identify the model in the SAS Model Manager
model repository.
|
version
|
VersionId
|
Specify the name of
the version in which the model is registered.
|
model score code
Specify one of the following
arguments:
|
ScoreDataStepCode
|
Specify a fileref that
points to a file that contains score code that is a DATA step fragment.
A DATA step fragment contains no DATA, PROC, or RUN statements.
When you specify the
ScoreDataStepCode argument, your model input and output variables
can be defined using one of the following pairs of arguments:
|
|
ScoreProgram
|
Specify a LOGISTIC procedure
FIT table in the form libref.filename that
was created by the PROC LOGISTIC OUTMODEL= statement. The FIT table
can be used as the value in a PROC LOGISTIC INMODEL= statement.
When you specify the
ScoreProgram argument, your model input and output variables can be
defined using one of the following pairs of arguments:
|
|
LogisticOutModelTable
|
Specify a libref.filename that
points to a LOGISTIC procedure FIT table that was created by the PROC
LOGISTIC OUTMODEL= statement, which can be used as the value to a
PROC LOGISTIC INMODEL= statement.
If the model does not
contain data transmission and you specify a value for the TrainingDataSamp
argument, SAS Model Manager uses the training sample
data set and the FIT table to create the model inputvar.xml file,
the outputvar.xml file, and the targetvar.xml file.
If you do not specify
a value for the TrainingDataSamp argument or if your program transforms
the model input before running the LOGISTICS procedure, you must provide
the model input and output variables using the InDataSamp or InDataInfo
argument, and the OutDataSamp or OutDataInfo argument.
|
input variables
|
InDataSamp
|
Specify a fileref to
a SAS data set whose variables contain the input variables that are
used by the SAS code model. An example would be a data set that was
used for training the model.
SAS Model Manager reads
one observation in the data set that is specified by the InDataSamp
argument to create the inputvar.xml file for the model. The inputvar.xml
file defines the model input variables and their metadata.
Based on the arguments
that were specified, the %MM_Register macro uses arguments to filter
variables from the data set to create the inputvar.xml file.
For more information, see KeepInVars argument.
|
|
InDataInfo
|
Specify a fileref that
points to a SAS data set whose variables are NAME, TYPE, LENGTH,
LABEL, FORMAT, LEVEL, and ROLE. These variables define metadata for
the model input variables. Each row in this data set contains the
metadata for model input variables. Such a table can be created by
the CONTENTS procedure.
SAS Model Manager reads
the data set that is specified by the InDataInfo argument to create
the inputvar.xml file for the model. The inputvar.xml file defines
the model input variables and their metadata.
The variables in the
data set that are specified by the TargetDataSamp argument or the
TargetDataInfo argument are used as a filter to create the inputvar.xml
file.
|
output variables
|
OutDataSamp
|
Specify a fileref that
points to a SAS data set whose variables contain the output variables
that are created or modified by the SAS code model. An example is
a data set that was the scored output of the model.
SAS Model Manager reads
the data set that is specified by the OutDataSamp argument to create
the outputvar.xml file for the model. The outputvar.xml file defines
the model output variables and their metadata.
Based on the arguments
that were specified, the %MM_Register macro uses arguments to filter
variables from the data set to create the outputvar.xml file.
For more information, see KeepOutVars argument.
|
|
OutDataInfo
|
Specify a fileref that
points to a SAS data set whose variables are NAME, TYPE, LENGTH,
LABEL, FORMAT, LEVEL, and ROLE. These variables define metadata for
the model output variables. Each row in this data set contains the
metadata for model output variables. Such a table can be created by
the CONTENTS procedure.
SAS Model Manager reads
the data set that is specified by the OutDataInfo argument to create
the outputvar.xml file for the model. The outputvar.xml file defines
the model output variables and their metadata. If you do not specify
the KeepOutVars argument, input variables and target variables are
filtered from the output table.
|
target variable
|
TargetDataSamp
|
Specify a fileref that
points to a SAS data set whose variables contain the target variable
that is created or modified by the SAS code model. An example is a
data set that was the scored output of the model.
SAS Model Manager reads
the data set that is specified by the TargetDataSamp argument to create
the targetvar.xml file for the model. The targetvar.xml file defines
the target output variable and its metadata.
You can use the KeepTargetVars
argument to specify the variable in the TargetDataSamp data set that
is used to create the targetvar.xml file.
|
|
TargetDataInfo
|
Specify a fileref that
points to a SAS data set whose variables are NAME, TYPE, LENGTH,
LABEL, FORMAT, LEVEL, and ROLE. These variables define metadata for
the model target variable. A row in this data set contains the metadata
for the model target variable. Such a table can be created by the
CONTENTS procedure.
SAS Model Manager reads
the data set that is specified by the TargetDataInfo argument to create
the targetvar.xml file for the model. The targetvar.xml file defines
the model target variable and its metadata.
|
/*****************************************************/ /* Registering a SAS Enterprise Miner Model Package. */ ******************************************************/ Options NOmlogic NOmprint NOspool; /*****************************************************/ /* Access and load the Model Management macro code.*/ /*****************************************************/ Filename MMAccess catalog 'SASHELP.modelmgr.AccessMacros.source'; %include MMAccess; /*****************************************************/ /* Specify the path for a SAS Enterprise */ /* Miner Model Package file miningResult.spk. */ /*****************************************************/ FILENAME EMPak 'c:\myscorecode\EM\miningResult.spk'; /*****************************************************/ /* Set to detect failure in case macro load fails */ /* and register the Enterprise Miner model. */ /*****************************************************/ %let _MM_RC= -1; %MM_Register( VersionId= //ModelManagerModelRepos/MMRoot/HomeEquity/HMEQ/1.0, EMModelPackage=EMPak, ModelName=HMEQ, Description=Home Equity Score Code, Trace=ON); /*****************************************************/ /* Display MM_Register defined variables. */ /*****************************************************/ Options nosource; %PUT _MM_RC = &_MM_RC; %PUT _MM_CId = &_MM_CId; Options source;
/**************************************************/ /* Registering a generic model. */ /*****************************************************/ 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 files. */ /******************************************************/ LIBNAME modelTbl 'c:\myModel\tables'; FILENAME Code 'c:\myModel\scoreCode'; /******************************************************/ /* Set to detect failure in case macro load fails */ /* and register the model in the model repository */ /******************************************************/ %let _MM_RC= -1; %MM_Register( VersionId= //ModelManagerModelRepos/MMRoot/HomeEquity/HMEQ/1.0, ScoreDataStepCode=CODE, InDataSamp=modelTbl.HMEQInput, OutDataSamp=modelTbl.HMEQOutput, TargetDataSamp=modelTbl.HMEQTarget, ModelName=HMEQDTree, Description= Home Equity model Added with a SMM Macro, Trace=ON); /****************************************************/ /* Display the defined variables. */ /****************************************************/ Options nosource; %PUT _MM_RC = &_MM_RC; %PUT _MM_CId = &_MM_CId; Options source;
/*****************************************************/ /* Registering a PROC LOGISTIC OUTMODEL-style model. */ /*****************************************************/ 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 files. */ /*****************************************************/ LIBNAME modelTbl 'c:\myModel\Tables'; LIBNAME trainTbl 'c:\HomeEquity\Tables'; FILENAME ProgCode 'c:\myModel\scoreCode'; /*****************************************************/ /* Set to detect failure in case macro load fails */ /* and register the model */ /*****************************************************/ %let _MM_RC= -1; %MM_Register( VersionId= //ModelManagerModelRepos/MMRoot/HomeEquity/HMEQ/1.0, ScoreProgram=ProgCODE, LogisticOutModelTable=modelTbl.HMEQProcLogisticOutput, TrainingDataSamp=trainTbl.HMEQTraining, ModelName=HMEQLogisticOutmodel, Description=HMEQ Logistic OUTMODEL model added by macro, Trace=off); /******************************************************/ /* Display the defined variables. */ /******************************************************/ Options nosource; %PUT _MM_RC = &_MM_RC; %PUT _MM_CId = &_MM_CId; Options source;