Running the %INDAC_PUBLISH_MODEL Macro

%INDAC_PUBLISH_MODEL Macro Run Process

To run the %INDAC_PUBLISH_MODEL macro, complete the following steps:
  1. Create a scoring model using SAS Enterprise Miner.
  2. Use the SAS Enterprise Miner Score Code Export node to create a score output directory and populate the directory with the score.sas file, the score.xml file, and (if needed) the format catalog.
  3. Start SAS 9.3 and submit one of these following sets of commands in the Program Editor or Enhanced Editor:
    %indacpm;
    %let indconn = user=myuserid password=XXXX
    dsn=ncluster <schema=myschema>;
    %indacpm;
    %let indconn = user=myuserid password=XXXX server=myserver
     database=mydatabase <schema=myschema>;
    For more information, see %INDACPM Macro, and INDCONN Macro Variable.
  4. Run the %INDAC_PUBLISH_MODEL macro.
    Messages are written to the SAS log that indicate the success or failure of the creation of the .ds2 and .xml scoring files.
    For more information, see %INDAC_PUBLISH_MODEL Macro Syntax.

%INDACPM Macro

The %INDACPM macro searches the autocall library for the indacpm.sas file. The indacpm.sas file contains all the macro definitions that are used in conjunction with the %INDAC_PUBLISH_MODEL macro. The indacpm.sas file should be in one of the directories listed in the SASAUTOS= system option in your configuration file. If the indacpm.sas file is not present, the %INDACPM macro call (%INDACPM; statement) issues the following message:

INDCONN Macro Variable

The INDCONN macro variable is used to provide credentials to connect to Aster nCluster. You must specify user, password, and either a DSN name or a server and database name. You must assign the INDCONN macro variable before the %INDAC_PUBLISH_MODEL macro is invoked.
The value of the INDCONN macro variable for the %INDAC_PUBLISH_MODEL macro has one of these formats:
USER=username PASSWORD=password DSN=dsnname <SCHEMA=schemaname>
USER=username PASSWORD=password DATABASE=databasename
SERVER=servername <SCHEMA=schemaname>
Arguments
USER=username
specifies the Aster nCluster user name (also called the user ID) that is used to connect to the database.
PASSWORD=password
specifies the password that is associated with your Aster nCluster user ID.
Tip:Use only PASSWORD=, PASS=, or PW= for the password argument. PWD= is not supported and causes an error.
DSN=datasourcename
specifies the configured Aster nCluster data source to which you want to connect.
Requirement:You must specify either the DSN= argument alone, or the SERVER= and DATABASE= arguments together in the INDCONN macro variable.
DATABASE=databasename
specifies the Aster nCluster database that contains the tables and views that you want to access.
Requirement:You must specify either the DSN= argument alone, or the SERVER= and DATABASE= arguments together in the INDCONN macro variable.
SERVER=servername
specifies the Aster nCluster server name or the IP address of the server host.
Requirement:You must specify either the DSN= argument alone, or the SERVER= and DATABASE= arguments together in the INDCONN macro variable.
SCHEMA=schemaname
specifies the schema name for the database.
Default:your default schema. To determine your default schema name, use the show search_path command from the Aster Client Tool (ACT).
Restriction:The SCHEMA argument is valid only for Aster nCluster 4.6. For Aster nCluster 4.5, the scoring model XML files are published to the PUBLIC schema.
Tip
The INDCONN macro variable is not passed as an argument to the %INDAC_PUBLISH_MODEL macro. This information can be concealed in your SAS job. You might want to place it in an autoexec file and set the permissions on the file so that others cannot access the user ID and password.

%INDAC_PUBLISH_MODEL Macro Syntax

%INDAC_PUBLISH_MODEL
(DIR=input-directory-path, MODELNAME=name
<, DATASTEP=score-program-filename>
<, XML=xml-filename>
<, DATABASE=database-name>
<, FMTCAT=format-catalog-filename>
<, ACTION=CREATE | REPLACE | DROP>
<, OUTDIR=diagnostic-output-directory>
);
Arguments
DIR=input-directory-path
specifies the directory where the scoring model program, the properties file, and the format catalog are located.
This is the directory that is created by the SAS Enterprise Miner Score Code Export node. This directory contains the score.sas file, the score.xml file, and, if user-defined formats were used, the format catalog.
Requirement:You must use a fully qualified pathname.
Interaction:If you do not use the default filenames that are created by SAS Enterprise Miner, you must specify the DATASTEP=, XML=, and (if needed) FMTCAT= arguments.
MODELNAME=name
specifies the name that becomes part of the .ds2 and .xml scoring filenames.
Restriction:The names of the .ds2 and .xml scoring files are a combination of the model and type of filenames. A scoring filename cannot exceed 63 characters. For more information, see Aster nCluster Scoring Files.
Requirement:The name must be a valid SAS name. For more information about valid SAS names, see the topic on rules for words and names in SAS Language Reference: Concepts.
Interaction:Only the EM_ output variables are published in the sasscore_modelname_io.xml file. For more information about the EM_ output variables, see Fixed Variable Names and Aster nCluster Scoring Files.
DATASTEP=score-program-filename
specifies the name of the scoring model program file that was created by using the SAS Enterprise Miner Score Code Export node.
Default:score.sas
Restriction: Only DATA step programs that are produced by the SAS Enterprise Miner Score Code Export node can be used.
Interactions: If you use the default score.sas file that is created by the SAS Enterprise Miner Score Code Export node, you do not need to specify the DATASTEP= argument.

