TurboIMAGE/XL Database Management System Reference Manual (30391-90012)
Table Of Contents
- 1 Introduction
- 2 Database Structure and Protection
- 3 Defining a Database
- 4 Using the Database
- 5 TurboIMAGE/XL Library Procedures
- Using TurboIMAGE/XL Intrinsics
- DBBEGIN
- DBCLOSE
- DBCONTROL
- DBDELETE
- DBEND
- DBERROR
- DBEXPLAIN
- DBFIND
- DBGET
- DBINFO
- INTRINSIC NUMBER 402
- Syntax
- Parameters
- Discussion
- Mode 101: Item Number
- Mode 102: Item Name
- Mode 103: Items in Database
- Mode 104: Items in Data Set
- Mode 113: BTREEMODE1 and Wildcard Character
- Mode 201: Set Number
- Mode 202: Set Name
- Mode 203: Sets in Database
- Mode 204: Sets with Item
- Mode 205: Set Capacity
- Mode 206: Number of Data Set Chunks
- Mode 207: Size of Data Set Chunks
- Mode 208: Primary and Actual Capacity
- Mode 209: B-Tree Attachment
- Mode 301: Paths
- Mode 302: Key or Search Item
- Mode 401: Logging
- Mode 402: ILR
- Mode 403: Dynamic Roll-Back
- Mode 404: Logging Subsystem Information
- Mode 406: Database Information
- Mode 501: Subsystem Access
- Mode 502: Critical Item Update
- Modes 8nn: Third-Party Indexing
- Mode 901: Language
- DBLOCK
- DBMEMO
- DBOPEN
- DBPUT
- DBUNLOCK
- DBUPDATE
- DBXBEGIN
- DBXEND
- DBXUNDO
- 6 Host Language Access
- Model Program
- ORDERS Database Model Program
- Main Body of Program
- Opening the Database
- Retrieving All the Records on a Chain (with Item Level Locking)
- Retrieving a Data Entry Using a Record Number
- Retrieving Master Data Using a Key Value
- Retrieving Data Serially (with Set Level Locking)
- Adding an Entry
- Updating an Entry
- Deleting an Entry
- Rewinding a Data Set
- Obtaining Database Information
- Obtaining Error Messages and Explanations
- Closing the Database
- C
- COBOL II
- Defining Data Types, Variables, and Intrinsics
- Main Body of Program
- Opening the Database
- Retrieving All the Records on a Chain (with Item Level Locking)
- Retrieving a Data Entry Using a Record Number
- Retrieving Master Data Using a Key Value
- Retrieving Data Serially (with Set Level Locking)
- Adding an Entry
- Updating an Entry
- Deleting an Entry
- Rewinding a Data Set
- Obtaining Database Information
- Obtaining Error Messages and Explanations
- Closing the Database
- FORTRAN 77
- Pascal
- RPG
- 7 Logging and Recovery
- Database Utilities Used in Logging and Recovery
- Recovery Options
- Logical Transactions
- Dynamic Roll-Back Recovery
- Intrinsic Level Recovery
- Logging Preparation
- Step 1--Checking MPE/iX Logging Configuration
- Step 2--Acquiring Logging Capability
- Step 3--Logging to Tape or Disk
- Step 4--Building a Log File for Logging to Disk
- Step 5--Creating the Log Identifier
- Step 6--Setting the Log Identifier
- Step 7--Setting Flags for the Database Backup Copy
- Step 8--Making a Database Backup Copy
- TurboSTORE/iX 7x24 True-Online Backup
- Logging Status
- Logging Maintenance
- Roll-Forward Recovery
- Roll-Back Recovery
- DBRECOV Commands Used with Roll-Forward and Roll-Back Recovery
- Recovery Tables
- Post-Recovery Options
- The Mirror Database
- 8 Using the Database Utilities
- Restructuring the Database with TurboIMAGE/XL Utilities
- Summary of Utility Routines
- Utility Program Operation
- DBLOAD
- DBRECOV
- >CONTROL
- >EXIT
- >FILE
- >RECOVER
- >ROLLBACK
- >RUN
- DBRESTOR
- DBSTORE
- DBUNLOAD
- DBUTIL
- >>ACTIVATE
- >>ADDINDEX
- >>CREATE
- >>DEACTIVATE
- >>DETACH
- >>DISABLE
- >>DROPINDEX
- >>ENABLE
- >>ERASE
- >>EXIT
- >>HELP
- >>MOVE
- >>PURGE
- >>REBUILDINDEX
- >>REDO
- >>RELEASE
- >>SECURE
- >>SET
- >>SHOW
- Syntax
- Parameters
- Example (Show Users)
- Example Discussion
- Example (Show All)
- Example Discussion
- Example (Show Capacity)
- Format of Show Device List
- Example (Show Device)
- Format of Show Indices
- Example (Show Indices)
- Format of Show Locks List
- Example 1 (Show Locks)
- Example 1 Discussion
- Example 2 (Show Locks)
- Example 2 Discussion
- >>VERIFY
- 9 Using a Remote Database
- 10 Internal Structures and Techniques
- 11 B-Tree Indices
- A Error Messages
- B Results of Multiple Access
- C Database Design Considerations
- D Multiple Calls to DBLOCK
- E TurboIMAGE/XL Log Record Formats
- F MPE/iX Log Record Formats
- G Recovery and Logging Quick Reference
- H TurboIMAGE/XL versus TurboIMAGE/V

