Fast Path DL/I Database Access

Main Storage Databases (MSDB) and Data Entry Databases (DEDB)

The following two Fast Path database types are supported by the IMS DATA step interface by using a BMP region:
  • Main storage databases (MSDBs) store and provide access to an installation's most frequently used data, which resides in virtual storage during execution. The data is stored in segments, and each segment can be available to all computers or to specific computers.
  • Data entry databases (DEDBs) provide a high level of availability for, and efficient access to, large volumes of detailed data. They are hierarchic structures that contain a special type of segment that is used for the fast collection of detailed information. The segments are called sequential dependent segments because they are stored in time sequence as they are committed to the database.
Standard DL/I database calls can be used with a PCB that references an MSDB or DEDB to access database segments. Two additional calls are available:
  • The FLD call enables Read and Update access to a field in an MSDB.
  • The POS call returns information about the position of the current sequential dependent segment in a DEDB and free space in the DEDB area.
The IMS DATA step interface supports the FLD and POS calls from a BMP region.

FLD Call

The FLD call is used to verify and to update the contents of one or more fields in an MSDB segment. Individual field verification or change specifications are specified in field search arguments (FSAs). (The format and use of FSAs are described in the IBM publication IMS/ESA: Application Programming: EXEC DLI Commands for CICS and IMS.) FSAs are passed to DL/I in the I/O area. Therefore, in the IMS DATA step interface, the PUT statement is used to format the FSAs in the output buffer and to execute the FLD call.
Like any DL/I call, the FLD call returns a status code. In addition, DL/I returns abnormal status information for each FSA in the call. If a non-blank status code is returned from a FLD call, it might be necessary to examine the contents of the FSA return codes. The DL/I INFILE statement option FSARC= specifies a 200-byte character variable to which the first 200 FSA status code bytes can be returned.
The following example issues a FLD call against an MSDB called INVNTORY:
 ssa1='PRODUCT (PRODUCT = LOCKS     )';
   infile msdbpsb dli call=cfunc dbname=database 
      ssa=ssa1 fsarc=fsa_rc;
   file msdbpsb dli;
   cfunc = 'FLD ';
   database = 'INVNTORY';
   put @1 'QUANTITY  H100*QUANTITY -100*ORDERS +1 ';
The call accesses a segment called PRODUCT containing data on locks. The FLD call performs these functions:
  • verifies that the QUANTITY field is greater than 100
  • updates the QUANTITY field by subtracting 100 from its current value
  • updates the ORDERS field by adding 1 to its value.
If the QUANTITY field value is not greater than 100 when the FLD call is executed, the return code for the first FSA contains a D. The following statements check for errors in the call and print an appropriate message on the SAS log for this error:
if _error_ then do;
   file log;
   if substr(fsa_rc,1,1) = 'D'
   then put / '*** Quantity of Product Locks Less 
      Than 100 ***';
   put _all_;
   _error_=0;
   end;

POS Call

The POS call is used with a DEDB to perform one of the following:
  • Retrieve the position of a specific sequential dependent segment.
  • Retrieve the position of the last inserted sequential dependent segment.
  • Find out how much free space is available within a DEDB area.
In an IMS DATA step program, the POS call is issued with a DL/I INPUT statement and a DB PCB. After a POS call is issued, the input buffer is formatted with the requested data as explained in the IBM publication IMS/ESA: Application Programming: EXEC DLI Commands for CICS and IMS.
The SAS statements below execute a POS call for a DEDB called ORDERS:
   retain ssa1 'PRODUCT (PRODUCT = LOCKS     )';
   infile dedbpsb dli call=cfunc dbname=database 
      ssa=ssa1;
   cfunc = 'POS ';
   database = 'ORDERS  ';
   input @3 areaname $char8.
         @11 cycl_cnt $pib4.
         @15 vsam_rba $pib4.;
The call obtains the position of the last inserted ORDRITEM sequential dependent segment for the locks PRODUCT segment.