Segmentation concerns how a program interacts with its environment before
issuing a converse statement.
By default a program that presents text forms is
non-segmented,
which means that the program behaves as if it were always in memory and providing
a service to only one user. The following rules are in effect before a non-segmented
program issues a
converse statement:
- Databases and other recoverable resources are not committed
- Locks are not released
- File and database positions are retained
- Single-user EGL tables are not refreshed; their values are the same before
and after the converse
- Similarly, system variables are not refreshed
A called program is always non-segmented.
A non-segmented 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.
Two techniques are available for releasing or refreshing resources before
a converse in a non-segmented program:
- You can set the system variable ConverseVar.commitOnConverse to
1. Results are as follows before a converse:
- Databases and other recoverable resources are committed
- Locks are released
- File and database positions are not retained, except when the database
open statement includes the hold option, as is available only for COBOL programs
The setting of ConverseVar.commitOnConverse never
affects system variables or EGL tables.
- A second technique for handling converse is to set the segmented property
of the text program to yes, either by changing a
program property at development time or by setting the system variable ConverseVar.segmentedMode to
1 at run time. Segmentation causes the following results before a converse:
- Databases and other recoverable resources are committed
- Locks are released
- File and database positions are not retained, even when the database open
statement includes the hold option
- Single-user EGL tables are refreshed; their values become the same as
when the program began
- System variables are refreshed; their values become the same as when the
program began, except for a subset of variables whose values are saved across
segments
The behavior of a segmented program is unaffected by the value of
the system variable ConverseVar.commitOnConverse.
The benefit of using a segmented program on IMS™ or CICS
® for z/OS
® is as follows:
- In the absence of EGL, the developer of a segmented program writes code
to analyze program state at each invocation. With EGL, the application logic
is simpler because the developer writes code as if the user were having an
ongoing conversation with a program that is always in memory.
- Limited resources such as memory are used more efficiently so that a larger
number of terminals can run EGL programs at the same time.
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.
For additional details that are meaningful for IMS and CICS COBOL programs, see Behavior of
a segmented program on CICS and IMS.