IBM Support

Modeler Batch Examples

Question & Answer


Question

Are there any examples of Modeler Batch syntax?

Answer

It is possible to run SPSS Modeler from a command line, without the graphical user interface (GUI). 

Modeler Batch is embedded within Modeler Client, and also Modeler Batch is also available as a separate product installation.

If you have Modeler client you can use the clemb.exe app in Modeler Client's bin directory and run against the local server. 

Some examples including Modeler Batch:

Example 1: (local Modeler Client only)
Run the druglearn stream saved to the C: drive without opening the Modeler client GUI interface.

 clemb -stream c:\druglearn.str -execute


Example 2 (From Modeler Client machine)
The following commands will execute the stream called druglearn on a Modeler server (Windows) without opening the Modeler client GUI interface.

 clemb -server -hostname <HOSTNAME> -port 28051 -username <USERNAME> - password <PASSWORD> -stream c:\druglearn.str - execute


Example 3

(Modeler Batch is installed and command initiated from Modeler Batch and connecting to a Modeler Server. This is Modeler Batch as a separate product installation - same syntax as #2)


In this example, there is no need for a Modeler client to be installed. A Modeler Server does need to be installed. It can be installed on the same server where Modeler Batch is installed or on a separate server.

 clemb -server -hostname <HOSTNAME> -port 28051 -username <USERNAME> - password <PASSWORD> -stream c:\druglearn.str - execute


Example 4: (From Modeler Client clemb or Modeler Batch product clemb)


In this example, a Database Source Node is being used. Only one Database Node exists in the stream so no unique identifiers are required.

 clemb -server -hostname <HOSTNAME> -port 28051 -username <USERNAME> - password <PASSWORD> -stream c:\druglearn.str -P:databasenode.datasource={"ORA10gR2", user1, mypsw, true} -execute

Example 5: (From Modeler client or Modeler Batch)
This example runs MODEL2.str and demonstrates having 3 Database nodes (1 source DB node 2 export DB nodes) within the stream visible on the Canvas. It also demonstrates protecting passwords having special characters as the actual value is listed for this example.
Note ibm_src1, ibm_tgt1, ibm_tgt2 are the unique Node Names used in the syntax to identify the node/DSN/Credentials association. There can be two source database nodes and one database export node. Simply ensure the proper node type is specified ( src/exp ).

 

clemb -stream C:\MODEL2.str
-Pibm_src1:databasenode.datasource={"ibm_src",<mydbuser>,\"mypa$$word\",false}
-Pibm_tgt1:databaseexport.datasource={"ibm_target",<mydbuser>,\"mypa$$word\",false}
-Pibm_tgt2:databaseexport.datasource={"ibm_target",<mydbuser>,\"mypa$$word\",false} -execute

  

DATABASE PARAMETER CORE SYNTAX example

  

clemb -stream <path to stream>
-P<nodename>:databasenode.datasource={"<DSN>",<dbuser>,<dbpassword>,false}
-P<nodename>:databaseexport.datasource={"<DSN>",<dbuser>,<dbpassword>,false}
- execute

  

<nodename> is defined within the subject node's Annotation tab.
DSN is the datasource defined on the system executing the stream.

databasenode indicates a “source database” type Node.
databaseexport indicates an “export database” type Node.

Example 6:

Modeler Client Automating Database credential configuration in a "SUPER NODE" script (Not a stream script). The following statements reside in a Super Node script. In this example, the stream can run in Modeler Batch without prompting for credentials.


The database node that imports the data set into the stream is within a Super Node. The name of that Super Node is "DataPrep". The output database node (ID id76NNQ45BBWY) is within a supernode .


The following is an example of how to define this scenario within a stream script. Each DB node is referencing the same DSN and credentials.

  

set DataPrep.parameters.':databasenode.username' = "theusername"
set DataPrep.parameters.':databasenode.password' = "testpassword"
execute @id76NNQ45BBWY

  

When the script is set to run automatically on script execution, there is no password prompts when running in batch mode. No extra arguments needed in DOS windows cmd calling the clemb.exe to execute the stream.

Example 7: (easier to read a simple database node example)

  
clemb
-server
-hostname HOST
-port PORT(28057)
-username USER
-password PW
-stream "C:\PATHTO\STREAM.str"
-PDatabase:databasenode.datasource=DS_NAME
-PDatabase:databasenode.username=DB_ADMIN
-PDatabase:databasenode.password=DB_PW
-execute
-log "C:\PATHTO\LOG.log"

 

For more information on Modeler Batch, clemb, and command line arguments please see: IBM SPSS Modeler Batch User’s Guide for you product version of which you can find here:
https://www.ibm.com/docs/en/spss-modeler/18.2.2?topic=mode-using-parameters-in-batch

[{"Product":{"code":"SS3RA7","label":"IBM SPSS Modeler"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Modeler","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"Not Applicable","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
14 May 2021

UID

swg21616349