IBM OS/390 User Manual

Page of 673
5.6.6.2 Single Region Data Set Sharing
Single ACB Open - Multiple String Processing
Full write integrity is provided within a single region provided the user uses a
single ACB to process the data set. In high level languages an ACB equates to:
 1. a SELECT statement in COBOL
 2. a file DECLARE in PL/I
 3. an
F
statement in RPG II
If multiple ACBs (or high level language equivalents) are used, the protection of
shareoptions must be relied upon unless DSNAME sharing is used (both COBOL
and PL/I always use it). See “Intra-Region Data Set Name Sharing” below.
Multiple positions may be maintained in the file via use of multiple strings (that
is, the ACB STRNO parameter). The strings may be used for multiple requests
from the main task or its subtask. VSAM will automatically provide exclusive
control protection for output requests and read integrity if 
GET for UPDATE
″ 
is
used.
Within the same region the data set can be updated concurrently (even with
DISP=OLD) and VSAM ensures integrity because a single ACB control block
structure is used.
On a GET UPDATE or PUT request, VSAM acquires exclusive control of the CI,
after checking that no other string is accessing the CI. Any string which wants to
make an update or add to the same CI, will get an ERROR CODE = X
′ 14′ 
with
R 1 5   =   X
′08′. 
The exclusive control ends when the subtask possessing it issues a
GET UPDATE for a record in another CI or issues an ENDREQ or issues a PUT
UPDATE for a record read previously by a GET UPDATE. The exclusive control
does not impede simple READs for the other subtasks. The user requiring read
integrity must specify UPD intent on all RPLs.
Both CICS/OS and IMS/VS DC use multiple string processing with a single ACB
structure. They intercept the VSAM exclusive control error codes and suspend or
wait the task until the requested resource is available.
Intra-Region Data Set Name Sharing
If DSNAME sharing is specified in the ACB (that is, MACRF=(DSN...)), a data set
may be accessed from multiple ACBs within the same region. VSAM assures
integrity because there is only one control block structure. This protection is
provided because DSNAME sharing tells VSAM to tie the control block structure
of the second ACB to the first 
if the data set name matches.
If DSNAME sharing is 
not specified in the ACB, the default (DDNAME sharing)
applies and VSAM operates as if the data set is being shared by users in
different address spaces. The OS/VS COBOL and OS PL/I compilers always use
DSNAME sharing when multiple file statements are used.
For VSE users of CICS (since VSE/ESA 1.3), DSNAME sharing has been available
as well, so VSE users will have at least the same support in this specific area,
and for older VSE installations, OS/390 will provide a significant enhancement.
128
VSE to OS/390 Migration Workbook