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.

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