%AA_Model_Register Autocall Macro

Creates an SPK package file and registers models to the SAS Metadata Repository.

Syntax

Model Identification Arguments

ModelName=model-name

specifies the name of the model.

Default aa_model_&sysuserid, where &sysuserid contains the user ID or login of the current SAS process.

ModelDescr=description

is a description of the model.

ItemStore=item-store-name

specifies the name of the item store that is created by some SAS/STAT procedures. The item store is used to retrieve input and target variable metadata, data set names, score code, training code, the mining algorithm, and the mining function.

Note Item store data is not available from these SAS/STAT procedures: REG, GLM, GENMOD, GLIMMIX, PHREG, and SURVEYPHREG.
Tip If you do not specify the ITEMSTORE= option, you must specify these options: DATA=, TARGET=, SCORECODEFILE=, SCORECODEFORMAT=. If you specify the ITEMSTORE= option, you do not need to specify these options.

Action Arguments

Register=Y | N

specifies whether to register the model in the SAS Metadata Repository.

Y indicates to register the model in the SAS Metadata Repository.
N indicates not to register the model in the SAS Metadata Repository.
Default Y

MRPath=SAS-Metadata-Repository-Folder

specifies a folder, using SAS Folders as the root node in the SAS Metadata Repository, where the model is registered.

Default /Shared Data/
Note The forward slash ( / ) after the last folder in the path is not required.
Example /Shared Data/Model Manager/Models/

SPK=Y | N

specifies whether to create a SAS package file:

Y indicates to create a SAS package file.
N indicates not to create a SAS package file.
Requirement If SPK=Y, you must use the SPKFOLDER= option to specify a location to store the SPK file.

SPKFolder=SPK-folder-path

specifies the location to store the SPK file.

Requirement The option is required when you specify SPK=Y.

Model Component Arguments

These arguments must be specified if you do not specify the ITEMSTORE= option:

Data=training-data-set-name

specifies the name of the training data set for the model.

Level=Binary | Ordinal | Nominal | Interval

specifies the class target level of the model.

Binary the variable can contain two discrete values (for example, Yes and No).
Ordinal the variable can contain discrete values that have a logical order (for example, 1, 2, 3, 4).
Nominal the variable contains discrete values that do not have a logical order (for example, car, truck, bus, and train).
Interval the variable contains values across a range. For example, temperature ranges could be between 0–100.

ScoreCodeFile=filename

specifies the name of the file, including the full path to the location where the score code file is stored.

Tip If you specify the ITEMSTORE= option, you do not need to specify this option.

ScoreCodeFormat=Datastep | Program

specifies the format of the score code.

DATASTEP the score code contains only DATA step statements
PROGRAM the score code contains DATA step statements, procedures, or macros.

Target=target-variable

specifies the name of the target variable for model.

Optional Arguments

Debug=Y | N

specifies whether to prevent deletion of the generated data sets:

Y indicates to keep the generated data sets.
N indicates not to keep the generated data sets.

Lookup=lookup-method

specifies the algorithm for looking up CLASS levels in SAS/STAT models. Here are the valid lookup methods:

Auto

selects the LINEAR algorithm if a CLASS variable has fewer than five categories. Otherwise, the Binary algorithm is used. This is the default.

Binary

specifies to use a binary search. This method is fast, but it might produce incorrect results. The normalized category values might contain characters that collate in different orders in ASCII and EBCDIC, if you generate the code on an ASCII machine and execute the code on an EBCDIC machine, or vice versa.

Linear

uses a linear search with IF statements that have categories in the order of the class levels. This method is slow if there are many categories.

Select

uses a SELECT statement.

Requirement Use Lookup=Select when a SAS/STAT model contains non-latin1 characters to ensure the generation of the correct score code. If a model with non-latin1 characters is published to a database and Lookup=Select is not specified, the scoring results might be incorrect.

MiningAlgorithm=algorithm

specifies the type of algorithm that is used to create the mode (for example, DecisionTree or logistic).

MiningFunction=mining-function

specifies one of the following mining functions:

  • classification
  • prediction
  • segmentation

PMMLFile=filename

specifies the name of the file that contains the PMML score code, including the full path to the location of the file. This option is optional.

Score=scored-data-set-name

specifies the name of the scored training data set. This data set is used when there is no score code available to determine the output variables.

Segment=variable

specifies the name of the segment variable.

TrainFile=train-program-filename

specifies the name of the training program file, including the full path to the location of the file.

Last updated: February 22, 2017