Running production jobs from a command line

Command line switches enable you to schedule production jobs to run automatically at certain times, using scheduling utilities available on your operating system. The basic form of the command line argument is:

stats filename.spj -production

Depending on how you invoke the production job, you may need to include directory paths for the stats executable file (located in the directory in which the application is installed) and/or the production job file.

You can run production jobs from a command line with the following switches:

-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.

To run production jobs on a remote server, you also need to specify the server login information:

-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.

For a complete list of command line switches, see Command line options.

Example

stats \production_jobs\prodjob1.spj -production silent -symbol @datafile /data/July_data.sav
  • This example assumes that you are running the command line from the installation directory, so no path is required for the stats executable file.
  • This example also assumes that the production job specifies that the value for @datafile should be quoted (Quote Value checkbox on the Runtime Values tab), so no quotes are necessary when specifying the data file on the command line. Otherwise, you would need to specify something like "'/data/July_data.sav'" to include quotes with the data file specification, since file specifications should be quoted in command syntax.
  • The directory path for the location of the production job uses the Windows back slash convention. On Macintosh and Linux, use forward slashes. The forward slashes in the quoted data file specification will work on all operating systems since this quoted string is inserted into the command syntax file and forward slashes are acceptable in commands that include file specifications (for example, GET FILE, GET DATA, SAVE) on all operating systems.
  • The silent keyword suppresses any user prompts in the production job, and the -symbol switch inserts the quoted data file name and location wherever the runtime symbol @datafile appears in the command syntax files included in the production job.