The SAS file that is specified in the DATASTEP= argument is translated by the %INDAC_PUBLISH_MODEL macro into the sasscore_modelname.ds2 file and stored in the NC_INSTALLED_FILES table under either the PUBLIC schema (Aster nCluster 4.5) or the schema that you specified in the INDCONN macro variable (Aster nCluster 4.6).

XML=xml-filename
specifies the name of the properties XML file that was created by the SAS Enterprise Miner Score Code Export node.
Default: score.xml
Restrictions: Only XML files that are produced by the SAS Enterprise Miner Score Code Export node can be used.

The maximum number of output variables is 128.

Interactions:If you use the default score.xml file that is created by the SAS Enterprise Miner Score Code Export node, you do not need to specify the XML= argument.

The XML file is renamed to sasscore_modelname_io.xml by the %INDAC_PUBLISH_MODEL macro and the file is stored in the NC_INSTALLED_FILES table under either the PUBLIC schema (Aster nCluster 4.5) or the schema that you specified in the INDCONN macro variable (Aster nCluster 4.6).

DATABASE=database-name
specifies the name of an Aster nCluster database to which the scoring functions and formats are published.
Restriction:If you specify DSN= in the INDCONN macro variable, do not use the DATABASE argument.
Interaction:The database that is specified by the DATABASE argument takes precedence over the database that you specify in the INDCONN macro variable. For more information, see %INDAC_PUBLISH_MODEL Macro Run Process.
Tip:You can publish the scoring files to a shared database where other users can access them.
FMTCAT=format-catalog-filename
specifies the name of the format catalog file. The file contains all user-defined formats that were created by the FORMAT procedure and that are referenced in the DATA step scoring model program.
Restriction:Only format catalog files that are produced by the SAS Enterprise Miner Score Code Export node can be used.
Interactions:If you use the default format catalog that is created by the SAS Enterprise Miner Score Code Export node, you do not need to specify the FMTCAT= argument.

If you do not use the default catalog name (FORMATS) or the default library (WORK or LIBRARY) when you create user-defined formats, you must use the FMTSEARCH system option to specify the location of the format catalog. For more information, see PROC FORMAT in the Base SAS Procedures Guide.

ACTION=CREATE | REPLACE | DROP
specifies one of the following actions that the macro performs:
CREATE
creates the sasscore_modelname.ds2, sasscore_modelname_io.xml, and sasscore_modelname_ufmt.xml files.
REPLACE
overwrites the current sasscore_modelname.ds2, sasscore_modelname_io.xml, and sasscore_modelname_ufmt.xml files, if those files by the same name are already registered.
DROP
causes the sasscore_modelname.ds2, sasscore_modelname_io.xml, and sasscore_modelname_ufmt.xml files to be dropped from the NC_INSTALLED_FILES table in the Aster nCluster database.
Default:CREATE
Tip:If the scoring files have been previously defined and you specify ACTION=CREATE, you receive warning messages from Aster nCluster. If the scoring files have been previously defined and you specify ACTION=REPLACE, no warnings are issued.
OUTDIR=diagnostic-output-directory
specifies a directory that contains diagnostic files.
Files that are produced include an event log that contains detailed information about the success or failure of the publishing process and sample SQL code (SampleSQL.txt). For more information about the SampleSQL.txt file, see Aster nCluster Scoring Files.
Tip:This argument is useful to debug a scoring model that fails to be published.

Model Publishing Macro Example

%indacpm;
%let indconn = server=yoursvr user=user1 password=open1
    database=yourdb schema=yoursch;
%indac_publish_model( dir=C:\SASIN\score, modelname=score);
The %INDAC_PUBLISH_MODEL macro produces these three files:
After the scoring files are installed, they can be invoked in Aster nCluster using the SAS_SCORE() function. For more information, see SAS_SCORE() Function.

Aster nCluster Permissions

For Aster nCluster 4.5, no permissions are needed by the person who runs the scoring publishing macros, because all functions and files are published to the PUBLIC schema.
For Aster nCluster 4.6, the following permissions are needed for the schema by the person who runs the scoring publishing macros, because all functions and files can be published to a specific schema.
  • USAGE permission
  • INSTALL FILE permission
  • CREATE permission
Without these permissions, the publishing of the %INDAC_PUBLISH_MODEL macro fails. To obtain these permissions, contact your database administrator.
For more information about specific permissions, see the SAS In-Database Products: Administrator's Guide.