Unnecessary z30h history records
- Article Type: General
- Product: Aleph
- Product Version: 20, 21, 22, 23
What updates cause a z30h item history record to be written? It seems that more are being written than need to be.
KCS article No History records for certain items **MASTER RECORD** discusses the conditions for z30h record creation.
The reason for the writing of the z30h is recorded in the z30h_h_reason. Possible values, from ./xxx50/tab/tab_item_history.eng, are:
ITEM-LOCATION L Location
ITEM-CALL-NO-2 L Location2
ITEM-COLLECTION L Collection
ITEM-SUB-LIBRARY L Sublibrary
ITEM-PROCESS-STATUS L Process Status
ITEM-BARCODE L Barcode
BIND L Deleted (Bound)
DELETE L Deleted
ITEM-STATUS L Status
SHELF-REPORT-NUMBER L Inventory Check
ITEM-MATERIAL L Material Type
ITEM-DESCRIPTION L Item Desc.
ITEM-CIRC-NOTE L Circ Note
ITEM-INT-NOTE L Internal Note
ITEM-OPAC-NOTE L OPAC note
ITEM-LOCATION-TYPE L Location Type
ITEM-CALL-NO-2-TYPE L Location2 Type
ITEM-COPY L Copy Number
ITEM-ENUM-A L Enum Level 1
ITEM-ENUM-B L Enum Level 2
ALL-FIELDS L All fields
If "ALL-FIELDS" is specified, then a z30h record will be written for each loan (update of z30h_no_loans) and return (update of z30h_last_return_date). We strongly suggest the use of "ALL-NON-CIRC" instead of "ALL-FIELDS". From the tab_item_history header:
! Use "ALL-NON-CIRC" in order to register all changes except
! of item changes caused as a result of item's circulation activities
! (Z30_DATE_LAST_RETURN, Z30_HOUR_LAST_RETURN, Z30_IP_LAST_RETURN,
! Z30_NO_LOANS and Z30_MAINTENANCE_COUNT).
You could delete all of the z30h records which have only "All fields" as the reason for their being written and which are older than a year. This SQL would be used for that:
SQL> delete from z30h where Z30H_H_REASON = 'All fields' and z30h_h_date < 'yyyymmdd';
Note that this will *not* delete z30h records which have a Z30H_H_REASON field with other reasons in addition to 'All fields'.
But note that "ALL-FIELDS" includes all of the "ALL-NON-CIRC" fields in addition to the above. So when "ALL-NON-CIRC" has not been specified, then the deletion of "ALL-FIELDS" records will delete records which were updated for those other reasons as well.
You should back up the z30h with the file-03 Service before running this.
See also the article, " Best practices - retention of item/circ history tables " in regard to deleting old z30h records.
- Article last edited: 9-Feb-2016