A tricky file handling option in CICS is CONSISTENT. CICS handles integrity in two ways. There are two ways -One way is read waits till update completes, and option -2 is first READ completes and then UPDATE completes.
Details of CICS READ
The record is read with a level of read integrity provided by a VSAM shared lock that lasts for the duration of the request.
Related: 2016 HOT IT SKILLS -Apply Today
If the record is being modified by another task, which therefore holds an exclusive lock, the READ request waits until the update is complete (unless NOSUSPEND is also specified) as follows:
- For a READ request against a non-recoverable file, the READ completes as soon as any VSAM request performing the update completes.
- For a READ request against a recoverable file, the READ request completes when the updating task completes its next sync point or rollback.
CICS READ Syntax from IBM manual:
READ--FILE(filename)--+------------------------------+------->
+-UNCOMMITTED------------------+
+-CONSISTENT-------------------+
+-REPEATABLE-------------------+
'-UPDATE--+------------------+-'
'-TOKEN(data-area)-'
>--+-INTO(data-area)-+--RIDFLD(data-area)----------------------->
'-SET(ptr-ref)----'
>--+------------------------------------+----------------------->
'-KEYLENGTH(data-value)--+---------+-'
'-GENERIC-'
>--+--------------------------------------+--+--------+--------->
+-SYSID(systemname)--LENGTH(data-area)-+ +-DEBKEY-+
'-LENGTH(data-area)--------------------' +-DEBREC-+
+-RBA----+
+-RRN----+
'-XRBA---'
.-EQUAL-.
>--+-------+--+-----------+------------------------------------><
'-GTEQ--' '-NOSUSPEND-'