Aster nCluster Scoring Files

The %INDAC_PUBLISH_MODEL macro produces three scoring files for each model:
  • sasscore_modelname.ds2, which contains code that is executed by the SAS_SCORE() function
  • sasscore_modelname_io.xml, which contains the scoring model's input and output variables
  • sasscore_modelname_ufmt.xml, which contains user-defined format's for the scoring model that is being published
These files are inserted into the NC_INSTALLED_FILES table under the PUBLIC schema. See Scoring File Examples for an example of each of these files.
There are four ways to see the scoring files that are created:
  • You can log on to the database using the Aster nCluster command line processor and submit an SQL statement. The following example assumes that the model name that you used to create the scoring files is reg.
    >act -h hostname -u username -w password -d databasename
    >select name from public.nc_installed_files where name like 'sasscore_reg%';
    Three files are listed for each model:
        name
    -------------------------
     sasscore_reg.ds2
     sasscore_reg_io.xml
     sasscore_reg_ufmt.xml
  • From SAS, you can use SQL procedure code that produces output in the LST file. The following example assumes that the model name that you used to create the scoring functions is reg.
    proc sql noerrorstop;
      connect to aster (user=username password=password dsn=dsnname);
      
    select *
       from connection to aster
          (select name, owner, uploadtime
             from public.nc_installed_files where
                name like 'sasscore_reg%');
       disconnect from aster;
    quit;
    
    You can also use the SASTRACE and SASTRACELOC system options to generate tracing information. For more information about these system options, see the SAS 9.2 Language Reference: Dictionary.
  • You can look at the SampleSQL.txt file that is produced when the %INDAC_PUBLISH_MODEL macro is successfully run. This file can be found in the output directory (OUTDIR argument) that you specify in the %INDAC_PUBLISH_MODELmacro.
    The SampleSQL.txt file contains basic code that, with modifications, can be used to run your score code inside Aster nCluster.
    Note: The function and table names must be fully qualified if the functions and tables are not in the same database.
    For example, the SampleSQL.txt file refers to an ID column in allmush1_intab that is populated with a unique integer from 1 to n, with n being the number of rows in the table. The ID column uniquely identifies each row. You would replace the ID column with your own primary key column.
    The following example assumes that the model name that you used is reg.
    drop table score_outtab;
    create table score_outtab(
     id integer
    ,"EM_CLASSIFICATION" varchar(256)
    ,"EM_EVENTPROBABILITY" float
    ,"EM_PROBABILITY" float
    );
    insert into score_outtab(
     id
    ,"EM_CLASSIFICATION"
    ,"EM_EVENTPROBABILITY"
    ,"EM_PROBABILITY"
    )
    select id,
    "EM_CLASSIFICATION",
    "EM_EVENTPROBABILITY",
    "EM_PROBABILITY"
    from sas_score(on score_intab model('reg'));
    
  • You can look at the SAS log. A message that indicates whether the scoring files are successfully or not successfully created is printed to the SAS log.