IBM SPSS Modeler 14.2 Solution Publisher
IBM SPSS Modeler 14.2 Solution Publisher
IBM SPSS Modeler 14.2 Solution Publisher
This edition applies to IBM SPSS Modeler 14 and to all subsequent releases and modifications
until otherwise indicated in new editions.
Adobe product screenshot(s) reprinted with permission from Adobe Systems Incorporated.
Microsoft product screenshot(s) reprinted with permission from Microsoft Corporation.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP
Schedule Contract with IBM Corp.
Preface
IBM® SPSS® Modeler is the IBM Corp. enterprise-strength data mining workbench. SPSS
Modeler helps organizations to improve customer and citizen relationships through an in-depth
understanding of data. Organizations use the insight gained from SPSS Modeler to retain
profitable customers, identify cross-selling opportunities, attract new customers, detect fraud,
reduce risk, and improve government service delivery.
SPSS Modeler’s visual interface invites users to apply their specific business expertise, which
leads to more powerful predictive models and shortens time-to-solution. SPSS Modeler offers
many modeling techniques, such as prediction, classification, segmentation, and association
detection algorithms. Once models are created, IBM® SPSS® Modeler Solution Publisher
enables their delivery enterprise-wide to decision makers or to a database.
As part of this portfolio, IBM SPSS Predictive Analytics software helps organizations predict
future events and proactively act upon that insight to drive better business outcomes. Commercial,
government and academic customers worldwide rely on IBM SPSS technology as a competitive
advantage in attracting, retaining and growing customers, while reducing fraud and mitigating
risk. By incorporating IBM SPSS software into their daily operations, organizations become
predictive enterprises – able to direct and automate decisions to meet business goals and achieve
measurable competitive advantage. For further information or to reach a representative visit
http://www.ibm.com/spss.
Technical support
Technical support is available to maintenance customers. Customers may contact Technical
Support for assistance in using IBM Corp. products or for installation help for one of the
supported hardware environments. To reach Technical Support, see the IBM Corp. web site
at http://www.ibm.com/support. Be prepared to identify yourself, your organization, and your
support agreement when requesting assistance.
iv
5 IBM SPSS Modeler Solution Publisher Runtime Library API
Reference 19
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
API Process Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
API Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Appendix
A Notices 33
Index 36
v
Chapter
1
About IBM SPSS Modeler
IBM® SPSS® Modeler is a set of data mining tools that enable you to quickly develop predictive
models using business expertise and deploy them into business operations to improve decision
making. Designed around the industry-standard CRISP-DM model, SPSS Modeler supports the
entire data mining process, from data to better business results.
SPSS Modeler offers a variety of modeling methods taken from machine learning, artificial
intelligence, and statistics. The methods available on the Modeling palette allow you to derive
new information from your data and to develop predictive models. Each method has certain
strengths and is best suited for particular types of problems.
SPSS Modeler can be purchased as a standalone product, or used in combination with SPSS Modeler
Server. A number of additional options are also available, as summarized in the following sections.
For more information, see http://www.ibm.com/software/analytics/spss/products/modeler/.
Chapter 1
SPSS Modeler Solution Publisher, for real-time or automated scoring outside the SPSS
Modeler environment. For more information, see the topic IBM SPSS Modeler Solution
Publisher in Chapter 2 on p. 5.
Adapters to enable deployment to IBM SPSS Collaboration and Deployment Services or
the thin-client application IBM SPSS Modeler Advantage. For more information, see the
topic Storing and Deploying IBM SPSS Collaboration and Deployment Services Repository
Objects in Chapter 9 in IBM SPSS Modeler 14.2 User’s Guide.
Complete documentation for each product in PDF format is available under the \Documentation
folder on each product DVD.
IBM SPSS Modeler User’s Guide. General introduction to using SPSS Modeler, including how
to build data streams, handle missing values, build CLEM expressions, work with projects and
reports, and package streams for deployment to IBM SPSS Collaboration and Deployment
Services, Predictive Applications, or IBM SPSS Modeler Advantage.
IBM SPSS Modeler Source, Process, and Output Nodes. Descriptions of all the nodes used to
read, process, and output data in different formats. Effectively this means all nodes other
than modeling nodes.
IBM SPSS Modeler Modeling Nodes. Descriptions of all the nodes used to create data mining
models. IBM® SPSS® Modeler offers a variety of modeling methods taken from machine
learning, artificial intelligence, and statistics. For more information, see the topic Overview
of Modeling Nodes in Chapter 3 in IBM SPSS Modeler 14.2 Modeling Nodes.
3
IBM SPSS Modeler Algorithms Guide. Descriptions of the mathematical foundations of the
modeling methods used in SPSS Modeler.
IBM SPSS Modeler Applications Guide. The examples in this guide provide brief, targeted
introductions to specific modeling methods and techniques. An online version of this guide is
also available from the Help menu. For more information, see the topic Application Examples
in IBM SPSS Modeler 14.2 User’s Guide.
IBM SPSS Modeler Scripting and Automation. Information on automating the system through
scripting, including the properties that can be used to manipulate nodes and streams.
IBM SPSS Modeler Deployment Guide. Information on running SPSS Modeler streams and
scenarios as steps in processing jobs under IBM® SPSS® Collaboration and Deployment
Services Deployment Manager.
IBM SPSS Modeler CLEF Developer’s Guide. CLEF provides the ability to integrate third-party
programs such as data processing routines or modeling algorithms as nodes in SPSS Modeler.
IBM SPSS Modeler In-Database Mining Guide. Information on how to use the power of your
database to improve performance and extend the range of analytical capabilities through
third-party algorithms.
IBM SPSS Modeler Server and Performance Guide. Information on how to configure and
administer IBM® SPSS® Modeler Server.
IBM SPSS Modeler Administration Console User Guide. Information on installing and using the
console user interface for monitoring and configuring SPSS Modeler Server. The console is
implemented as a plug-in to the Deployment Manager application.
IBM SPSS Modeler Solution Publisher Guide. SPSS Modeler Solution Publisher is an add-on
component that enables organizations to publish streams for use outside of the standard
SPSS Modeler environment.
IBM SPSS Modeler CRISP-DM Guide. Step-by-step guide to using the CRISP-DM methodology
for data mining with SPSS Modeler.
Application Examples
While the data mining tools in SPSS Modeler can help solve a wide variety of business and
organizational problems, the application examples provide brief, targeted introductions to specific
modeling methods and techniques. The data sets used here are much smaller than the enormous
data stores managed by some data miners, but the concepts and methods involved should be
scalable to real-world applications.
You can access the examples by clicking Application Examples on the Help menu in SPSS
Modeler. The data files and sample streams are installed in the Demos folder under the product
installation directory. For more information, see the topic Demos Folder in IBM SPSS Modeler
14.2 User’s Guide.
Database modeling examples. See the examples in the IBM SPSS Modeler In-Database Mining
Guide.
Scripting examples. See the examples in the IBM SPSS Modeler Scripting and Automation Guide.
4
Chapter 1
Demos Folder
The data files and sample streams used with the application examples are installed in the Demos
folder under the product installation directory. This folder can also be accessed from the IBM
SPSS Modeler 14.2 program group on the Windows Start menu, or by clicking Demos on the list of
recent directories in the File Open dialog box.
Figure 1-1
Selecting the Demos folder from the list of recently-used directories
Chapter
2
IBM SPSS Modeler Solution Publisher
IBM® SPSS® Modeler Solution Publisher is a powerful tool for integrating your data mining
results into your business process to solve real-world problems. Using SPSS Modeler Solution
Publisher, you can create a “packaged” version of a stream that can be executed by an external
Runtime engine or embedded in an external application. This allows you to deploy your data
modeling streams in a production environment to support your everyday business processes and to
empower your organization’s decision makers with the knowledge gained from mining your data.
Using SPSS Modeler Solution Publisher offers more power than simply exporting the model
(as PMML), because it allows you to publish and deploy complete IBM® SPSS® Modeler
streams. That means you can perform data preparation as well as record and field operations, such
as aggregating data, selecting records, or deriving new fields, before creating predictions based
on a model. You can then further process the model results before saving the data—all simply
by executing the published stream.
Note: Publishing is achieved by using the Publish tab of the appropriate export node. For more
information, see the topic Publishing Streams on p. 6. Streams saved in releases prior to version
11.0 of the product used a separate Publisher node. The node is still supported for backwards
compatibility, but is no longer available on the node palette.
Publishing. As you work through the data mining process, you will eventually arrive at a model
that provides a good solution to your business problem. At that point, you are ready to take that
model and apply it to your business process. When you publish a stream, a detailed description of
© Copyright IBM Corporation 1994, 2011. 5
6
Chapter 2
the stream is written to the disk (as an image file and a parameter file). For more information, see
the topic Publishing Streams on p. 6.
Executing. After you’ve published the stream, you can re-create the process implemented in the
stream by executing the published stream. This is done either by using the standalone IBM®
SPSS® Modeler Runtime (modelerrun.exe) or by developing an application that uses the SPSS
Modeler Runtime Library to execute the stream. To execute streams outside of SPSS Modeler
(using the Runtime or a custom application), you must first install the IBM® SPSS® Modeler
Solution Publisher Runtime. For more information, see the topic Installing the Runtime in
Chapter 4 on p. 13.
Publishing Streams
Publishing streams is done directly from IBM® SPSS® Modeler using any of the standard
export nodes: Database, Flat File, Statistics Export, IBM® SPSS® Data Collection Export, SAS
Export, Excel, and XML Export nodes. The type of export node determines the format of the
results to be written each time the published stream is executed using the IBM® SPSS® Modeler
Solution Publisher Runtime or external application. For example, if you want to write your
results to a database each time the published stream is run, use a Database export node. For more
information, see the topic Overview of Export Nodes in Chapter 7 in IBM SPSS Modeler 14.2
Source, Process, and Output Nodes.
To Publish a Stream
E Open or build a stream in the normal manner and attach an export node at the end.
E On the Publish tab in the export node, specify a rootname for the published files (that is, the
filename to which the various extensions .pim, .par and .xml will be appended)..
E Click the Publish button to publish the stream, or select Publish the stream to automatically publish
the stream each time the node is executed.
7
Figure 2-2
Publish tab
Published name. Specify the rootname for the published image and parameter files.
The image file (*.pim) provides all of the information needed for the Runtime to execute the
published stream exactly as it was at the time of export. If you are confident that you will not
need to change any of the settings for the stream (such as the input data source or the output
data file), you can deploy the image file only.
The parameter file (*.par) contains configurable information about data sources, output files,
and execution options. If you want to be able to control the input or output of the stream
without republishing the stream, you will need the parameter file as well as the image file.
The metadata file (*.xml) describes the inputs and outputs of the image and their data models.
It is designed for use by applications which embed the runtime library and which need to
know the structure of the input and output data.
Note: This file is only produced if you select the Publish metadata box.
Publish parameters. If required, you can include stream parameters in the *.par file. You can
change these stream parameter values when you execute the image either by editing the *.par file
or through the runtime API.
This check box enables the Parameters button. The Publish Parameters dialog box is displayed
when you click the button.
8
Chapter 2
Figure 2-3
Parameter selection
Choose the parameters you want to include in the published image by selecting the relevant check
box in the Publish column.
On stream execution. Specifies whether the stream is automatically published when the node is
executed.
Export data. Executes the export node in the standard manner, without publishing the stream.
(Basically the node executes in SPSS Modeler the same way it would if IBM® SPSS®
Modeler Solution Publisher were not available.) If you select this option, the stream will not
be published unless you do so explicitly by clicking the Publish button in the export node
dialog box. Alternatively, you can publish the current stream using the Publish tool on the
toolbar or by using a script.
Publish the stream. Publishes the stream for deployment using SPSS Modeler Solution
Publisher. Select this option if you want to automatically publish the stream every time
it is executed.
Comments
If you plan to run the published stream with new or updated data, it is important to note that
the order of fields in the input file must be the same as the order of fields in the source node
input file specified in the published stream.
When publishing to external applications, consider filtering extraneous fields or renaming
fields to conform with input requirements. Both can be accomplished using a Filter node prior
to the export node. For more information, see the topic Filtering or Renaming Fields in
Chapter 4 in IBM SPSS Modeler 14.2 Source, Process, and Output Nodes.
Chapter
3
Executing Published Streams
The main effect of executing a published stream is always to generate a set of data. The data may
be stored to a disk file or written to a database. Published streams cannot generate graphs, tables,
generated models, or other non-data output.
Streams published using IBM® SPSS® Modeler Solution Publisher can be executed using
the IBM® SPSS® Modeler Solution Publisher Runtime program. The Runtime program,
modelerrun.exe, is started from the command line, with options indicating the image file and
(optional) parameter file to execute. The Runtime command is as follows:
where
-nobanner suppresses the startup text message for the Runtime
(optional).
<parameter-file> is the filename of the parameter file (optional).
<options> is a comma-separated list of option=value pairs
specifying execution options for the Runtime. Options
are detailed below (optional).
<image-file> is the filename of the image file to execute (required).
Chapter 3
Parameter Purpose
filex.decimal_separator For text format files, the character used for the decimal point.
options.angle_in_radians Flag indicating whether radians are used as the unit of
measurement in trigonometric CLEM expressions. (The value is
“Y” or “N”.)
options.date_2digit_baseline Defines the century for dates specified with two-digit years.
options.date_baseline The baseline year (always January 1) used by CLEM date
functions that work with a single date.
options.time_rollover Flag indicating whether negative time differences refer to the
past.
options.decimal_separator The default decimal point character in text files.
options.time_format Time format used when strings are interpreted as times by
CLEM time functions.
options.date_format Date format used when strings are interpreted as dates by CLEM
date functions.
options.timestamp_format Format used when reading timestamp fields as strings from
ODBC data sources.
paramx.value Stream parameter value.
Note: The parameter name, description, and storage type are
included for reference but cannot be changed. The value must be
valid for the type.
CLEMRTL produces reports containing useful information that should be communicated back
to the application in some way. The CLEMRTL provides three mechanisms for dealing with
such messages:
Messages can be written to a log file specified with the clemrtl_setLogFile() function.
The application can retrieve details of the last error using the clemrtl_getErrorDetail() function.
The application can provide its own report-handling procedure using the
clemrtl_setReportHandler() function.
The Runtime system has a localized message catalog for reports. Any report passed to the
application would include the localized message string. Reports also include the report code so
that the application could choose to interpret and present the message differently. In order to get
12
Chapter 3
detailed (localized) messages, the application needs to ship the appropriate messages.cfg file in
a config directory. Different versions of messages.cfg for different locales can be found in the
directory <installdir>/config/<locale>, where <installdir> is the directory in which you installed
SPSS Modeler Solution Publisher, and <locale> is the desired locale. Select the appropriate
version of messages.cfg and add it to a config subdirectory in your project directory.
The Runtime system needs no special environment or registry settings to operate correctly.
Dependent libraries have to be distributed with an application linked to the CLEMRTL. These
files are included in the <installdir>/bin directory.
Requirements
Following are the platforms and compilers tested with the Runtime programming library:
Table 3-3
Platforms and compilers
Platform Suggested compiler(s)
AIX IBM XL C/C++ Enterprise Edition V8.0 for
AIX
HP-UX 11.0 aC++/ANSI C B3910B A.06.05
Solaris 64-bit Sun Studio 11 5.8 Patch 121017-06
Linux 32-bit and 64-bit gcc 3.2.3, Intel C++ compiler 9.1.043
Windows Visual Studio 2005
Note: On HP-UX, the application must be built with the aCC compiler flag “-AA” to enable
linking with the CLEMRTL libraries.
The information used by the example application is included in the \clemtrl\demo folder; see the
README.txt file for instructions. Compiling an application varies by platform, so example
makefiles are also included.
Chapter
4
Installing IBM SPSS Modeler Solution
Publisher Runtime
Installing the Runtime
When you purchase IBM® SPSS® Modeler Solution Publisher as an add-on component for
IBM® SPSS® Modeler, you will receive a separate installation disk. Use this disk to install the
IBM® SPSS® Modeler Solution Publisher Runtime, which allows you to execute published
streams. Published streams are independent of the operating system, so you can execute any
published stream on any platform supported by the Runtime.
Note: The functionality that allows you to publish streams from SPSS Modeler is installed with
IBM® SPSS® Modeler and can be enabled by purchasing a separate authorization code. Note
that Published files must be re-exported with each release of SPSS Modeler. For example a
file exported using an earlier release will not work with version 13 of SPSS Modeler Solution
Publisher Runtime.
System Requirements
The system requirements for installing the IBM® SPSS® Modeler Solution Publisher Runtime are:
Operating system. Windows Server 2008 R2 for 64-bit x64 systems; Windows Server 2003
Standard Edition R2 for 32-bit x86 or 64-bit x64 systems
IBM AIX® 6.1 or 7.1 for 64-bit POWER systems; HP-UX 11i V3 for 64-bit Itanium systems;
Oracle Solaris™ 9.x or 10 for 64-bit SPARC systems; Red Hat Enterprise Linux 5.x for 32-bit
x86 systems; Red Hat Enterprise Linux 5.x or 6.x for 64-bit x64 or IBM System z systems;
Red Hat Enterprise Linux Advanced Platform 5.x for 32-bit x86 systems; Red Hat Enterprise
Linux Advanced Platform 5.x or 6.x for 64-bit x64 or IBM System z systems; SuSE Linux
Enterprise Server 10 or 11 for 64-bit x64 or IBM System z systems
Hardware. Pentium® or Pentium-class processor or higher (for 32-bit Windows); x64 (AMD
64 and EM64T) processor family (for 64-bit Windows), running at 1GHz or faster
PowerPC processor, 233MHz or faster and IBM System p for IBM AIX; Itanium processor
for HP-UX; UltraSPARC II (or better) for Solaris; Pentium or Pentium-class processor or
higher for 32-bit Linux; x64 (AMD 64 and EM64T) processor family or IBM System z
for 64-bit Linux
Minimum free disk space. 1 gigabyte (GB) is recommended. 2 GB recommended if running
on HP-UX.
RAM. 4 GB is recommended.
Virtual environment. The following virtual environments support IBM® SPSS® Modeler
Server.
- IBM PowerVM Hypervisor for IBM AIX
- IBM PR/SM or z/VM for Linux for IBM System z
Chapter 4
Installing on Windows
The following section describes the procedure for installing the SPSS Modeler Solution Publisher
Runtime on the Windows operating system.
E Insert the IBM SPSS Modeler Solution Publisher installation disk into the drive.
E On the installation menu, choose Install IBM® SPSS® Modeler Solution Publisher Runtime or Install
IBM® SPSS® Modeler Solution Publisher Runtime for Win64, depending on the system to which
you are installing.
E Follow the instructions that appear on the screen. To continue, click Next.
E Once you have specified all options, you are ready to install. Click Install to begin transferring files.
Installing on UNIX
The following sections describe additional system requirements and the procedure for installing
the IBM® SPSS® Modeler Solution Publisher Runtime on the UNIX operating system.
You must ensure that kernel limits on the system are sufficient for the operation of IBM® SPSS®
Modeler Server. The data, memory, and file ulimits are particularly important and should be set to
unlimited within the SPSS Modeler Server environment. To do this:
ulimit –d unlimited
ulimit –m unlimited
ulimit –f unlimited
15
Solaris.
In addition to aforementioned system requirements, installing on Solaris also
requires the following version specific patches. Patches can be downloaded from
http://sunsolve.sun.com/pub-cgi/show.pl?target=patchpage.
Solaris 2.9 Patch IDs : 111711-16, 111712-16, and 111722-05 (C++)
Solaris 2.10 Patch IDs: 119963 (C++)
You must also have the library /usr/lib/iconv/646%UTF-8 installed on your system. If this is not
currently installed, please install the SUNWiniu8 or SUNWiniu8x packages, which will install this
library as part of the Indic iconv modules for UTF-8.
Linux 32–bit.
The following additional packages are needed to run properly. You can download these
packages from the Red Hat Network. You may need to register to access the network
(https://rhn.redhat.com/network/software/search.pxt). Use the search feature to search and drill
down to each specific package version.
The libstdc++ package (version: libstdc++-3.2.3-X.Y.i386 where X.Y is 22.1 or later).
The libgcc package (version: libgcc-3.2.3-X.Y.i386 where X.Y is 22.1 or later).
The compat-libstdc++ package (version: compat-libstdc++-33-3.2.3-X.Y.i386 where X.Y is
47.3 or later).
Linux 64–bit.
The following additional packages are needed to run properly. You can download these
packages from the Red Hat Network. You may need to register to access the network
(https://rhn.redhat.com/network/software/search.pxt). Use the search feature to search and drill
down to each specific package version.
The libstdc++ package (version: libstdc++-3.2.3-X.Y.x86_64 where X.Y is 22.1 or later).
The libgcc package (version: libgcc-3.2.3-X.Y.x86_64 where X.Y is 22.1 or later).
The compat-libstdc++ package (version: compat-libstdc++-33-3.2.3-X.Y.x86_64 where
X.Y is 47.3 or later).
AIX.
In addition to aforementioned system requirements, installing on AIX also requires the following:
XL C++ runtime should be at least at level 8.0.0.9 (lslpp -l xlC.rte). The filesets that contain
the libraries is called IBM C++ Runtime Environment Components for AIX and can be
downloaded from http://www.ibm.com/software/awdtools/xlcpp/support/.
XL FORTRAN runtime should be at least at level 10.1.0.4 (lslpp -l xlfrte).
The filesets that contain the libraries is called XL Fortran Enterprise
Edition V10.1 for AIX Runtime Environment and can be downloaded from
http://www.ibm.com/software/awdtools/fortran/xlfortran/support/.
HP-UX.
16
Chapter 4
In addition to aforementioned system requirements, installing on HP-UX also requires that C++
Runtime libraries be installed. You can download them as patch PHSS_26946, as shown in the
following table. To access the patches, go to http://www4.itrc.hp.com/service/patch/mainPage.do.
Registration is required but is free of charge.
These installation instructions apply to the IBM® SPSS® Modeler Solution Publisher Runtime
for UNIX. You need read and write permissions to the target installation directory, so log on
with an account that has sufficient permissions.
E Insert the installation disk into the drive and ensure that you can access the drive. On Solaris, the
volume manager (the vold daemon) must be running.
E Change directories to the DVD mount point.
./modelersolutionpublisherhpia64.bin -i console
E Licensing information is displayed. Read the license, type 1 to accept it, and press Enter to
continue.
E A list of available languages is displayed. Enter the number for the language version that you
want to install and press Enter to continue.
E You are prompted to type the installation location. To use the default directory,
/usr/IBM/SPSS/ModelerSolutionPublisher<nn> (where <nn> is the version number), press Enter.
The Runtime will be installed in the specified directory.
E You are prompted to confirm the installation location. When it is correct, type y and press Enter.
E A pre-installation summary is displayed to confirm your entries so far. Press Enter to continue.
E A message is displayed to say the installation routine is ready to run. Press Enter to continue.
E A progress bar is displayed whilst the installation routine runs. When the installation is complete,
press Enter to exit from the installer.
To execute the Runtime, type the following line at the command prompt:
modelerrun -p <parameter-file> -o <options> <image-file>
where
<parameter-file> is the filename of the published parameter file (optional).
<options> is a comma-separated list of option=value pairs specifying execution
options for the Runtime.
<image file> is the filename of the published image file (*.pim) to execute.
Note: When using multibyte languages such as Chinese or Japanese in a UNIX environment, you
must specify the language codes to be used. The following example shows the language codes for
Simplified Chinese:
./modelerrun -o locale="zh_CN.GB18030",encoding="GB18030" -p
This will direct the Runtime to use “C:\published\temp” as the temp directory for that specific
process only.
E From the list, select IBM® SPSS® Modeler Solution Publisher <nn>.
18
Chapter 4
E Click Remove.
E Follow the instructions that appear on the screen to remove the Runtime.
Note: You must be logged on to your computer with administrator privileges to remove programs.
5
IBM SPSS Modeler Solution Publisher
Runtime Library API Reference
Introduction
The CLEMRTL API allows you to control the execution of published streams from your
application. This section describes the available API functions.
E Execute the image using clemrtl_execute(). If the same image is to be executed multiple times
without changing parameters, use clemrtl_prepare() first.
E To retrieve information about the last error, use clemrtl_getErrorDetail(). To receive error messages
and other diagnostic messages as they arrive, use clemrtl_setReportHandler().
© Copyright IBM Corporation 1994, 2011. 19
20
Chapter 5
The library is designed for multithreaded use under the following conditions:
Global functions, those not taking an image handle as an argument, cannot be called
concurrently.
Image-local functions, those taking an image handle as an argument, cannot be called
concurrently when applied to the same image handle, with the exception of clemrtl_interrupt().
Image-local functions can be called concurrently when applied to different image handles.
In particular, this means that separate threads can prepare and execute images concurrently,
provided that they are using different image handles. Different image handles may refer to the
same image (clemrtl_openImage() creates a new handle each time it is called, even for the same
image), but be sure when executing multiple instances of the same image to change the image
parameters to redirect output as required. If two images executing concurrently both try to write to
the same output file or database table, the results will be unpredictable.
API Functions
initialise
initialise_ext(flags, 0, 0);
initialise_ext
int clemrtl_initialise_ext(
unsigned flags,
int arg_count,
const clemrtl_init_arg* args);
Initializes the IBM® SPSS® Modeler Solution Publisher Runtime. This function must be called
before any other API functions.
Parameter Description
flags Controls some aspects of the initialization process. The value is constructed
as a bitwise OR of the flags described below.
arg_count The number of additional initialization arguments. This must be less than or
equal to the length of the args array.
args Additional initialization arguments. Arguments are described by the type:
typedef struct _clemrtl_init_arg {
const char* name;
const char* value;
} clemrtl_init_arg;
21
The name field is the name of a configuration property and the value field is its value. The
following configuration properties are recognized:
Name Value
installation_directory The full path to the IBM® SPSS® Modeler Solution Publisher
installation folder. The installation folder is that containing the
bin and config folders.
The flags parameter provides control over certain aspects of the initialization process. A value of
0 (or CLEMRTL_INIT_DEFAULTS) specifies the default behavior as follows:
Set the default time zone by calling tzset().
Set the LC_NUMERIC locale to “C”.
Set the global new handler to throw an exception when memory is exhausted.
This behavior can be modified by specifying combinations of the following flags:
Flag Description
CLEMRTL_INIT_NO_TZ Don’t set the time zone.
CLEMRTL_INIT_NO_LOCALE Don’t change the locale.
CLEMRTL_INIT_NO_NEW_HANDLER Don’t set the new handler.
CLEMRTL_INIT_LOCAL_NEW_HANDLER Localize the new handler within each
API call.
The library requires that the LC_NUMERIC locale should be set to “C” in order to properly convert
between numbers and strings (the IBM® SPSS® Modeler number format uses the rules of the “C”
locale). This includes the conversion of numbers read from and written to text files.
Specify NO_LOCALE if your application depends on the LC_NUMERIC locale and does not
require conversion between numbers and strings.
NO_NEW_HANDLER and LOCAL_NEW_HANDLER are mutually exclusive. The library requires
that new should throw an exception when memory is exhausted.
Specify NO_NEW_HANDLER if your application sets its own new handler or if you are certain
that your compiler/Runtime system throws an exception by default.
Specify LOCAL_NEW_HANDLER only if your application relies on new returning a null pointer
when memory is exhausted. Note: This is not safe for use in a multithreaded environment.
getOption
int clemrtl_getOption(
const char* name,
char* value,
int value_size);
22
Chapter 5
The operation fails if the option name is not one of the execution option names listed above—for
example, memory_usage—or if the value buffer is not large enough to receive the value including
a terminating null character. Option values are always strings, even when the interpretation is
numeric. For more information, see the topic Executing Published Streams in Chapter 3 on p. 9.
setOption
int clemrtl_setOption(
const char* name,
const char* value);
The operation fails if the option name is not one of the execution option names listed above—for
example, memory_usage. Option values are always strings, even when the interpretation is
numeric.
setLogFile
int clemrtl_setLogFile(
int mode,
const char* log_file);
23
The operation fails if the mode is not one of the recognized modes or if file logging is requested
and the filename is not specified or is invalid.
openImage
int clemrtl_openImage(
const char* image_file,
const char* param_file,
clemrtl_image_handle* handle);
The parameter file can be NULL if a separate parameter file is not required. The operation fails
if the image file is not specified, if either filename is invalid, or if the content is unreadable. If
the operation succeeds, the returned image handle can be used to identify the image instance in
subsequent API calls.
24
Chapter 5
closeImage
int clemrtl_closeImage(
clemrtl_image_handle handle);
The operation fails if another API call is in progress on the image, particularly if the image is still
executing. If the operation succeeds, the image is closed and the handle cannot be used in any
subsequent API call except another call of clemrtl_closeImage(), which has no effect.
enumerateParameters
int clemrtl_enumerateParameters(
clemrtl_image_handle handle,
clemrtl_parameter_proc proc,
void* data);
Parameter Description
data User-specified data passed to clemrtl_enumeratePa-
rameters().
25
Parameter Description
name The parameter name.
value The parameter value.
The procedure is applied exactly once to each image parameter in an arbitrary order.
getParameter
int clemrtl_getParameter(
clemrtl_image_handle handle,
const char* name,
char* value,
int value_size);
The operation fails if the parameter name does not match the name of any parameter in the image
or if the value buffer is not large enough to receive the parameter value including a terminating
null character. Parameter names use the name.attribute format described above—for example,
file0.name—and parameter values are always strings, even when the interpretation is numeric.
setParameter
int clemrtl_setParameter(
clemrtl_image_handle handle,
const char* name,
const char* value);
Chapter 5
The operation fails if the image handle is invalid or if the parameter name does not match the
name of any parameter in the image. Parameter names use the name.attribute format described
above—for example, file0.name—and parameter values are always strings, even when the
interpretation is numeric.
getFieldCount
int clemrtl_getFieldCount(
clemrtl_image_handle handle,
const char* key,
size_t* field_count);
getFieldTypes
int clemrtl_getFieldTypes(
clemrtl_image_handle handle,
const char* key,
size_t field_count,
int* field_types);
Parameter Description
field_count The number of fields to examine. This must be less than or
equal to the length of the field_types array.
field_types An array of length at least field_count which receives the
field types. The types of the first field_count fields in the
input or output are copied into the array. If field_count is
greater than the actual number of fields the extra elements in
the array are left undefined. Values for the field types are
listed in the Data Types table below.
Data Types
setAlternativeInput
int clemrtl_setAlternativeInput(
clemrtl_image_handle handle,
const char* key,
size_t field_count,
int field_types,
void** (*iterator)(void* arg),
void* arg);
Chapter 5
Parameter Description
key The name of the original input source as used in the
parameters file. The input source must be a file so the key
will always have the form “fileN” for some integer N >= 0.
field_count The number of fields in the input. The value must match
exactly the number of fields in the original file input or the
call will fail.
field_types An array of types of length at least field_count. The value
field_types[i] is the type of the i’th field and must be one of
the values listed in the Data Types table below. The types
must be compatible with those of the original file input or
the call will fail.
iterator A function which produces the alternative input data. The
function is applied to its argument as follows:
void** row = iterator(arg);
Data Types
The field_types must be one from a restricted list of types. For more information, see the topic
getFieldTypes on p. 26.
The operation fails if the field types are not compatible with those of the original file input, or if
the field count does not exactly match the number of fields in the original file input.
setAlternativeOutput
int clemrtl_setAlternativeOutput(
clemrtl_image_handle handle,
const char* key,
size_t field_count,
int field_types,
29
Data Types
The field_types must be one from a restricted list of types. For more information, see the topic
getFieldTypes on p. 26.
The operation fails if the field types are not compatible with those of the original file output, or if
the field count does not exactly match the number of fields in the original file output.
30
Chapter 5
execute
int clemrtl_execute(clemrtl_image_handle handle);
Executes an image.
Parameter Description
handle The image handle.
If the image has not been prepared, it is prepared first using the current parameter values. The
operation fails if the image handle is invalid or if an error occurs during preparation or execution.
The call does not return until execution is complete.
prepare
int clemrtl_prepare(clemrtl_image_handle handle);
The operation fails if the image handle is invalid or if an error occurs during preparation.
An image must be prepared before it is executed. Preparing an image freezes parameter values
into the image. clemrtl_execute() prepares an image automatically on each call if it hasn’t
been prepared already; using clemrtl_prepare() to prepare an image is useful if the image is to
be executed multiple times with the same parameter values, and it can significantly improve
performance. Once an image has been prepared, subsequent changes to parameter values are
ignored; use clemrtl_prepare() again to update the image with the new parameter values.
interrupt
int clemrtl_interrupt(clemrtl_image_handle handle);
The operation has no effect if the image handle is invalid or if the image is not executing.
This function is safe to call concurrently with another API call on the same image handle.
getErrorDetail
int clemrtl_getErrorDetail(
clemrtl_image_handle handle,
char* severity,
int* code,
char* text,
int text_size);
Retrieves detailed information about the last error that occurred on an image.
Parameter Description
handle The image handle.
severity Receives the severity code as a single character:
I—information
W—warning
E—error
X—system error
code Receives the error number.
text A buffer to receive the message text.
text_size Size of the text buffer.
Results will be unreliable if the image handle is invalid. The message text is truncated if necessary
to fit in the text buffer.
If an API call fails with CLEMRTL_ERROR and the error is unrelated to a particular image
handle, passing 0 as the image handle will retrieve details of the last non-image-specific error but
is unreliable in a multithreaded environment.
setReportHandler
int clemrtl_setReportHandler(
clemrtl_image_handle handle,
clemrtl_report_proc proc,
void* data);
32
Chapter 5
Parameter Description
data User-specified data passed to clemrtl_setRe-
portHandler().
severity The severity code as a single character:
I—information
W—warning
E—error
X—system error
code The message number.
text The message text.
The procedure is applied to each message as it arrives. Setting the procedure to NULL removes
any existing handler installed on the image.
Appendix
A
Notices
This information was developed for products and services offered worldwide.
IBM may not offer the products, services, or features discussed in this document in other countries.
Consult your local IBM representative for information on the products and services currently
available in your area. Any reference to an IBM product, program, or service is not intended to
state or imply that only that IBM product, program, or service may be used. Any functionally
equivalent product, program, or service that does not infringe any IBM intellectual property right
may be used instead. However, it is the user’s responsibility to evaluate and verify the operation
of any non-IBM product, program, or service.
IBM may have patents or pending patent applications covering subject matter described in this
document. The furnishing of this document does not grant you any license to these patents.
You can send license inquiries, in writing, to:
IBM Director of LicensingIBM CorporationNorth Castle DriveArmonk, NY 10504-1785U.S.A.
For license inquiries regarding double-byte character set (DBCS) information, contact the IBM
Intellectual Property Department in your country or send inquiries, in writing, to:
Intellectual Property LicensingLegal and Intellectual Property LawIBM Japan Ltd.1623-14,
Shimotsuruma, Yamato-shiKanagawa 242-8502 Japan
The following paragraph does not apply to the United Kingdom or any other country where such
provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES
PROVIDES THIS PUBLICATION “AS IS” WITHOUT WARRANTY OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A
PARTICULAR PURPOSE. Some states do not allow disclaimer of express or implied warranties
in certain transactions, therefore, this statement may not apply to you.
This information could include technical inaccuracies or typographical errors. Changes are
periodically made to the information herein; these changes will be incorporated in new editions
of the publication. IBM may make improvements and/or changes in the product(s) and/or the
program(s) described in this publication at any time without notice.
Any references in this information to non-IBM Web sites are provided for convenience only and
do not in any manner serve as an endorsement of those Web sites. The materials at those Web sites
are not part of the materials for this IBM product and use of those Web sites is at your own risk.
IBM may use or distribute any of the information you supply in any way it believes appropriate
without incurring any obligation to you.
Licensees of this program who wish to have information about it for the purpose of enabling: (i) the
exchange of information between independently created programs and other programs (including
this one) and (ii) the mutual use of the information which has been exchanged, should contact:
IBM Software GroupAttention: Licensing233 S. Wacker Dr.Chicago, IL 60606USA
© Copyright IBM Corporation 1994, 2011. 33
34
Appendix A
Such information may be available, subject to appropriate terms and conditions, including in
some cases, payment of a fee.
The licensed program described in this document and all licensed material available for it are
provided by IBM under terms of the IBM Customer Agreement, IBM International Program
License Agreement or any equivalent agreement between us.
Any performance data contained herein was determined in a controlled environment. Therefore,
the results obtained in other operating environments may vary significantly. Some measurements
may have been made on development-level systems and there is no guarantee that these
measurements will be the same on generally available systems. Furthermore, some measurements
may have been estimated through extrapolation. Actual results may vary. Users of this document
should verify the applicable data for their specific environment.
Information concerning non-IBM products was obtained from the suppliers of those products,
their published announcements or other publicly available sources. IBM has not tested those
products and cannot confirm the accuracy of performance, compatibility or any other claims
related to non-IBM products. Questions on the capabilities of non-IBM products should be
addressed to the suppliers of those products.
All statements regarding IBM’s future direction or intent are subject to change or withdrawal
without notice, and represent goals and objectives only.
This information contains examples of data and reports used in daily business operations.
To illustrate them as completely as possible, the examples include the names of individuals,
companies, brands, and products. All of these names are fictitious and any similarity to the names
and addresses used by an actual business enterprise is entirely coincidental.
If you are viewing this information softcopy, the photographs and color illustrations may not
appear.
Trademarks
IBM, the IBM logo, ibm.com, and SPSS are trademarks of IBM Corporation, registered in
many jurisdictions worldwide. A current list of IBM trademarks is available on the Web at
http://www.ibm.com/legal/copytrade.hmtl.
Adobe, the Adobe logo, PostScript, and the PostScript logo are either registered trademarks or
trademarks of Adobe Systems Incorporated in the United States, and/or other countries.
IT Infrastructure Library is a registered trademark of the Central Computer and
Telecommunications Agency which is now part of the Office of Government Commerce.
Intel, Intel logo, Intel Inside, Intel Inside logo, Intel Centrino, Intel Centrino logo, Celeron, Intel
Xeon, Intel SpeedStep, Itanium, and Pentium are trademarks or registered trademarks of Intel
Corporation or its subsidiaries in the United States and other countries.
Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both.
Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft
Corporation in the United States, other countries, or both.
ITIL is a registered trademark, and a registered community trademark of the Office of Government
Commerce, and is registered in the U.S. Patent and Trademark Office.
35
Notices
UNIX is a registered trademark of The Open Group in the United States and other countries.
Cell Broadband Engine is a trademark of Sony Computer Entertainment, Inc. in the United States,
other countries, or both and is used under license therefrom.
Java and all Java-based trademarks and logos are trademarks of Sun Microsystems, Inc. in the
United States, other countries, or both.
Linear Tape-Open, LTO, the LTO Logo, Ultrium, and the Ultrium logo are trademarks of HP, IBM
Corp. and Quantum in the U.S. and other countries.
Other product and service names might be trademarks of IBM or other companies.
Index
API executing streams
alternative input, 27 using IBM SPSS Modeler Solution Publisher, 9–10
alternative output, 28
error codes, 19
execution options, 21–22 getErrorDetail
field count, 26 API function reference, 31
field types, 26 API process overview, 19
overview, 11, 19 getFieldCount
reference, 19 API function reference, 26
setReportHandler, 31 API process overview, 19
status codes, 19 getFieldTypes
API functions API function reference, 26
closeImage, 19, 24 API process overview, 19
enumerateParameters, 19, 24 getOption
execute, 19, 30 API function reference, 21
getErrorDetail, 19, 31 API process overview, 19
getFieldCount, 19, 26 getParameter
getFieldTypes, 19, 26 API function reference, 25
getOption, 19, 21 API process overview, 19
getParameter, 19, 25
initialising, 20
initializing, 19 IBM SPSS Modeler, 1
interrupt, 19, 30 documentation, 2
openImage, 19, 23 IBM SPSS Modeler Solution Publisher, 5–6
prepare, 19, 30 embedding in applications, 11
setAlternativeInput, 19, 27 overview, 5
setAlternativeOutput, 19, 28 IBM SPSS Modeler Solution Publisher Runtime
setLogFile, 19, 22 installing, 13
setOption, 19, 22 starting, 16
setParameter, 19, 25 system requirements, 13–14
setReportHandler, 19 temp directory, 17
application examples, 2 uninstalling, 17
IBM SPSS Text Analytics, 2
initialise
closeImage API function reference, 20
API function reference, 24 flags, 20
API process overview, 19 initialise_ext
closing API function reference, 20
streams, 24 flags, 20
initialize
API process overview, 19
deployment, 5 interrupt
documentation, 2 API function reference, 30
API process overview, 19
enumerateParameters
API function reference, 24 legal notices, 33
API process overview, 19 locale
error codes, 19 set using the API, 20
error reporting log files, 22
API function reference, 22, 31
examples
Applications Guide, 2 openImage
overview, 3 API function reference, 23
execute API process overview, 19
API function reference, 30 opening
API process overview, 19 streams, 23
36
37
Index
Runtime
options, 9
starting, 16
temp directory, 17
uninstalling, 17
UNIX installation, 14
Windows installation, 14
Runtime programming library (CLEMRTL), 11
setAlternativeInput
API function reference, 27
API process overview, 19
setAlternativeOutput
API function reference, 28
API process overview, 19
setLogFile
API function reference, 22
API process overview, 19
setOption
API function reference, 22
API process overview, 19
setParameter
API function reference, 25
API process overview, 19
setReportHandler
API function reference, 31
API process overview, 19
SPSS Modeler Server, 1
status codes, 19
temporary directory
IBM SPSS Modeler Solution Publisher Runtime, 17
time zone
set using the API, 20
trademarks, 34
uninstalling
IBM SPSS Modeler Solution Publisher Runtime, 17
UNIX
installing IBM SPSS Modeler Solution Publisher
Runtime, 14