Publishing Models to a SAS Channel

About Publishing Models to a SAS Channel

SAS Model Manager uses the SAS Publishing Framework to publish models to defined channels. The SAS Publishing Framework notifies subscribers of the publication channel when the models are delivered. You can publish models from the organizational, project, version, or Models folder in the Project Tree.
SAS Model Manager creates a SAS package (SPK) file for the model in a publication channel. A user who subscribes to the publication channel can choose to receive e-mail that includes the SAS package as an attachment.
Note: Before you can deploy a model to a publications channel, a SAS administrator must configure the publication channel in SAS Management Console to publish models as archive (binary .SPK) files to a persistent store location. The archive persistent store location is specified as a physical file location, an FTP server, an HTTP server, or a path in WebDAV.
The REPORT attribute for a file element in a model template indicates whether SAS Model Manager includes a file in the SAS package. You use the SAS Package Reader or a file archiver and compression utility, such as WinZip, to view the contents of the SPK file. SAS Model Manager provides SAS macro programs to extract published models and deploy the models on testing and production scoring servers.
By default, the SAS package with the published model includes the following files:
Filename
Description
inputvar.xml
input variables for the model
outputvar.xml
output variables for the model
targetvar.xml
target variable for the model
score.sas
SAS code to generate the model
smmpostcode.sas
SAS code to map model variables to project variables
sas001.ref
URL address of inputvar.xml
sas002.ref
URL address of outputvar.xml
sas003.ref
URL address of score.sas
The SAS package might contain additional files, depending on the number of file elements in the model template that have a REPORT attribute.
Note: The REF file contains the URL for a folder location in the Project Tree, such as http://MMServer:8080/SASContentServer/repository/default/ModelManager/MMRoot/organizational folder/project/version/Models/model_name/code.sas.
These are the tasks that you perform to use a published model:

Publish a Model to a Channel

To publish a model to a channel, follow these steps.
  1. Right-click the organizational, project, version, or Models folder that contains the model that you want to publish, and select one of the following menu options to display the Publish to a SAS Channel window:
    • Select Publish Models to a SAS Channel for an organizational or version folder.
    • Select Publish Modelsthen selectto a SAS Channel for a project folder.
    • Select Publish to a SAS Channel for the Models folder.
    Note: To publish a model, you must specify that the project contains a version folder with at least one model.
    Publish to a SAS Channel Window
  2. Select a publication channel from the Channel list box.
    Note: The channel values for Description, Subject, and Subscribers are defined in the SAS Metadata Repository with SAS Management Console.
  3. Select the model to publish in the Select Entries to Publish table. SAS Model Manager lists all of the models in the version folder. To view the entire folder name, expand the ID column heading.
  4. Click Next. The next window appears.
    Second Window for Publish to a SAS Channel
  5. (Optional) Specify a subject line for the e-mail message in the Message Subject box. By default, SAS Model Manager uses the value that is defined in the publication channel. If you omit the subject line, the name of the published model is used.
  6. (Optional) Use the Notes box to include information about the model that might be useful to other users involved with the project.
  7. (Optional) Create user-defined properties that you can use to filter the notifications that are sent to subscribers of the publication channel. SAS Model Manager embeds user-defined properties in the SAS package file.
    To create a user-defined property, complete these steps:
    1. Right-click in the Add User-Defined Property table and select Add User-Defined Property. The Add User-Define Property window appears.
      Add User-Defined Property Window
    2. Specify the property name and its value. For example, specify CreditScoreModelCode for the property name and V3test for its value.
    3. Click OK.
    Note: You can also add user-defined properties to the model properties in the Project Tree. Then the property is already defined each time you publish the model.
  8. Click Finish. A window appears that provides information about whether SAS Model Manager successfully published the model. Click Details to display a log of the publication process and any messages.
  9. Click Close.
  10. (Optional) Update the specific properties for the appropriate milestone task in the Life Cycle node.
  11. (Optional) Add a user-defined property to identify the publication channel:
    1. Select the model. Right-click in the Properties view and select Add User-Defined Property.
    2. In the Name field, enter a property name that depicts the channel name that was used to export the project, such as PublishedToChannel.
    3. In the Value field, enter the channel that was used to export the project. Click OK.
    If you extract a model using the %MM_GetModels() macro to create performance reports, you must know the channel that was used to publish the model.

Extract a Published Model

When you publish a model, a SAS package is sent to the publication channel. The SAS package contains the model input, output, SAS code, and its properties. You can submit a SAS DATA step program that calls the SAS Publish API (Application Programming Interface) to extract and deploy the model to a testing or scoring server. SAS Model Manager also provides a SAS macro program, called %MM_GetModels, that extracts the SAS code and metadata to score the model. Typically, extracted files are placed on a local drive of the scoring server that is used to deploy the published model.
SAS Model Manager uses the extracted files to generate reports that monitor and evaluate model performance. Changes in model performance might indicate a need to adjust the model or identify a new champion model. You can create the reports either by using the Define Performance Task wizard from the Project Tree or by submitting SAS macro programs. The %MM_GetModels macro creates the data tables that are required to run the performance reports. The macro also creates and manages the data sets that provide metadata to track the current champion models for each project, the extracted models from channels, and the archived models. For more information, see Extracting the Champion Model from a Channel.