Segmentation is tied to the EGL converse statement and the release of system resources. "Converse" here refers to a conversation between a program and a user; the converse statement presents information to the user, waits for a response, then resumes processing with the next instruction.
A nonsegmented program remains in memory while waiting for the user response. A segmented program exits after the converse and reloads after the user responds (except in the IMS™ environment, where the program goes back to read from the message queue after a converse). The idea behind segmentation is to free system resources (such as memory and locked databases) in case the user does not respond immediately.
EGL-generated Java™ programs other than UI programs are always nonsegmented and stay resident in memory after a converse. If you are generating programs both in Java and in COBOL, however, there is no harm in declaring the program to be segmented (by setting the program segmented property to YES) or in setting the converseVar.commitOnConverse system variable. This mimics some segmented program behavior in the Java environment, like committing changes to the database and freeing database locks after a converse.
A called program can be segmented. To let EGL know about this, you must set the segmented property to YES for every program in the calling chain.
A nonsegmented program can be easier to code. For example, you do not need to reacquire a lock on an SQL row after a converse. Disadvantages include the fact that SQL rows are held during user think time, a behavior that leads to performance problems for other users who need to access the same SQL row.
The setting of converseVar.commitOnConverse never affects system variables or EGL tables.
The behavior of a segmented program is unaffected by the value of the converseVar.commitOnConverse system variable.
| Platform | Issue |
|---|---|
| IMS or CICS for z/OS® | The benefit of using a segmented program
on IMS or CICS for z/OS is
as follows:
The benefit of using a non-segmented program on IMS or CICS for z/OS is that the response time for each user is less than for a segmented program because program state is not saved and restored. An EGL segmented program performs
the following actions when the user first invokes it:
|
| IMS or CICS for z/OS (continued) | When the user performs an action (to update
business data, for example), the runtime system restores the program
to memory. The program starts from the beginning again. The segmented
program automatically performs the following actions:
|