HP RPG/XL Programmer's Guide (30318-90001)

3- 47
8 This line begins the input record description of the DACCOUNT
file.
9 This line reads the D-ACCOUNTS data set randomly.
Columns 18-27 contain ACTNO to specify the key field.
Columns 28-32 contain CHAIN to specify a chained read operation.
Columns 54-55 contain 80 to turn on indicator 80 when a record
is not found for the account number in D-ACCOUNTS.
Columns 56-57 contain the H0 indicator to avoid a compiler
warning for the CHAIN operation. The end-of-chain indicator has
no meaning since records are accessed randomly.
10 This line performs exception output when the appropriate record
is found in D-ACCOUNTS (indicator 80 in not on).
11 This line defines the exception output operation for deleting
records.
Column 15 is E to identify this record as an exception record.
Columns 16-18 are DEL to specify that records are deleted from
D-ACCOUNTS.
Columns 32-37 are DELREC to name the EXCPT Name for the record
to be deleted.
Providing Security for TurboIMAGE Databases and Data Sets
TurboIMAGE lets several users access a database simultaneously.
To ensure that there will be no access conflicts, you should specify the
security provisions in each RPG program. You can specify security at the
database, data set or data record (item) level. There are two ways for
doing this. You can specify that database and data set security be
handled automatically by RPG. If you need more flexibility, you can
provide this security by locking and unlocking databases or data sets
yourself. The next two sections discuss automatic and manual locking and
unlocking in detail.
Automatically Locking and Unlocking TurboIMAGE Databases and Data Sets.
To have RPG automatically lock and unlock a TurboIMAGE database, data set
or data record, enter a locking mode in column 66 of the IMAGE File
Description Continuation Specification. The locking modes that you can
select are:
Table 3-1.
---------------------------------------------------------------------------------------------
| | |
| Column 66 | Description |
| | |
---------------------------------------------------------------------------------------------
| | |
| B | Lock the entire database when the program starts and unlock it when |
| | the program ends. |
| | |
---------------------------------------------------------------------------------------------
| | |
| S | Lock the data set when the program starts and unlock it when the |
| | program ends. |
| | |
---------------------------------------------------------------------------------------------
| | |
| 1 | Lock the entire database before a record is read, written or updated. |
| | Unlock it after the record is read, written or updated. |
| | |