ADELIA |
|
|
|
|
(I/B) |
|
|
|
|
Section for use
All
Syntax
EXECUTE_CMD AlphaVarId
Description
This instruction enables the execution of AS/400 commands, which are specified in the variable AlphaVarId after the instruction; see the IBM manual "Control Language Programmer's Guide" for more details on the use of the QCMDEXC program. The variable cannot exceed 9999 characters.
Important note:
-
- The variable to be used in the data environment of the model must be defined.
- Indicator 90 can be tested after this instruction to verify that the AS/400 command has been executed successfully; if *IN90 = 1, an error occurred when executing the command; otherwise (*IN90 = 0), the command call was processed correctly.
With the C generator you can use the following syntax:
EXECUTE_CMD AlphaVarId *SERVER(Name)
Name is an entry of the client-server configuration file allowing to direct the command to the appropriate server.
-
When the command is used without the *SERVER parameter, it runs on the database's default server.
When *SERVER is indicated, then the command runs on the AS/400 server or the PC server (via a "Remote Procedure Call") that is identified by the Name entry.
Warning: With RPG generator, the *SERVER parameter is ignored.
Example
W_COMMAND = 'SBMJOB CMD(CALL EDICA) JOBD(*USRPRF) JOBQ(QBATCH)'
EXECUTE_CMD W_COMMAND
*
* Example in client-server mode
* The calling program is generated in C for a micro;
* the command is different upon a parameter (region).
*
IF CUST_REGION = 'LOCAL'
COMMAND = 'E.EXE \DOCUMENT\DOC' /// CUST_CODE /// '.TXT'
EXECUTE_CMD COMMAND *SERVER(OS2_SERVER)
ELSE
COMMAND = 'STRSEU SRCFILE(QGPL/DOCUMENT) SRCMBR(DOC' /// CUST_CODE /// ')'
EXECUTE_CMD COMMAND *SERVER(HEADQ_AS400)
END