Previous Topic: Example

Next Topic: Advantage of SBMJOB over Execute Message

EXCMSG Message Function

The CA 2E Execute Message (EXCMSG) function allows a request message to be executed by the calling function. A request message is generally a CL (control language) command.

You enter the request string in the second-level text of the message function. The command can be executed in the iSeries native environment.

The EXCMSG function is attached to a special CA 2E shipped system file called *Messages.

To implement the EXCMSG function, you define an EXC type message function. Once you define the command to execute, you insert a call to the EXCMSG function from a user point within the action diagram of a calling function. The EXCMSG function is then implemented as a call to a CL program supplied by CA 2E.

The following table shows the parameters available.

Parameter

Usage

Role

Default

Option

Return code

B

-

Y

R

Message id

I

-

Y

R

Message data

I

-

Y

R

Field to receive message text

I

-

-

0

The following table shows other properties.

Options

Default Value

Other Values

Message severity

20

00-99

Second level text

-

System request

The EXCMSG function is implemented by a call to a CL program. The default environment is controlled by the model value YEXCENV, but can be overridden for individual Execute Message functions. The text of the message can be tailored to the environment.

It is not possible to use the i OS override commands: Override Database File (OVRDBF), Override Display file (OVRDSPF), and Override Print File (OVRPRTF) with the EXCMSG function because the resulting overrides are only in effect in the invocation level of the implementing CA 2E CL program.

If you use the i OS commands OPNDBF and OPNQRYF as the request message text, you must specify a value of TYPE(*PERM) for these commands in order to prevent the closure of the file on return from the implementing CA 2E CL program.

You can invoke the i OS command prompt by pressing F4 after entering the command string. Although CA 2E allows you to use message substitution data variables, (&1, &2), within the string, i OS does not accept these values within the string. To overcome this restriction replace the ampersand (&) symbol with an at (@) symbol.