Running Programs in Batch Mode

After you have taken steps to enable the Windows Command Prompt to locate the IMLPlus.exe file (as described in Preparing to Use Batch Mode), you are ready to use IMLPlus.exe to run IMLPlus programs in batch mode.

The syntax for running IMLPlus.exe is

imlplus ProgramFileName Options

where ProgramFileName is the name of the .sx file containing the IMLPlus program and Options is zero or more of the following:

-out OutputFileName
Specifies the name of the file to which the program's output should be written. If the filename extension of OutputFileName is .htm or .html, IMLPlus generates output using the ODS HTML destination. Otherwise, IMLPlus generates output using the ODS LISTING destination. If the filename extension of OutputFileName is .rtf, the LISTING output is written in Rich Text format. Otherwise, the LISTING output is written in plain text format. If the -out option is not specified, the program's output is written to a file with the same name as ProgramFileName except with the filename extension changed to .lst.

-log LogFileName
Specifies the name of the file to which the program's error log should be written. If the -log option is not specified, the program's error log is written to a file with the same name as the output file except with the filename extension changed to .log.

-d name=value
Defines a command-line parameter. For information about command-line parameters, please refer to the topic Passing Information to Programs in Batch Mode.

-maximize
Maximizes IML Studio's window. Note that the window is still hidden from view.

-server name
Specifies the name of the logical SAS Workspace Server on which the IMLPlus program should run. You only need to use this option if you want to run an IMLPlus program on a server other than IML Studio's default server.

-username name
Specifies the user name to use to log on to the SAS Workspace Server.

-password text
Specifies the password to use to log on to the SAS Workspace Server.

-OMSusername name
Specifies the user name to use to log on to the SAS Metadata Server.

-OMSpassword text
Specifies the password to use to log on to the SAS Metadata Server.

Notes
Example

Suppose the file Report.sx contains the following IMLPlus program:

run GetInstallationDirectory( path );
path = path + "Data Sets";
libname samples (path);

submit;
proc report data=samples.business headline;
     column industry employs sales profits;
     define industry / group;
run;
endsubmit;

The following invocation of IMLPlus.exe will run the program:

imlplus Report.sx

After IMLPlus.exe finishes, the file Report.lst will contain the following:

               Employees                 Profits
                      in    Sales in        in $
Industry       Thousands  $ Millions    Millions
------------------------------------------------
Automobiles         3222    $831,487      $3,813
Electronics         2616    $486,320     $14,900
Food                2325    $419,717     $17,596
Oil                  839    $610,513     $18,961

Because the program contains no errors, IMLPlus.exe will not create an error log file.