EGL programs can pass both a form and a record for a deferred program-to-program message switch. When the segmented program is generated as nonconversational (without an SPA), the work database is used to save data when a show statement specifies both a form and a record. Rational® COBOL Runtime for zSeries provides subroutines that can be used by a non-EGL program to store or retrieve data from the work database. Both the originating and target programs or transactions must use the same physical work database.
You can use ELATSGET to read a record from the work database after a deferred program switch from an EGL program. The logical terminal identifier is used as the work database key.
MOVE "ELATSGET" TO modname.
CALL modname USING parm1, parm2, parm3, parm4, parm5, parm6.
In
the previous example, modname is an 8-byte
character field, and parm1 through parm6 are
as follows:| Code | Meaning |
|---|---|
| 0 | Read successful |
| 4 | Read successful, truncation occurred |
| 8 | Read failed, record not found |
| 12 | Read failed, other error |
Truncation occurs when the calling program attempts to restore data into a buffer that is smaller than the data that was previously saved. If the buffer is larger than the data that was previously saved, the trailing portion of the buffer is initialized to blanks.
ELATSGET does not issue any error messages. The calling program must take the appropriate action when an error occurs. If a DL/I work database is used, the PCB contains the status code that indicates the error. If a DB2 work database is used, the full-word binary (5th parameter) contains the SQL code that indicates the error.
You can use ELATSPUT to write a record to the work database before you perform a deferred program switch to an EGL program. The logical terminal identifier is used as the work database key.
MOVE "ELATSPUT" TO modname.
CALL modname USING parm1, parm2, parm3, parm4, parm5, parm6.
In
the previous example, modname is an 8-byte
character field, and parm1 through parm6 are
as follows:| Code | Meaning |
|---|---|
| 0 | Write successful, new record added |
| 4 | Write successful, existing record replaced |
| 12 | Write failed, other error |
ELATSPUT does not issue any error messages. The calling program must take the appropriate action when an error occurs. If a DL/I work database is used, the PCB contains the status code that indicates the error. If a DB2 work database is used, the fullword binary (5th parameter) contains the SQL code that indicates the error.