z/OS DFSMS Using Data Sets
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


How an ISAM Program Can Process a VSAM Data Set

z/OS DFSMS Using Data Sets
SC23-6855-00

When a processing program that uses ISAM (assembler-language macros, PL/I, or COBOL) issues an OPEN to open a key-sequenced data set, the ISAM interface is given control to:
  • Construct control blocks that are required by VSAM
  • Load the appropriate ISAM interface routines into virtual storage
  • Initialize the ISAM DCB (data control block) to enable the interface to intercept ISAM requests
  • Take the DCB user exit requested by the processing program

The ISAM interface intercepts each subsequent ISAM request, analyzes it to determine the equivalent keyed VSAM request, defines the keyed VSAM request in a request parameter list, and initiates the request.

The ISAM interface receives return codes and exception codes for logical and physical errors from VSAM, translates them to ISAM codes, and routes them to the processing program or error-analysis (SYNAD) routine through the ISAM DCB or DECB. Table 1 shows QISAM error conditions and the meaning they have when the ISAM interface is being used.

Table 1. QISAM error conditions
Byte and Offset QISAM Meaning Error Detected By Request Parameter List Error Code Interface/VSAM Meaning
DCBEXCD1        
Bit 0 Record not found Interface   Record not found (SETL K for a deleted record)
    VSAM 16 Record not found
    VSAM 24 Record on nonmountable volume
Bit 1 Invalid device address Always 0
Bit 2 Space not found VSAM 28 Data set cannot be extended
    VSAM 40 Virtual storage not available
Bit 3 Invalid request Interface   Two consecutive SETL requests
    Interface   Invalid SETL (I or ID)
    Interface   Invalid generic key (KEY=0)
    VSAM 4 Request after end-of-data
    VSAM 20 Exclusive use conflict
    VSAM 36 No key range defined for insertion
    VSAM 64 Placeholder not available for concurrent data-set positioning
    VSAM 96 Key change attempted
Bit 4 Uncorrectable input error VSAM 4 Physical read error (register 15 contains a value of 12) in the data component
    VSAM 8 Physical read error (register 15 contains a value of 12) in the index component
    VSAM 12 Physical read error (register 15 contains a value of 12) in the sequence set of the index
Bit 5 Uncorrectable output error VSAM 16 Physical write error (register 15 contains a value of 12) in the data component
    VSAM 20 Physical write error (register 15 contains a value of 12) in the index component
    VSAM 24 Physical write error (register 15 contains a value of 12) in the sequence set of the index
Bit 6 Unreachable block input VSAM   Logical error not covered by other exception codes
Bit 7 Unreachable block (output) VSAM   Logical error not covered by other exception codes
DEBEXCD2        
Bit 0 Sequence check VSAM 12 Sequence check
    Interface   Sequence check (occurs only during resume load)
Bit 1 Duplicate record VSAM 8 Duplicate record
Bit 2 DCB closed when error routine entered VSAM   Error in close error routine entered
Bit 3 Overflow record Interface Always 1
Bit 4 Length of logical record is greater than DCBLRECL (VLR only) Interface Length of logical record is greater than DCBLRECL (VLR only)
    VSAM 108 Invalid record length
Bits 5-7 Reserved   Always 0

Table 2 shows BISAM error conditions and the meaning they have when the ISAM interface is being used.

If invalid requests occur in BISAM that did not occur previously and the request parameter list indicates that VSAM is unable to handle concurrent data-set positioning, the value specified for the STRNO AMP parameter should be increased. If the request parameter list indicates an exclusive-use conflict, reevaluate the share options associated with the data.

Table 2. BISAM error conditions
Byte and Offset BISAM Meaning Error Detected By Request Parameter List Error Code Interface/VSAM Meaning
DCBEXC1        
Bit 0 Record not found VSAM 16 Record not found
    VSAM 24 Record on nonmountable volume
Bit 1 Record length check VSAM 108 Record length check
Bit 2 Space not found VSAM 28 Data set cannot be extended
Bit 3 Invalid request Interface No request parameter list available
    VSAM 20 Exclusive-use conflict
    VSAM 36 No key range defined for insertion
    VSAM 64 Placeholder not available for concurrent data-set positioning
    VSAM 96 Key change attempted
