TurboIMAGE/XL Database Management System Reference Manual MPE/iX V6.5 (30391-90011)
276 Chapter6
Host Language Access
COBOL II
DISPLAY CLEAR SCREEN
DISPLAY "****************************************"
DISPLAY "* No Such Entry in the Product Data Set."
DISPLAY "* Please Try Again. "
DISPLAY "****************************************"
DISPLAY "Press Enter To Continue ------------->"
NO ADVANCING
ACCEPT OPTION FREE
ELSE
PERFORM 1100-GET-ERROR-AND-EXPLAIN
END-IF
END-IF
IF FOUND THEN
DISPLAY SPACE
DISPLAY "Data On Stock # = ", KEY-ITEM-VALUE-PRODUCT
DISPLAY "**********************************************"
DISPLAY "* *"
DISPLAY "* Stock # = ", STOCK-NUMBER OF PRODUCT-BUFFER
DISPLAY "* Product = ", DESCRIPTION OF PRODUCT-BUFFER
DISPLAY "* *"
DISPLAY "**********************************************"
DISPLAY SPACE
DISPLAY SPACE
DISPLAY "Press Enter To Continue ------------->"
NO ADVANCING
ACCEPT OPTION FREE
END-IF.
Retrieving Data Serially (with Set Level Locking)
This paragraph implements the LIST-ALL-CUSTOMERS routine of the sample program.
Serial read of the Customer data set is achieved using multiple calls to the DBGET
procedure in mode 2. Using the list parameter the routine requests only the ACCOUNT,
FIRST-NAME, LAST-NAME, and INITIAL data items.
This procedure locks the Customer data set exclusively using a call to the DBLOCK
procedure in mode 3. The subsequent DBUNLOCK releases this lock. This is done when the
exceptional condition, end of data set, is encountered. Locking in a shared modify access
environment guarantees that no other user is modifying the data that you are reading.
Error trapping calls 1100-GET-ERROR-AND-EXPLAIN for any non-exceptional condition
codes.
******************************************************************
* ACCESS : Mode 1 - Shared Modify Access
*
* Called By: 30-DO-ACTION
*
* Calls : DBLOCK in mode 3 (unconditional)
* DBGET in mode 2 (forward read)
* DBUNLOCK in mode 1 (unlock)
* 1100-GET-ERROR-AND-EXPLAIN
500-LIST-ALL-CUSTOMERS.
DISPLAY CLEAR SCREEN
DISPLAY SPACE
DISPLAY "Acct-Number N A M E"
DISPLAY "-------------------------------------------"