Rules for Deletion of Records
The Rules for Deletion of Records file contains the logical rules that determine whether a record can be deleted. The Rules for Deletion of Records file can contain rules for any record type.
Data Elements
The rules are read from the beginning of the file, continuing to the end. As the system reads each rule, if any of the associated records does not meet the conditions in that rule (i.e., the rule "tests false"), then the record cannot be deleted, and the message at the end of the last line in the failing rule is displayed to the operator. The record can be deleted only if all the rules in the Rules for Deletion of Records file "test true" for all associated records.
A maximum of thirty rules can appear in this file. Any combination of single and multiple line rules can count toward this maximum.
The structure of a rule line is:
q|o| |20| |~|c| | is status "c" | | | | | | | | | | | | | | | | | `--- Message | | | | | | | `--- Target2 | | | | | | `--- Target1 | | | | | `--- Operation Type | | | | `--- Rule | | | `--- Fixflds Line# | | `--- Variable Tag | `--- Record Type `--- Logic Operator
Logic Operator
Contains a single character that controls the grouping of adjacent lines into one rule.
Possible values are:
Element Value |
Meaning |
---|---|
^ | The condition on this line is ANDed with the condition on the following line. |
v | The condition on this line is ORed with the condition on the following line. |
q | Denotes the last line of the rule (i.e., quit). |
Record Type
The type of record to which the rule applies. All condition lines for a given rule must contain the same record type.
Variable Tag
Used for testing variable-length fields only, although this element is almost exclusively used to test the LINK REC tag. Specifies the field group tag of the variable-length field to test. This element is NULL or BLANK if the tested field is a fixed-length field.
- To test the LINK REC tag (tag ^), enter a list of record types into the Rule element.
- To test a specific MARC tag within the field group, enter it into the Rule element.
- If the record contains only MARC fields, a particular MARC field can be specified by entering M in the Variable Tag element and the MARC tag and, optionally, indicators into the Rule element.
- See the list of Special Field Codes for information on additional fields that can be specified in this element.
Fixflds Line#
Used for testing fixed-length fields only. Specifies the line number of the fixed-length field in the fixed-length fields file. You can find the number of a particular fixed length field by viewing the list displayed in the Long names for fixed length fields file. This element is NULL or BLANK if the tested field is a variable-length field.
Rule
If the Variable Tag element contains an III tag, this element can contain further specifications about the variable-length field to be tested; otherwise it is NULL or BLANK.
Values that can appear in this element are:
- If the Variable Tag element is ^ (the LINK REC field), this element specifies the linked record types, either a single record type (e.g., i, o, etc.), a list of record types (e.g., oi for both order and item records), or + for all record types. The system counts how many links exist to the specified record types and the Operation Type and Target1 elements are then used to test this count against a specified value. Note that a LINK REC rule must be a single-line rule (the ^ and vlogic operators cannot be used in a LINK REC rule).
Some examples:q|b|^||i|=|0||This is a one-line rule that tests bibliographic records for links to item records. If the number of item record links is 0, then the rule allows the deletion.q|b|^||oi|=|0||This is a one-line rule that tests bibliographic records for links to item and order records. If the number of item record and order record links is 0, then the rule allows the deletion.q|b|^||+|=|0||This is a one-line rule that tests bibliographic records for links to any type of record. If the number of record links is 0, then the rule allows the deletion. - For other variable-length fields, this element can contain a specific MARC tag with optional indicators in the form xxxii, where xxx is the MARC tag and ii is the optional MARC tag indicators (e.g., 04101). Only the specified MARC tag/indicator field will be tested.
- If the record contains only MARC fields, a specific MARC tag can be tested by entering M in the Variable Tag element and the MARC tag with optional indicators into the Rule element (in the same xxxii format detailed above).
Operation Type
Logic that the data in the specified tag must meet for the rule to allow the deletion. This defines the relationship that must exist between the data in the specified field in the tested record and the value(s) in the Target1 and Target2 elements that follow. Possible values are:
Operator | Description |
---|---|
= | Equal to |
g | Greater than or equal to |
> | Greater than |
< | Less than |
l | Less than or equal to |
~ | Not equal to |
w | Between |
h | Has |
e | Exists |
n | Does not exist |
For all operation types other than w (between), the value against which to test the field is contained in the Target1 element. For the w operation type, the field's value must be between the values in the Target1 and Target2 elements.
Target1
Value against which to test the field. If this element is NULL, then the deletion is allowed if the field in the Variable Tag or Fixflds Line# element does not exist in the tested record. Wildcards are not supported.
For testing LINK REC fields, this value is the number of occurrences of the field that the tested record must contain to allow the deletion. A value of 0 means that the tested record must contain NO occurences of the field.
For DATE fields, use three blank spaces to specify a blank date. For example:
^|i| |65||=| || and due date is blank
Target2
Used with the w (between) operator only to specify the second value for the Variable Tag or Fixflds Line#. This element is NULL for other operators. Wildcards are not supported.
Message
If the Logic Operator element is q (i.e., this is the last line in the rule), then the string in this element is displayed to the user if the rule has denied the deletion request. This element can contain internationalized messages.
Editing the Rules for Deletion of Records File
Never remove or comment out deletion rules that were put in place by Innovative Interfaces. Never make a change of any kind to deletion rules that were put in place by Innovative Interfaces. Doing so will cause corruption of the database. If you are uncertain as to whether a rule may be edited, contact Innovative.
- In the Select file drop-down menu of the ASAA function, choose Rules for Deletion of Records and then Select.
- The Message element in the Rules for Deletion of Records file can be internationalized. This allows you to enter similar messages in more than one language and the system will display the appropriate one, depending on the current language. For information on adding or editing internationalized messages, see Internationalized Rule File Messages.
- See About the Rule Files for information on editing rule files.
- Enter your changes.
To distinguish the rules you input from those input by Innovative, insert a comment including when, why, and by whom the rule was added (any line whose first character is a '#' is a comment). A standard method of adding a comment is to precede and follow it by commented-out lines as in the following example:
Before saving changes to the Rules for Deletion file, review Tips for Editing Rule Files to make sure your changes are correctly formatted and error-free.
# # jrm - 12/05/03 - block deletion of special coll. items #
- Choose OK.
- Select the Save tool to save your changes.
The system automatically restarts all WebPAC servers running on your Innovative machine(s) after you save your changes.
After editing the Rules for Deletion of Records file, users must log out of Sierra and log in again so that the changes are applied to their sessions.
Annotated Examples
Single Line Rule
Allow deletion of bibliographic record if there are no attached item records:
q|b|^| |i|=|0| | has item record attached
Data Element | Value | Meaning |
---|---|---|
Logic Operation | q | Last line of rule |
Record Type | b | Test the bibliographic record |
Variable Tag | ^ | Test the LINK REC field |
Fixflds Line# | BLANK | Unused for this rule |
Rule | i | Test for links to item records |
Operation Type | = | Field must equal the value in the Target1 element to allow the deletion |
Target1 | 0 | Value that will allow the deletion |
Target2 | BLANK | Unused for this rule |
Message | ..... | Message to display if the deletion is denied |
Multiple Line Rule
Allow deletion of patron record only if there are no items checked out to that patron:
^|p| |50| |=|0| | Delete only if current checkouts = 0
q|p|^| |i|=|0| | has items checked out
Line One
Data Element | Value | Meaning |
---|---|---|
Logic Operation | ^ | AND this line with the next line |
Record Type | p | Test the patron record |
Variable Tag | BLANK | Unused for this condition |
Fixflds Line# | 50 | Test fixed-length field 50 (CUR CHKOUT) |
Rule | BLANK | Unused for this rule |
Operation Type | = | Field must equal the value in the Target1 element to allow the deletion |
Target1 | 0 | Value that will allow the deletion |
Target2 | BLANK | Unused for this rule |
Message | ..... | Comment—Does not display to the user |
Line Two
Data Element | Value | Meaning |
---|---|---|
Logic Operation | q | Last line of rule |
Record Type | p | Test the patron record |
Variable Tag | ^ | Test the LINK REC field |
Fixflds Line# | BLANK | Unused for this condition |
Rule | i | Test for link to item records |
Operation Type | = | Field must equal the value in the Target1 element to allow the deletion |
Target1 | 0 | Value that will allow the deletion |
Target2 | BLANK | Unused for this rule |
Message | ..... | Message to display if the deletion is denied |
Additional Examples
Allow deletion of a bibliographic record if it contains no MARC 962 (linked images) fields:
q|b|y||962|n||| has images attached
Allow deletion of a course record if there are no item records linked to it via '9' fields:
q|r|9|||n||| is on reserve
Allow deletion of item record if not checked out (note the use of three spaces to check for blank DATE fields):
# Test to see if item checked out ^|i| |63||=| ||Delete only if checkout date is blank ^|i| |65||=| ||and due date is blank ^|i| |73||=| ||and overdue date is blank ^|i| |75||=| ||and recall date is blank ^|i| |66||=|0|| and patron# in patron# fixed field is 0 # and no patron link field present q|i|^||p|=|0|| is checked out
Two-Line Rules
You might see the following two-line rules in your library's Rules for Deletion of Records file:
# test course record to see if items linked to it ^|r|7|||n||| q|r|9|||n||| is on reserve # another item test, to see if there is a hold on the item ^|i|8|||n||| q|i|9|||n||| has a hold on it
Both of these rules contain errors, although these errors do not cause the rules to fail. The error is that there is no '7' field in reserve records, and no '9' field in item records (see the list of Special Field Codes).
If you find these rules in your library's Rules for Deletion of Records file, you should change them to the following one-line rules:
# test course record to see if items linked to it q|r|9|||n||| is on reserve # another item test, to see if there is a hold on the item q|i|8|||n||| has a hold on it