Bit 4 Uncorrectable I/O VSAM Physical error (register 15 will contain a value of 12)
Bit 5 Unreachable block VSAM Logical error not covered by any other exception code
Bit 6 Overflow record Interface Always 1 for a successful READ request
Bit 7 Duplicate record VSAM 8 Duplicate record
DECBEXC2        
Bits 0-5 Reserved   Always 0
Bit 6 Channel program initiated by an asynchronous routine   Always 0
Bit 7 Previous macro was READ KU Interface Previous macro was READ KU

Table 3 gives the contents of registers 0 and 1 when a SYNAD routine specified in a DCB gets control.

Table 3. Register contents for DCB-specified ISAM SYNAD routine
Register BISAM QISAM
0 Address of the DECB 0, or, for a sequence check, the address of a field containing the higher key involved in the check
1 Address of the DECB 0

You can also specify a SYNAD routine through the DD AMP parameter (see JCL for Processing with the ISAM Interface). Table 4 gives the contents of registers 0 and 1 when a SYNAD routine specified through AMP gets control.

Table 4. Register contents for AMP-specified ISAM SYNAD routine
Register BISAM QISAM
0 Address of the DECB 0, or, for a sequence check, the address of a field containing the higher key involved in the check
1 Address of the DECB Address of the DCB

If your SYNAD routine issues the SYNADAF macro, registers 0 and 1 are used to communicate. When you issue SYNADAF, register 0 must have the same contents it had when the SYNAD routine got control and register 1 must contain the address of the DCB.

When you get control back from SYNADAF, the registers have the same contents they would have if your program were processing an indexed sequential data set: register 0 contains a completion code, and register 1 contains the address of the SYNADAF message.

The completion codes and the format of a SYNADAF message are given in z/OS DFSMS Macro Instructions for Data Sets.

Table 5 shows abend codes issued by the ISAM interface when there is no other method of communicating the error to the user.

Table 5. ABEND codes issued by the ISAM interface
ABEND Code Error Detected By DCB/DECB Set By Module/Routine ABEND Issued By Error Condition
03B OPEN OPEN/OPEN ACB and VALID CHECK OPEN Validity check; either (1) access method services and DCB values for LRECL, KEYLE, and RKP do not correspond, (2) DISP=OLD, the DCB was opened for output, and the number of logical records is greater than zero (RELOAD is implied), or (3) OPEN ACB error code 116 was returned for a request to open a VSAM structure.
031 VSAM SYNAD SYNAD SYNAD (ISAM) was not specified and a VSAM physical and logical error occurred.
  VSAM SCAN/GET and SETL SYNAD SYNAD (ISAM) was not specified and an invalid request was found.
  LOAD LOAD/RESUME LOAD SYNAD (ISAM) was not specified and a sequence check occurred.
  LOAD LOAD LOAD SYNAD (ISAM) was not specified and the RDW (record descriptor word) was greater than LRECL.
039 VSAM SCAN/EODAD SCAN End-of-data was found, but there was no EODAD exit.
001 VSAM SYNAD   I/O error detected.

If a SYNAD routine specified through AMP issues the SYNADAF macro, the parameter ACSMETH can specify either QISAM or BISAM, regardless of which of the two is used by your processing program.

A dummy DEB is built by the ISAM interface to support:
  • References by the ISAM processing program
  • Checkpoint/restart
  • ABEND

Table 6 shows the DEB fields that are supported by the ISAM interface. Except as noted, field meanings are the same as in ISAM.

Table 6. DEB fields supported by ISAM interface
DEB Section Bytes Fields Supported
PREFIX 16 LNGTH
BASIC 32 TCBAD, OPATB, DEBAD, OFLGS (DISP ONLY), FLGS1 (ISAM-interface bit), AMLNG (104), NMEXT(2), PRIOR, PROTG, DEBID, DCBAD, EXSCL (0-DUMMY DEB), APPAD
ISAM Device 16 EXPTR, FPEAD
Direct Access 16 UCBAD (VSAM UCB)
Access Method 24 WKPT5 (ISAM-interface control block pointer), FREED (pointer to IDAIIFBF)

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014