Products Downloads


French version


 


      

VADELIA

SADELIA

WADELIA

EADELIA


(I/B) (C/S)

(B) (S)

(I/B) (C/S)

(B) (C/S)


Section for use

All


Syntax

EXECUTE_CMD Command ExecutionType ExecutionScope

Command

'AlphaConstant' | AlphaVarId

ExecutionType

*SYN | *ASYN | None

ExecutionScope *PGM | *ALL | None


Description

This instruction executes the 'AlphaConstant' command or a command specified in the alphanumeric variable AlphaVarId .


You can select the manner in which the instruction is executed:

*SYN

Synchronous

*ASYN

Asynchronous

The default setting is *SYN.

With AS/400 server modules, the execution type is ignored and the command is executed synchronously.



For Cloud client and Event client contexts:

*PGM

Limited to Adelia programs

*ALL

Adelia programs and system commands



For contexts other than Cloud client or Event client, these parameters are ignored.


Note:

If no executionScope is specified, Adelia programs and system commands are accepted. System commands can be prohibited by setting the following property when starting the JVM:

-Dadelia.execute_cmd.pgm.only=true

With this property enabled, so that EXECUTE_CMD can execute a system command, it needs to have the *ALL parameter.


To check whether the command has been executed successfully, you can test the *RETURN_CODE reserved word where the command is executed synchronously.

By default *RETURN_CODE takes the value returned by the program or the system command called.
In the special case of an EXECUTE_CMD with the *PGM directive of a non-existent program, *RETURN_CODE takes the value 1.


Example

EXECUTE_CMD Command *SYN

EXECUTE_CMD Command *ASYN

EXECUTE_CMD  Command

EXECUTE_CMD  Command *PGM

EXECUTE_CMD  Command *ALL


Other examples

* assume W_CMD is an alpha variable defined in the program

EXECUTE_CMD  W_CMD

*

EXECUTE_CMD  W_CMD  *SYN

*

* java daemon starts

W_CMD = *blank

W_CMD = 'd:\Exploit\java\client\cla\daemon.bat'

EXECUTE_CMD  W_CMD  *ASYN


EXECUTE_CMD 'd:\Exploit\java\client\cla\daemon.bat'


↑ Top of page

  • Aucune étiquette