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. Populate the directory with the score.sas file, the score.xml file, and, if needed, the format catalog.
  3. Start SAS and submit one of the following commands in the Program Editor or Enhanced Editor:
    %let indconn = user=myuserid password=XXXX
    dsn=ncluster <schema=myschema>;
    %let indconn = user=myuserid password=XXXX server=myserver
     database=mydatabase <schema=myschema>;
    For more information, see the 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.

INDCONN Macro Variable

The INDCONN macro variable is used to provide credentials to connect to Aster. 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 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 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 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 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 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 4.6. For Aster 4.5, the scoring model XML files are published to the PUBLIC schema.
Requirement Any schema that is used must be in the search path.
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

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.
See Special Characters in Directory Names

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 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 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. For Aster 4.5, this file is stored in the NC_INSTALLED_FILES table under the PUBLIC schema. For Aster 4.6, this file is stored in the NC_USER_INSTALLED_FILES table under the schema that you specified in the INDCONN macro variable.

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 1660.
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. For Aster 4.5, this file is stored in the NC_INSTALLED_FILES table under the PUBLIC schema. For Aster 4.6, this file is stored in the NC_USER_INSTALLED_FILES table under the schema that you specified in the INDCONN macro variable.

DATABASE=database-name

specifies the name of an Aster 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 either the NC_INSTALLED_FILES table (Aster 4.5) or the NC_USER_INSTALLED_FILES table (Aster 4.6) in the database.

Default CREATE
Tip If the scoring files have been previously defined and you specify ACTION=CREATE, you receive warning messages from Aster. 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 Scoring Files.
Tip This argument is useful to debug a scoring model that fails to be published.
See Special Characters in Directory Names

Model Publishing Macro Example

%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 using the SAS_SCORE() function. For more information, see SAS_SCORE() Function.

Aster Permissions

For Aster 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 4.6, the following permissions are needed for the schema by the person who runs the scoring publishing macros.
  • USAGE permission
  • INSTALL FILE permission
  • CREATE permission
These permissions are needed because all functions and files can be published to a specific schema. 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 Aster Permissions in SAS In-Database Products: Administrator's Guide.