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.2 and submit the following commands in the Program Editor or Enhanced Editor:
    %indacpm;
    %let indconn = user=myuserid password=XXXX
    dsn=ncluster | server=myserver database=mydatabase;
    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:
    macro indacpm not defined
    The INDCONN macro variable is used to provide credentials to connect to Aster nCluster. The value of the INDCONN macro variable for the %INDAC_PUBLISH_MODEL macro has this format:
    USER=user PASSWORD=password connection-string
    The connection–string argument can be expressed in either of the following forms:
    • DSN=dsnname
    • SERVER=servername DATABASE=databasename
    You must specify user, password, and either a DSN name or a server and database name.
    Note: You can use only PASSWORD= or PW= for the password argument. Other aliases such as PASS= or PWD= are not supported and cause errors.
    You must assign the INDCONN macro variable before the %INDAC_PUBLISH_MODEL macro is invoked.
    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.
  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.

%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 9.2 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.
Interaction: 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.
Interaction: 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 the PUBLIC schema.
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
Restriction: Only XML files that are produced by the SAS Enterprise Miner Score Code Export node can be used.
Restriction: The maximum number of output variables is 128.
Interaction: 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.
Interaction: 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 the PUBLIC schema.
DATABASE=database-name
specifies the name of an Aster nCluster database to which the scoring functions and formats are published.
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.
Interaction: 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.
Interaction: 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 9.2 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 will 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=acbase user=user1 password=open1 database=nc3875;
%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.