Entering content frame

 EXEC COMMAND Statement 

Use

You can use the EXEC COMMAND statement to execute operating system commands, for example, to delete files or call the Database Manager CLI.

The same general rules apply to EXEC COMMAND statements as to SQL statements. Precede each system call with the key words EXEC COMMAND .

Syntax

EXEC COMMAND SYNC <command> RESULT <result_parameter>
| EXEC COMMAND ASYNC <command>;

<command> ::= <string_constant> | <host_variable>

<result_parameter> ::=  <host_variable>

·        Declare <result_parameter> as a host variable with the type int (2 bytes).

·        In SYNC mode, the application program stops until the operating system command has been completed.

·        In ASYNC mode, the operating system command is executed in the background.

·        For information on the correct syntax of the operating system command, see your operating system documentation.

 

Leaving content frame