Using Parameters in Batch Mode

You can modify the effect of executing a stream in batch mode by supplying parameters to the command line launch of IBM® SPSS® Modeler. These might be simple parameters used directly in CLEM expressions, or they might be node properties, also called slot parameters, which are used to modify the settings of nodes in the stream.

For example, the following stream selects a subset of data from a file, passes it through a neural net, and sends the results to a file:

Figure 1. Stream operations in the user interface
Stream operations in the user interface

The value of the field Month determines the selected data; the expression in the Select node is:

 Month == '$P-mth'

When running the same stream in batch mode, select the appropriate month by setting the value of the parameter mth in the command line:

clemb -server -hostname myserver -port 80 
-username dminer -password 1234 
-stream predict.str -Pmth=Jan -execute

Note: In command line arguments, the -P flag is used to denote a parameter.

Sometimes the required command line control of the stream involves modifying the settings of the nodes in the stream using slot parameters. Consider the following stream, which reads a file, processes its contents, and sends a report to another file:

Figure 2. Stream operations in the user interface
Stream operations in the user interface

Suppose that you want to generate the report once a month, reading the appropriate month's data and sending the report to a file whose name indicates the relevant month. You might want to set the filenames for the source data and for the report. The following command sets the appropriate slot parameters and executes the stream:

clemb -stream report.str -Porder.full_filename=APR_orders.dat 
-Preport.filename=APR_report.txt -execute 

Note: This command does not contain the operating-system-specific code that schedules it to run monthly.