Command line options

You can start IBM® SPSS® Statistics from the command line and include various switches to log on to an analytic server or to start production mode, among other options. The command is named stats and can be run from one of the following locations:

  • Windows: <installation directory>
  • Mac: <installation directory>/<version>.app/Contents/MacOS
  • Linux: <installation directory>/bin

Available Switches and Options

stats  [-server <inet:hostname:port>] [-user <name>] [-password <password>]
      [-switchserver]
      [-singleseat]
      [-nologo]
      [-production [silent|prompt] [-background]]
      [-symbol <values>]
      [<filename> [-filepassword <password>]] ...
      [-unicode [on|off]] 
      [-codepageSyntaxFiles [off|on|'encoding']]  
      [-help|-h]

-server <inet:hostname:port> or -server <ssl:hostname:port>. The name or IP address and port number of the server. Windows only.

-user <name>. A valid user name. If a domain name is required, precede the user name with the domain name and a backslash (\). Windows only.

-password <password>. The user's password.

-switchserver. Display the "Server Login" dialog box. This switch has precedence over the previous -server, -user, and -password switches. Windows only.

-singleseat. Start application in a single seat mode.

-nologo. Start the application without displaying the splash screen.

-production [prompt|silent]. Start the application in production mode. The prompt and silent keywords specify whether to display the dialog box that prompts for runtime values if they are specified in the job. The prompt keyword is the default and shows the dialog box. The silent keyword suppresses the dialog box. If you use the silent keyword, you can define the runtime symbols with the -symbol switch. Otherwise, the default value is used. The -switchserver and -singleseat switches are ignored when using the -production switch.

-symbol <values>. List of symbol-value pairs used in the production job. Each symbol name starts with @. Values that contain spaces should be enclosed in quotes. Rules for including quotes or apostrophes in string literals may vary across operating systems, but enclosing a string that includes single quotes or apostrophes in double quotes usually works (for example, “'a quoted value'”). The symbols must be defined in the production job using the Runtime Values tab. See the topic Runtime values for more information.

-background. Run the production job in the background on a remote server. Your local computer does not have to remain on and does not have to remain connected to the remote server. You can disconnect and retrieve the results later. You must also include the -production switch and specify the server using the -server switch.

<filename> .... List of filenames, which can include all application supported file types. Enclose a file name with double quotes if it contains spaces. If a file is password protected, follow the file name with the -filepassword switch and the password.

unicode. Turns Unicode mode on or off. The default is on. When Unicode mode is off, the application runs in code page mode.

codepageSyntaxFiles. Determines the encoding used to read command syntax files.

  • off. If the absence of an encoding identifier in the file or an encoding specification on INCLUDE or INSERT, syntax files are read as UTF-8 if –unicode on or as the current backend locale encoding if –unicode no. This is the default.
  • on. All syntax files are read in the current backend locale encoding, regardless of encoding specified in file or on INCLUDE or INSERT.
  • 'encoding'. All syntax files are read in the specified locale encoding, regardless of encoding specified in the syntax files or on INCLUDE or INSERT. The quoted value can be any valid code page encoding, including (but not limited to) encoding values specified in loclmap.xml. This file is located in the installation directory.

-help|-h. Display the command help.

If the -server, -user, -password, -switchserver, and -singleseat switches are omitted, IBM SPSS Statistics runs in the default mode.

Examples

Note: The following examples assume that you changed directories to the executable location. The details may vary by operating system and may require path specifications.

Starting in distributed mode using a specific server:

stats -server mystatssvr:3016 -user myuser -password mypassword

Starting in distributed mode using a specific server and a domain name:

stats -server mystatssvr:3016 -user "mydomain\myuser" -password mypassword

Starting in single seat mode:

stats -singleseat

Starting in production mode, letting IBM SPSS Statistics prompt for runtime values:

stats C:\job1.spj -production

Starting in production mode with defined symbol-value pairs:

stats C:\job1.spj -production silent -symbol @sex male @state "North Dakota"

Starting in default mode while opening a data file and a syntax file:

stats C:\cars.sav C:\analysis.sps