DataTable properties

You define each DataTable part in its own EGL source file, where you can specify any of the following properties. The contents property is the only one that is required.

alias
A string (enclosed in quotation marks) that is incorporated into the names of generated output. If you do not specify an alias, the DataTable name is used instead.
contents
An array of values for the DataTable cells. Each row in the array represents one row in the table. Each row is formatted as specified in the column definitions. Each value is one of the following literal types:
  • A numeric literal
  • A string literal or a concatenation of string literals
  • A Boolean literal (YES or NO, TRUE or FALSE)
The content type in a row must be compatible with the top-level column definitions.
resident
A Boolean value that indicates whether the DataTable is kept in memory after all the programs that accessed the DataTable have ended. Valid values are YES and NO (the default). If you set the resident property to YES, the DataTable is shared regardless of the value of the shared property. Making a DataTable resident has the following benefits:
  • Retention of any values written to it by programs that ran previously.
  • Availability for immediate access without additional load processing.
If resident is set to NO, the following factors affect the unloading of the table:
  • If you are not running in VAGen compatibility mode, the DataTable is unloaded when the program ends.
  • If you are running in VAGen compatibility mode, the deleteAfterUse property of the use statement for the DataTable controls the unloading of the DataTable. See deleteAfterUse.
The unloading of the DataTable is also affected by the target system and by whether the program is resident; see "Compatibility" in this topic.
Note: A DataTable is loaded into memory the first time a program accesses it, and not when the EGL runtime processes its use statement.
shared
A Boolean value that indicates whether the same instance of a DataTable is used by every program in the same run unit. If shared is set to YES, all the programs in the run unit share the same copy of the DataTable. If shared is set to NO (the default), each program in the run unit has a unique copy of the DataTable.

Compatibility

Table 1. Compatibility considerations for DataTable properties
Platform Issue
Java™ generation A resident DataTable remains loaded until the run unit ends. However, a non-resident DataTable is unloaded when the program that uses it ends.
COBOL generation If the alias property is specified for a DataTable, the name is truncated to 7 characters.
CICS®

If you set the resident property to YES for a DataTable, do not set the RESIDENT keyword to YES on the CICS RDO PROGRAM definition for the DataTable program.

A resident DataTable remains loaded until one of the following occurs:
  • The CICS region comes down.
  • An administrator refreshes the table by using the new copy utility in the IBM® Rational® COBOL Runtime for zSeries®.
When the new copy utility is used, transactions that are already active and have the table loaded continue to use the old copy of the table until the table use count is set to zero for the transaction. The old copy is deleted when no more programs are using that copy.

The shared property indicates whether the same instance of a DataTable is used by every program in the CICS region and by every program in a given run unit. If you modify a shared table, the modifications are effective for all users of the table in the same CICS region until the table is reloaded.

If your program updates a shared table, make the entire update between I/O statements or between program, library, or service calls. Do not obtain a value from the DataTable before the I/O statement or call and then modify the DataTable based on the value you obtained after the I/O or call statement. Another user's transaction might have gotten control at the I/O or call statement and updated the same DataTable in the middle of your update operation. If synchronization is required across an I/O or call statement, use an external serialization method.

IMS BMP
z/OS batch

A resident DataTable remains loaded until one of the following situations occurs:
  • A main program ends (returns to the system).
  • A main program uses a transfer to transaction statement.
  • A main program uses a transfer to program statement to transfer to a non-EGL program.
  • A called program returns to a non-EGL program.

If the resident property is set to NO, the shared property is ignored. Each job step has a separate copy of the table.

IMS/VS
A resident DataTable remains loaded until one of the following situations occurs:
  • A main basic program ends (returns to the system).
  • A main textUI program finishes processing all messages in the input message queue.
  • A called program returns to a non-EGL program.

Modification of shared DataTables is not supported.

iSeries® COBOL
A resident DataTable remains loaded until one of the following situations occurs:
  • A main program ends (returns to the system).
  • A main program uses a transfer to transaction statement.
  • A main program uses a transfer to program statement to transfer to a non-EGL program.
  • A called program returns to a non-EGL program.
JavaScript generation DataTable is not supported.

Feedback