Examples | ModelId=8904daa1-0a29-0c76-011a-f7bb587be79f |
ModelId=//ModelManagerDefaultRepo/MMRoot/DDHMEQ/HomeEquity/2012/Models/HMEQ%20Loan%20Project |
Example | SASDataFile=mysascode.hmeqloan |
Example | SASCatalog=mylib.modelinput |
Example | TextFile=inputxml |
Example | BinaryFile=gainscsv |
Example | Name=score.sas |
Default | OFF |
Example | Trace=on |
/****************************************/ /* Adding a file to a registered model. */ /***************************************************/ Options NOmlogic NOmprint NOspool; /***************************************************/ /* Get the SAS Model Manager macro code. */ /***************************************************/ Filename MMAccess catalog 'SASHELP.modelmgr.AccessMacros.source'; %include MMAccess; /* Fileref to the encoded password */ FILENAME pwfile 'my-network-path\pwfile'; /***************************************************/ /* Set the SAS WIP Server variables. */ /***************************************************/ %let _MM_MulticastAddress=239.27.18.213; %let _MM_MulticastPort=8561; %let _MM_User=sasdemo; data _null_; infile pwfile obs=1 length=l; input @; input @1 line $varying1024. l; call symput('_MM_Password',substr(line,1,l)); run; /***************************************************/ /* A LIBNAME for a table. */ /***************************************************/ LIBNAME mtbls 'c:\mysascode'; /***************************************************/ /* Set to detect failure in case macro load fails */ /* and add the input data source. */ /***************************************************/ %let _MM_RC= -1; %MM_AddModelFile( ModelId= //ModelManagerRepo/MMRoot/HomeEquity/HMEQ/2012/hmeqDecTree1, Name=modelinput.sas7bdat, SASDataFile=mtbls.myInputVariables, Trace=Off ); /***************************************************/ /* A FILENAME for a text file. */ /***************************************************/ FILENAME tcode 'c:\myModel\inputvar.xml'; /***************************************************/ /* Set to detect failure in case macro load fails */ /* and add the xml file for the input data source */ /***************************************************/ %let _MM_RC= -1; %MM_AddModelFile( ModelId= //ModelManagerRepo/MMRoot/HomeEquity/HMEQ/2012/hmeqDecTree1, TextFile=tcode, Trace=on);
Examples | ModelId=b2341a42-0a29-0c76-011a-f7bb7bc4f1e9 |
ModelId=//ModelManagerDefaultRepo/MMRoot/DDHMEQ/HomeEquity/2012/Models/HMEQ%20Loan%20Project |
Examples | VersionId=b23327cb-0a29-0c76-011a-f7bb3d790340 |
VersionId=//ModelManagerDefaultRepo/MMRoot/DDHMEQ/HomeEquity/2012 |
Examples | VersionId=b232d766-0a29-0c76-011a-f7bb50921b42 |
VersionId=//ModelManagerDefaultRepo/MMRoot/DDHMEQ/HomeEquity |
Example | SASDataFile=mylib.modelinput |
Example | SASCatalog=mylib.format |
Example | TextFile=myfileref |
Example | BinaryFile=myfileref |
Example | Name=score.sas |
Default | OFF |
Example | Trace=on |
/******************************************************/ /* Get the score code from a registered model and run */ /* it. */ /******************************************************/ Options NOmlogic NOmprint NOspool; /*****************************************************/ /* Get the SAS Model Manager macro code. */ /*****************************************************/ FILENAME MMAccess catalog 'sashelp.modelmgr.accessmacros.source'; %include MMAccess; /* Fileref to the encoded password */ FILENAME pwfile 'my-network-path\pwfile'; /*****************************************************/ /* Set the SAS WIP Server variables. */ /*****************************************************/ %let _MM_MulticastAddress=239.27.18.213; %let _MM_MulticastPort=8561; %let _MM_User = miller; data _null_; infile pwfile obs=1 length=l; input @; input @1 line $varying1024. l; call symput('_MM_Password',substr(line,1,l)); run; /*****************************************************/ /* Specify the model component file name and */ /* destination. */ /*****************************************************/ %let WorkPath = c:\myProject\2012; FILENAME dest '&WorkPath.\score.sas'; /*****************************************************/ /* Set to detect failure in case macro load fails. */ /*****************************************************/ %let _MM_RC = -1; /*****************************************************/ /* Get score code. */ /*****************************************************/ %MM_GetModelFile(ModelId=//ModelManagerRepo/MMRoot/HomeEquity/HMEQ/2012/ DecisionTree, TextFile=dest); /*****************************************************/ /* Display SAS Model Manager set macro variables. */ /*****************************************************/ Options nosource; %PUT _MM_RC = &_MM_RC; %PUT _MM_CId = &_MM_CId; Options source; /*****************************************************/ /* Run score code. Sepcify the LIBNAME input path. */ /*****************************************************/ LIBNAME input 'c:\mysascode\2012\DTree'; DATA score; set input.dTreeInp; %include dest; run;
Example | UUID=cca1ab08-0a28-0e97-0051-0e3991080867 |
Default | OFF |
Example | Trace=on |
/***************************************************/ /* Get the URL for the location of a model. */ /****************************************************/ Options nomlogic nomprint nospool; /****************************************************/ /* Get the SAS Model Manager macro code. */ /**************************************************** / FILENAME MMAccess catalog 'sashelp.modelmgr.accessmacros.source'; %include MMAccess; /* Fileref to the encoded password */ FILENAME pwfile 'my-network-path\pwfile'; /***************************************************/ /* Set the SAS WIP Server variables. */ /***************************************************/ %let _MM_MulticastAddress=239.27.18.213; %let _MM_MulticastPort=8561; %let _MM_User=miller; data _null_; infile pwfile obs=1 length=l; input @; input @1 line $varying1024. l; call symput('_MM_Password',substr(line,1,l)); run; /***************************************************/ /* Set to detect failure in case macro load fails */ /* and get the URL. */ /***************************************************/ %let _MM_RC= -1; %let target=aef7a78e-0a28-0e97-01c0-b8a0e5ba15c7; %MM_GetURL(UUid=&target,Trace=on); %put _MM_URL=&_MM_URL; %put _MM_ResourcesURL=&_MM_ResourcesURL;
Default | the value of the _MM_CId macro variable |
Note | This argument is required. |
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. |
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. |
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. |
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. |
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 |
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 9.4 Procedures Guide |
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 |
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. |
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 |
Note | This argument is required only if the model is created by the LOGISTIC procedure using the OUTMODEL statement. |
See | InDataSamp argument |
See | OutDataSamp argument |
See | TargetDataSamp argument |
Note | This argument is required. |
Example | Algorithm=Decision Tree |
Default | OFF |
Example | Trace=on |
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.
|
||
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.
|
||
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.
|
||
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.
|
||
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.
|
||
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.
|
||
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.
|
/*****************************************************/ /* Registering a SAS Enterprise Miner Model Package. */ ******************************************************/ Options NOmlogic NOmprint NOspool; /*****************************************************/ /* Access and load the SAS Model Manager macro code.*/ /*****************************************************/ Filename MMAccess catalog 'SASHELP.modelmgr.AccessMacros.source'; %include MMAccess; /* Fileref to the encoded password */ FILENAME pwfile 'my-network-path\pwfile'; /*****************************************************/ /* Set SAS WIP Server variables. *********************/ /*****************************************************/ %let _MM_MulticastAddress=239.27.18.213; %let _MM_MulticastPort=8561; %let _MM_User = miller; data _null_; infile pwfile obs=1 length=l; input @; input @1 line $varying1024. l; call symput('_MM_Password',substr(line,1,l)); run; /*****************************************************/ /* 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/2012, EMModelPackage=EMPak, ModelName=HMEQ, Description=Home Equity Score Code, Modeler=Titus Groan, Function=Reg, Tool=SAS Enterprise Miner, ToolVersion=v12.1, Subject= Loan, 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 SAS Model Manager macro code. */ /*****************************************************/ Filename MMAccess catalog 'SASHELP.modelmgr.AccessMacros.source'; %include MMAccess; /* Fileref to the encoded password */ FILENAME pwfile 'my-network-path\pwfile'; /*****************************************************/ /* Set the SAS WIP Server variables. */ /*****************************************************/ %let _MM_MulticastAddress=239.27.18.213; %let _MM_MulticastPort=8561; %let _MM_User = miller; data _null_; infile pwfile obs=1 length=l; input @; input @1 line $varying1024. l; call symput('_MM_Password',substr(line,1,l)); run; /******************************************************/ /* 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 SAS Model Manager */ /******************************************************/ %let _MM_RC= -1; %MM_Register( VersionId= //ModelManagerModelRepos/MMRoot/HomeEquity/HMEQ/2012, 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 SAS Model Manager 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 SAS Model Manager macro code. */ /*****************************************************/ Filename MMAccess catalog 'SASHELP.modelmgr.AccessMacros.source'; %include MMAccess; /* Fileref to the encoded password */ FILENAME pwfile 'my-network-path\pwfile'; /*****************************************************/ /* Set the SAS WIP Server variables. */ /*****************************************************/ %let _MM_MulticastAddress=239.27.18.213; %let _MM_MulticastPort=8561; %let _MM_User = miller; data _null_; infile pwfile obs=1 length=l; input @; input @1 line $varying1024. l; call symput('_MM_Password',substr(line,1,l)); run; /*****************************************************/ /* 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/2012, ScoreProgram=ProgCODE, LogisticOutModelTable=modelTbl.HMEQProcLogisticOutput, TrainingDataSamp=trainTbl.HMEQTraining, ModelName=HMEQLogisticOutmodel, Description=HMEQ Logistic OUTMODEL model added by macro, Trace=off); /******************************************************/ /* Display the SAS Model Manager-defined variables. */ /******************************************************/ Options nosource; %PUT _MM_RC = &_MM_RC; %PUT _MM_CId = &_MM_CId; Options source;
Default | the value of the _MM_CId macro variable |
Note | This argument is required. |
Examples | VersionId=b23327cb-0a29–0c76–011a-f7bb3d790340 |
VersionId=//ModelManagerDefaultRepo/MMRoot/DDHMEQ/HomeEquity/2012 |
Note | This argument is required. |
Default | OFF |
Example | Trace=on |
<?xml version="1.0" encoding="utf-8" ?> <Model> <ModelMetadata> <name>hmeq</name> <description>Home Equity Model</description> <label>HMEQ</label> <algorithm></algorithm> <function>classification</function> <modeler></modeler> <tool>SASProc</tool> <toolversion></toolversion> <subject></subject> <modelTemplate>Classification</ModelTemplate> <scoreCodeType>SAS Program</scoreCodeType> </ModelMetadata> <FileList> <File> <name>score.sas</name> <value>myScoreFile.sas</value> </File> <File> <name>modelinput.sas7bdat</name> <value>hmeqIn</value> </File> <File> <name>modeloutput.sas7bdat</name> <value>hmeqOut</value> </File> <File> <name>target.sas7bdat</name> <value>hmeqTar</value> </File> <File> <name>inputvar.xml</name> <value></value> </File> <File> <name>outputvar.xml</name> <value></value> </File> <File> <name>targetvar.xml</name> <value></value> </File> <File> <name>train.sas7bdat</name> <value></value> </File> <File> <name>Training.sas</name> <value></value> </File> <File> <name>Training.log</name> <value></value> </File> <File> <name>Training.lst</name> <value></value> </File> <File> <name>outest.sas7bdat</name> <value></value> </File> <File> <name>outmodel.sas7bdat</name> <value>om</value> </File> <File> <name>Output.spk</name> <value></value> </File> <File> <name>Format.sas7bcat</name> <value></value> </File> <File> <name>Dataprep.sas</name> <value></value> </File> <File> <name>Notes.txt</name> <value></value> </File> </FileList> </Model>
/**************************************************/ /* Register a SAS Code Model By Folder */ /*****************************************************/ Options nomlogic nomprint nospool; /*****************************************************/ /* Load and access the SAS Model Manager macro code. */ /*****************************************************/ Filename MMAccess catalog 'SASHELP.modelmgr.AccessMacros.source'; %include MMAccess; /* Fileref to the encoded password */ FILENAME pwfile 'my-network-path\pwfile'; /*****************************************************/ /* Set the SAS WIP Server variables. */ /*****************************************************/ %let _MM_MulticastAddress=239.27.18.213; %let _MM_MulticastPort=8561; %let _MM_User = miller; data _null_; infile pwfile obs=1 length=l; input @; input @1 line $varying1024. l; call symput('_MM_Password',substr(line,1,l)); run; /******************************************************/ /* Specify the location of the folder. */ /******************************************************/ %let modelFolder = c:\myModel; %let hmeq2012 = //ModelManagerModelRepos/MMRoot/HomeEquity/HMEQ/2012; /******************************************************/ /* Set to detect failure in case macro load fails */ /* and register the models in SAS Model Manager. */ /******************************************************/ %let _MM_RC= -1; %MM_RegisterByFolder(VersionId=&hmeq2012, ReportDir=&modelFolder, Trace=ON); /****************************************************/ /* Display the SAS Model Manager-defined variables. */ /****************************************************/ Options nosource; %PUT _MM_RC = &_MM_RC; Options source;
Default | mDatasetName=work.models |
Default | MMRoot |
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 |
Default | OFF |
Example | Trace=on |
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 |
/*****************************************************/ /* Create a data set to contain model information */ /*****************************************************/ Options nomlogic nomprint nospool; /*****************************************************/ /* Load and access the SAS Model Manager macro code. */ /*****************************************************/ Filename MMAccess catalog 'SASHELP.modelmgr.AccessMacros.source'; %include MMAccess; /* Fileref to the encoded password */ FILENAME pwfile 'my-network-path\pwfile'; /*****************************************************/ /* Set the SAS WIP Server variables. */ /*****************************************************/ %let _MM_MulticastAddress=239.27.18.213; %let _MM_MulticastPort=8561; %let _MM_User = miller; data _null_; infile pwfile obs=1 length=l; input @; input @1 line $varying1024. l; call symput('_MM_Password',substr(line,1,l)); run; /******************************************************/ /* Specify the location of the data set and model */ /* path. */ /******************************************************/ libname modelDS 'c:\myModel\ModelInfo'; %let hmeq2012 = //ModelManagerModelRepos/MMRoot/HomeEquity/HMEQ/2012; /******************************************************/ /* 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/2012/Models/ Regression, Trace=ON); /****************************************************/ /* Display the SAS Model Manager-defined variables. */ /****************************************************/ Options nosource; %PUT _MM_RC = &_MM_RC; Options source;