REGISTERMODEL Procedure

Getting Started: REGISTERMODEL Procedure

Note: Input data must be in a table that is accessible in your session. You can refer to this table by using a two-level name. The first level is a libref, and the second level is the table name. For more information, see the section Using SAS Viya Workbench in Chapter 2, Shared Concepts.

This example illustrates some of the basic features of the REGISTERMODEL procedure by registering a decision tree analytic store model that is trained on the HMEQ data table.

The following DATA step creates the input data table mylib.hmeq in your SAS library. These statements assume that your SAS libref is named mylib, but you can substitute any appropriately defined SAS libref.

data mylib.hmeq;
    set sampsio.hmeq;
run;

The following statements run the TREESPLIT procedure to build a decision tree to estimate the variable bad, which indicates whether mortgage loan applicants defaulted on repayment of their loan. The procedure also outputs an analytic store named treeStore_hmeq.

proc treesplit data = mylib.hmeq;
   input loan value mortdue debtinc derog / level = interval;
   input job / level = nominal;
   target bad / level = nominal;
   prune none;
   saveState rstore = mylib.treeStore_hmeq;
run;

The following statements run the ASTORE procedure to download the analytic store treeStore_hmeq as a binary file:

proc astore;
   download rstore = mylib.treeStore_hmeq
            store = "treeAstore.sasast";
run;

The following statements run PROC REGISTERMODEL to register the analytic store model in SAS Model Manager:

proc registermodel
      name = "Tree Astore"
      description = "Decision Tree Astore Model"
      algorithm = TREE
      function = CLASSIFICATION
      server = "http://myserver.com"
      oauthtoken = "myTokenName"
      replace;
   project name="myProject" folder="myFolder";
   astoremodel store = "treeAstore.sasast";
run;

The NAME= option specifies the name to register the model under in SAS Model Manager. The DESCRIPTION= option specifies the description of the model. The ALGORITHM= option specifies that the decision tree algorithm was used to train the model. The FUNCTION= option specifies that the function of the model is classification. The SERVER= option specifies the root URL for your SAS Viya server. The OAUTHTOKEN= option specifies the name of the authentication token. The REPLACE option indicates that you want to replace an existing model if a model that has the same name already exists in the same project.

The PROJECT statement specifies the project to register the model in. The NAME= option specifies the name of the project. The FOLDER= option specifies the folder where the project resides. The ASTOREMODEL statement with the STORE= option specifies the analytic store file to be uploaded to and registered in SAS Model Manager.

Figure 1 displays the model registration information.

Figure 1: Model Registration Information

Registration Information
Creation Time2024-02-19T15:51:07-04:00
Model NameTree Astore
Model IDbc608dfa-b220-447f-a5e3-97d3a297fc03
Project NamemyProject
Project ID7de86372-654f-4501-a817-2d36a9cb178c
Project Version IDc4a68493-cdd2-41c3-b09f-9ae886a74f45
Folder IDfd174b10-b616-4b99-af64-e56b1fca6fdf
Repository IDf0e58396-8633-4a92-8004-d07b7676283a


Last updated: September 23, 2026