TurboIMAGE/XL Database Management System Reference Manual MPE/iX V6.5 (30391-90011)

254 Chapter6
Host Language Access
ORDERS Database Model Program
ERROR CHECKING
DISPLAY List
____________________________________________________________________
Account Last-Name First-Name Initial
EXIT LOOP if first word of Status buffer <gt; 0
END LOOP
CALL DBUNLOCK (DBname, Customer_Master, Mode1_Unlock, Status)
ERROR CHECKING
END ROUTINE
Adding an Entry
(USER SELECTS 6 TO DO A PUT)
ROUTINE: Add_A_Product
* OBJECTIVE: This routine adds one entry to the Product master data
* set. After obtaining user input, the data set is locked
* for exclusive access. A transaction starts, and
* new values are added by a call to DBPUT. At the end
* of the routine, the transaction is ended and locks
* are released.
*
* ACCESS: Mode 1 - Shared Modify Access
*
* CALLED BY: Main Line
*
* CALLS: DBLOCK in mode 3 (unconditional)
* DBBEGIN in mode 1 (transaction begin)
* DBPUT in mode 1 (put)
* DBEND in mode 1 (transaction end)
* DBUNLOCK in mode 1 (unlock)
BEGIN ROUTINE
Product_Buffer is made up of:
Stock#
Description
OBTAIN Stock# user input
OBTAIN Description user input
OBTAIN List "
@
;"
CALL DBLOCK (DBname, Product_Master, Mode3_Unconditional, Status)
ERROR CHECKING
OBTAIN Text "Add entry to Product set Begin "
OBTAIN Textlen 16
CALL DBBEGIN (DBname, Text, Mode1_Xbegin, Status, TextLen)
ERROR CHECKING
CALL DBPUT (DBname, Product_Master, Mode1_Put, Status, List,
Product_Buffer)
ERROR CHECKING
OBTAIN Text "Add entry to Product set End"