execute considerations for CICS

In the context of CICS®, the EGL execute statement is typically used to carry out a native EXEC CICS statement with dynamic elements. Local EGL variables in the same program may be referenced in the statement, or labels within the same function. EGL will generate an EXEC CICS statement containing the provided text, resolved variable and label names and imbed this into the application program.

Syntax

Syntax diagram with generic fields
cicsStatement
For more information on the allowable contents of this type of statement, refer to the CICS Application Programmer Reference manual. The contents of the cicsStatement can include any combination of text, variable references, or label references. Any text will be included as is, with no translation or case conversion. Any variable referenced must be a local EGL variable within the same EGL program. You may not reference a variable in another program or library. All variable references are preceded by a colon (:) to indicate that the following text is to be considered a variable that needs to be resolved. Any label referenced must be for an EGL label in the same function. You may not reference a label in another function. All label references are preceded by a per cent sign (%) to indicate that the following text is to be considered a label that needs to be resolved.
To obtain the CICS response code for the statement, the user should code the RESP(:variable) argument as part of the cicsStatement as there is no direct access to the CICS EIBRESP or EIBRESP2 variables. Otherwise, the error code will be written to the EGL variable referenced.
Here are several examples of the execute statement:
error int;
message char(80);
leng int;
function main()
		execute #cics{WRITEQ TD QUEUE("CSML") FROM(:MESSAGE) 
           ENGTH(:LENG) RESP(:error)};
. . . . .
		execute #cics{HANDLE CONDITION DUPREC(%Y)};
. . . . .
y:
		processDuplicateRecord();
end