User Index Considerations
Related Information
Chapter 2 in the
System API Reference
, SC41-5801
APIs and the QUSRTOOL Library
QUSRTOOL, an optionally installable library, has several tools that use APIs and
include files (header files) for APIs. You can use the code as a model for your
programming. As of Version 3 Release 6, source include files will be removed from
this library. APARs against the offerings in QUSRTOOL are not allowed. There is
no support for enhancements or fixes to the contents of the library other than a
complete reshipment that occurs with each release. If you intend to use the tools,
you should copy the members that you plan to use to your own source libraries.
User Index Considerations
The performance of a user index is much better than that of a database file.
However, before using a user index, you must know the functional differences
between a user index and a database file.
The contents of a database file are not affected by an abnormal system end. On
the other hand, the contents of a user index may become totally unusable if the
system ends abnormally. Therefore, you should not use a user index if the infor-
mation you want to store needs to remain without errors after an abnormal system
end.
If your system abnormally ends when you are removing or inserting a user index
entry, unpredictable results may occur. If you are inserting or removing a user
index entry and you do not force the index entry to the disk unit using one of the
following:
A user index created with the immediate update parameter set to 1 (affects
performance)
A modify index (MODIDX) MI instruction with the immediate update bit set to 1
The set access state (SETACST) MI instruction
and the system abnormally ends, your index is probably damaged.
To determine if your last system power down was normal or abnormal, you can
check the system value QABNORMSW.
You will not get an error message if your index is damaged. The definition of your
index is usable; it is probably the data in your index that is bad.
You can log changes to a database file in a journal, and you can use the journal to
apply or remove those changes later. You can also use the journal to audit who is
using the database file. However, the system does not support the journaling of
indexes. As a result, user applications should log entries in a journal to keep track
of changes to the index, but you cannot update the index using apply and remove
journal entry functions. For more information on journaling, see the Journal and
Commit APIs in the
System API Reference
book, SC41-5801.
Indexes support the storage of data that does not need to remain after an abnormal
system end. If an abnormal system end does occur, you must use a backup copy
of the index that was previously saved or create a new copy of the index.
2-30 System API Programming V4R1