Show TOC Start of Content Area

Background documentation Run Modes of the DC Tool  Locate the document in its SAP Library structure

Depending on the underlying operating system, you can either start a DOS prompt or a shell and change to the directory where the corresponding batch file or shell script is located. Then start the corresponding batch file or shell script without any additional parameters. If the DC tool has been started with additional parameters, it runs in batch mode.

Interactive Mode

If the DC command line tool has been launched successfully you should see this prompt:

:dc>

Now you can enter commands. The command name must occur before the options and arguments. To get an overview of all commands available use the help command.

Example

:dc>help loadconfig

You can enter multiple commands at a time. In this case, the commands must be separated by a semicolon (;).

:dc>exectime; version;

Entering exit command terminates the tool.

:dc>exit

User Messages and Technical Messages

By default, the DC command line tool writes user messages to the console. You can redirect user messages to a file using the command logfile. In the example below, user messages are redirected to file useroutput.txt. The option –m with parameter append has the effect that the output is appended to the file. By default, the files for user output are overwritten.

:dc>logfile –f useroutput.txt –m append

If the command logfile is used without option –f, the user messages are redirected back to the console. You can also determine how detailed the user messages are. For this purpose use the command verbosity.

Besides user messages, there are also technical messages like stack traces. Such technical messages are only needed in case of problems or errors. Therefore such messages are not written to the console. To specify in which file technical messages shall be written, use command tracefile:

:dc>tracefile –f tracemsg.txt

In this context, option –m can be used to specify how detailed trace messages are. Entering tracefile without any further options shows the location of the current trace file.

Batch Mode

The DC command line tool runs in batch mode if command line parameters are passed when it is launched. In batch mode, the tool processes all commands that have been passed and terminates afterwards. Below an example is given for the Windows platform how the tool is launched in batch mode. The commands are separated by a semicolon (;).

Example

dctool.bat help logfile; help tracefile; help verbosity;

It is also possible to collect commands in a text file. Here you have to separate commands by a semicolon as well. The text file can be passed using a command line to the tool. Note that you have to put an at sign (@) character before the file name to distinguish a file name from a command:

Example

dctool @commandfile.txt

If you have a certain sequence of commands that you want to execute periodically, you can collect those commands in a text file and pass this text file.

Recommendation

The DC tool gives a return code back when it terminates from batch mode. This return code is the status code of the last executed command. A value different then 0 means that a problem occurred. We recommend you to check the return code in batch files or shell scripts which launch batch processing.

On Windows platforms you can schedule the execution of DC tool command file. The same can be achieved on Unix/Linux platforms.

End of Content Area