SYSTEM_COMMAND

LANSA Composer

SYSTEM_COMMAND

This activity executes an operating system command. Command execution is synchronous - the processing sequence waits until the command completes before proceeding. The parameters specify the command string to be executed and the response or result code from the operating system is returned in the RESPONSE parameter.

Notes:

* By using this activity, you are introducing an operating system dependency into your processing sequence.

* The specific commands you can use and their format and syntax are determined by the operating system. Refer to relevant operating system documentation.

* The command must be eligible to be executed in the environment in which the processing sequence will run, including with respect to the required authorities.

* If the command does not execute successfully, this is indicated by the response code. The activity ends normally. If you wish to treat the failure as an error, you must test the RESPONSE parameter.

* You cannot call the LANSA X_RUN entry point (to execute LANSA RDMLX applications) using this activity.

INPUT Parameters:

COMMAND01 : Required

This parameter must contain the command to be executed. The command names and the format and syntax of the command string is operating system-defined. Up to 256 characters may be specified. If the required command string is longer than this, you may specify the remainder of the command string in the COMMAND02 and COMMAND03 parameters.

This parameter is required. If it is not provided, the acivity will return an error.

COMMAND02 COMMAND03 : Optional

These parameters can contain optional parts 2 and 3 of the command string. This can be used in the event that the command string is longer than the maximum supported 256 characters for the COMMAND01parameter. If present, the values of these parameters are appended to the command string before executing it. Trailing blanks are trimmed from the command string before appending these values - this means that if you need a blank space between the command strings in parts 1 and 2 or parts 2 and 3, then the blank space must be present at the beginning of the second of the two parts.

OUTPUT Parameters:

RESPONSE :

Upon completion, this parameter contains the response code from the operating system arising from executing the specified system command. A response code of zero indicates successful execution. On IBM i servers, a response code of 1 indicates failure. On Windows servers, one of a range of Win32 error codes may be returned in the event of an error.