Chapter 4 107
Using the Database
Reading the Data
During directed access the calling program specifies a record number or address. If any
entry exists at this address, TurboIMAGE/XL returns the values for the data items
requested in the calling program's buffer. If no such entry exists, the program is notified by
an exceptional condition return, such as end-of-file, beginning-of-file, or no entry.
This access method can be used with any type of data set and is useful in situations where
the calling program has already determined the record number of the entry to be read. For
example, if a program surveys several entries using another access method to determine
which one it wants to use in a report, it can save each record number and use the record
number of the entry it selects to read the entry again using the directed access method.
If a program performs a directed read of record 3 of the INVENTORY data set, the entry
marked with a hollow arrow in Figure 4-2. is read. If a directed read of the SUP-MASTER
data set record 7 is performed, the entry in that set marked with the same type of arrow is
read.
NOTE
When using directed access with master data sets, you should be aware of
migrating secondaries. These are described in chapter 10.
Locking. If concurrent users are allowed to add to or delete from a data set, locking
should be used during the search and report sequence to ensure the record numbers do not
change before they are used. In this type of application, a data set lock is usually the most
appropriate.
Serial Access
In this mode of retrieval, TurboIMAGE/XL starts at the most recently accessed storage
location for the data set, called the current record, and sequentially examines adjacent
records until the next entry is located. Data items from this entry are returned to the
calling program, and its location becomes the current record.
You can use both forward and backward serial access. Forward serial access consists of
retrieving the next greater-numbered entry, and backward serial access consists of
retrieving the previous lower-numbered entry. If no entry is located, TurboIMAGE/XL
returns an end-of-file if requested access is forward, or a beginning-of-file if it is
backwards.
Because no current record exists the first time a program requests an entry from a data
set, a request for forward serial access causes TurboIMAGE/XL to search from record 1.
Similarly, a backward serial retrieval begins at the highest numbered record.
The entries connected by curved arrows in Figure 4-2. are read by a program using the
serial access method. If a forward serial read is performed on the INVENTORY data set
before any other type of read, the entry in record number 2 is read. If another forward
serial read is performed on the same data set, the entry in record 3 is read. On the other
hand, if a serial read is performed and the current record is 6, the entry in record 9 is read.
The next forward serial read returns an end-of-file.
The serial access method can be used with any type of data set and is very useful if most or
all of the data in the data set is to be retrieved, for example, to be used in a report. It is
efficient to retrieve all the data in a serial manner, copy it to a file, and sort it with routines
external to TurboIMAGE/XL before printing the report. The availability of serial access