Creating the Model Table

Overview

When publishing a model in SAP HANA that has deployed the SAS Embedded Process, you must create a table to hold the sasscore_modelname.ds2 and sasscore_modelname_ufmt.xml scoring files. You must run the %INDHN_CREATE_MODELTABLE macro to create the table before you run the %INDHN_PUBLISH_MODEL macro.
You have to create the table only one time to hold a model’s scoring files.
The %INDHN_CREATE_MODELTABLE macro uses the SAP HANA table type "SASLINK":"sas.ep::TT_SAS_MODEL_TABLE". This table type is created in the SAP HANA system when the SAS Embedded Process is installed.
The model table contains the following columns. The ModelName column is the table key. The table is referenced by the two-level name schema-name.model-table-name.
Column Name
Description
Specification
MODELNAME
Contains the name of the model.
NVARCHAR(128) NOT NULL
MODELDS2
Contains the sasscore_modelname.ds2 file.
NCLOB NOT NULL
MODELFORMATS
Contains the sasscore_modelname_ufmt.xml file.
NCLOB
MODELMETADATA
Reserved by SAS for future use.
NCLOB
MODELUUID1
Contains the UUID of the source model.
NVARCHAR (36)
NOTES1
Contains additional information that describes the source model.
NVARCHAR (512)
1This column is for use by SAS Model Manager.

%INDHN_CREATE_MODELTABLE Run Process

To run the %INDHN_CREATE_MODELTABLE macro, follow these steps:
  1. Start SAS and submit the following command in the Program Editor or Enhanced Editor.
    %let indconn = %str(user='youruserid' password='yourpwd'
        schema=yourschema);
    
    The arguments supplied to the INDCONN macro variable can vary. For more information, see the INDCONN Macro Variable.
  2. Run the %INDHN_CREATE_MODELTABLE macro.
    For more information, see %INDHN_CREATE_MODELTABLE Macro Syntax.

%INDHN_CREATE_MODELTABLE Macro Syntax

%INDHN_CREATE_MODELTABLE
(<DATABASE=database-name>
<, MODELTABLE=<<">model-schema<".>><">model-table-name<">>
<, ACTION=CREATE | REPLACE | DROP>
);
Arguments

DATABASE=database-name

specifies the name of an SAP HANA database where the sasscore_modelname.ds2 and sasscore_modelname_ufmt.xml scoring files are held.

Default The database specified in the INDCONN macro variable or your current database.
Interaction The database that is specified by the DATABASE argument takes precedence over the server, port, or instance value that you specify in the INDCONN macro variable. For more information, see INDCONN Macro Variable.

MODELTABLE=<<">model-schema<">.><">model-table-name<">

specifies the name of the table that holds the sasscore_modelname.ds2 and sasscore_modelname_ufmt.xml scoring files.

Default SAS_MODEL_TABLE
Requirements The maximum table name length is 30 characters, and it must be a valid SAP HANA table name.
If the table name is case sensitive, you must enclose the name in double quotation marks and set the INDCONN macro variable’s PRESERVE_TAB_NAMES argument to YES.
Interactions If the name of the model table is not fully qualified in the macro call, the table is created in the schema specified in either the INDCONN macro variable or the user’s default schema.
The table name that you specify for this macro must be the same table name that is used in the %INDHN_PUBLISH_MODEL and the %INDHN_RUN_MODEL macros.
See %INDHN_PUBLISH_MODEL Macro Syntax
INDCONN Macro Variable

ACTION = CREATE | REPLACE | DROP

specifies one of the following actions that the macro performs:

CREATE

creates a new table.

Tip If the table has been previously defined and you specify ACTION=CREATE, an error is issued.

REPLACE

overwrites the current table, if a table with the same name is already registered.

Tip If you specify ACTION=REPLACE, and the current table contains sasscore_modelname.ds2 and sasscore_modelname_ufmt.xml files, the files are deleted and an empty table is re-created.

DROP

causes all models in this table to be dropped.

Default CREATE