Keyword | Purpose |
---|---|
add
| add places a record in a file, message queue, or database; or places a set of records in a database. |
call | call transfers control to another program and optionally passes a series of values. Control returns to the caller when the called program ends. If the called program changes any data that was passed by way of a variable, the storage area available to the caller is changed, too. |
case | case marks the start of multiple sets of statements, where at most only one of those sets is run. The case statement is equivalent to a C or Java switch statement that has a break at the end of each case clause. |
close | close disconnects a printer; or closes the file or message queue associated with a given record; or, in the case of an SQL record, closes the cursor that was opened by an EGL open or get statement. |
converse | converse presents a text form in a text application. |
delete | delete removes either a record from a file or a row from a database. |
display | display adds a text form to a run-time buffer but does not present data to the screen. |
execute | execute lets you write one or more SQL statements; in particular, SQL data-definition statements (of type CREATE TABLE, for example) and data-manipulation statements (of type INSERT or UPDATE, for example). |
exit | exit leaves the specified block, which by default is the block that immediately contains the exit statement. |
forward | forward displays a Web page with variable information. This statement is invoked from a page handler. |
get | get retrieves a single file record or database row and provides an option that lets you replace or delete the stored data later in your code. In addition, this statement allows you to retrieve a set of database rows and place each succeeding row into the next SQL record in a dynamic array. The get statement is sometimes identified as get by key value and is distinct from get next and get previous. |
get next | get next reads the next record from a file or message queue, or the next row from a database. |
get previous | get previous reads the previous record in the file that is associated with a specified EGL indexed record. |
goTo | goTo causes processing to continue at a specified label, which must be in the same function as the statement and outside of a block. |
if, else | if marks the start of a set of statements (if any) that run only if a logical expression resolves to true. The optional keyword else marks the start of an alternative set of statements (if any) that run only if the logical expression resolves to false. The keyword end marks the close of the if statement. |
move | move copies data, in most cases from the named items in one structure to the same-named items in another. |
open | open selects a set of rows from a relational database for later retrieval with get next statements. The open statement may operate on a cursor or on a called procedure. |
prepare | prepare specifies an SQL PREPARE statement, which optionally includes details that are known only at run time. You run the prepared SQL statement by running an EGL execute statement or (if the SQL statement returns a result set) by running an EGL open or get statement. |
print adds a print form to a run-time buffer. | |
replace | replace puts a changed record into a file or database. |
return | return exits from a function and optionally returns a value to the invoking function. |
set | set has various effects on records, text forms, and items. |
show | show presents a text form from a main program along with any other forms buffered using the display statement; ends the current program and optionally forwards the input data from the user and state data from the current program to the program that handles the input from the user. |
transfer | transfer gives control from one main program to another, ends the transferring program, and optionally passes a record whose data is accepted into the receiving program's input record. You cannot use a transfer statement in a called program. |
try | try indicates that the program continues running if an input/output (I/O) statement, a system-function invocation, or a call statement results in an error and is within the try statement. If an exception occurs, processing resumes at the first statement in the onException block (if any), or at the first statement following the end of the try statement. A hard I/O error, however, is handled only if the system variable sysVar.handleHardIOErrors is set to 1; otherwise, the program displays a message (if possible) and ends. |
while | while marks the start of a set of statements that run in a loop. The first run occurs only if a logical expression resolves to true, and each subsequent iteration depends on the same test. The keyword end marks the close of the while statement. |
Related reference
EGL statements
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.