Skip Navigation LinksAbout > User Guide > Batch Editing > Global Editing > Commands > Conditions

Conditions



Overview

Conditions are added to Commands to specify criteria that the field or record must meet in order to make any changes. The condition can apply either to the Field to update configured in the command or any other field in the MARC.

You can apply many Conditions to a command. A group of combined conditions is called a Condition Set. A MARC record must pass all the conditions in a Condition Set to make changes.

The following section is displayed on the configuration window:

Conditions

  • New Action - Adds a new Action that will be performed if the conditions are met. Actions only appear for Add or change field/subfields Commands. See the Actions documentation for more information.

  • New Condition - Adds a new condition.

  • Reorder - Reorder actions and conditions in a different sequence.

  • Help - Opens this Global Edit help documenation.

  • Condition list - List of the conditions already created. Click on a condition to Edit or Delete it. This section's text is customized based on the command and options selected.

Ordering conditions

Conditions are run in the order they are displayed, from the top down. The order only matters when specifying the Or option in a condition to create a new Condition Set.

  • When there is more than one condition, click Reorder to switch to Reorder Mode.

  • Click and drag Conditions up or down to put them in the order you desire.

  • When finished, click End Reorder to stop reordering.

Add / Edit / Delete conditions

  • Click New Condition to add a new condition or click on an existing condition in the Condition list to edit it.

    Condition list

  • The Condition window opens:

    Edit Condition

    Options for creating a condition vary depending on the Command and whether you are editing a data field or control field.

  • Select your options:

  • After entering the details, click OK to save this condition or Cancel to close the window without saving.

  • If this was an edit, click Delete to remove this condition.

Condition Sets (And vs. Or)

A Command can contain many different conditions. Specify how the conditions work together by using the And / Or setting.

A Condition Set is a group of conditions that all must pass in order for the record to be updated. Conditions with an And setting get added to the same Condition Set.

Conditions with an Or setting start a new Condition Set and any other conditions after it get added to the new Condition Set until another one is created. Only one of the Condition Sets must pass in order for the record to be updated.

Example:

Conditions:

Condition 1: Contains "Animals"
Condition 2: Contains "sears"
Condition 3: OR Contains "Cats"
Condition 4: OR Contains "Tiger"

Note that when conditions are displayed, the And is implied. Only Or settings are displayed in the condition list.

Result:

This creates 3 condition sets:
Condition Set 1: Contains "Animals" and "sears"
Condition Set 2: Contains "Cats"
Condition Set 3: Contains "Tiger"

The global edit actions are performed only on the fields that match any one of these 3 condition sets.

Condition target

Select an option from the list which describes the Target of your condition. This refers to what part of the MARC record you want to look at for this condition.

Condition target

When a control field is selected, another option A position in the ### is also available. For data fields, this is hidden.

The field, subfield, or position

Use these options to filter just the fields in the command you wish to update. When possible, the wording of these options uses the field tag from the Command. For example:

  • For the Add or change field/subfields command
    • The 650 field - evaluate all subfields in the Field to update (i.e. 650) or the value of the field's indicators.
    • A subfield in the 650 - evaluate a single subfield in the Field to update (i.e. a subfield in the 650).

      Select a subfield from the list of valid ones, or select Other subfield... and type in a subfield.

    • A position in the 008 - evaluate a single character in the Field to update (i.e. a control field position in the 008).
  • For the Find & Replace command
    • The search field - evaluate each field that is being searched (either All fields or Specific fields or subfields) and only replace if the condition passes.
  • For the Delete command
    • The field to delete - evaluate each entered field and delete only those fields that the condition passes.

Example:

Sears subject headings should have a second indicator set to 7 and a subfield $2 set to sears. Some subjects were cataloged with the correct subfield $2 but an incorrect second indicator. Fix just the incorrect subjects.

Sample record:

650 -1 $a Animals. $v Fiction.
650 -7 $a Animals. $v Fiction. $2 sears
650 -1 $a Animals $x Food. $v Fiction. $2 sears (Incorrect 2nd Indicator)
655 -7 $a Children's stories. $2 gsafd

Solution:

  • Create a new Global Edit with the following options:

    Command

  • Set the Command to Add or change field/subfields.

  • Set the Field to update to 650 to make changes in the 650 subject heading field.

  • Check Change indicators and enter 7 in the New Indicator 2 box. Leave New Indicator 1 box empty so no changes are made to the first indicator.

  • Add a new Condition with the following options:

    Condition

    A subfield in the 650 $2 Contains 'sears' - This makes sure to only change 650 subfields that have a $2 of sears

  • Run the Global Edit. Each 650 in the record is evaluated and only those that have a $2 containing 'sears' will have their Indicator 2 set to 7.

Result:

650 -1 $a Animals. $v Fiction. (Unchanged 2nd Indicator)
650 -7 $a Animals. $v Fiction. $2 sears
650 -7 $a Animals $x Food. $v Fiction. $2 sears (Fixed 2nd Indicator)
655 -7 $a Children's stories. $2 gsafd

Other field or subfield

Unlike the The field, subfield, or position target, the Other field or subfield option lets you choose any field or subfield in the MARC record to check the condition against. Use this type of condition if you simply want to verify that a record has a value in a particular field before updating some other aspect of the record.

  • For the Add or change field/subfields command, the command options and Actions are performed on all fields if this passes.
  • For the Find & Replace command, perform the Find & Replace on all the fields only if this condition passes.
  • For the Delete command, perform the Delete on all the entered fields only if this condition passes.
  • For the Update record command, perform the command's options on the record only if this condition passes.

Enter the field, subfield, or ranges to check, separated by commas. Click Browse... to use the Field/subfield selection window to select fields and subfields by name.

See this example that uses Other field or subfield to update the call number prefixes of a record when the Accelerated Reader field has a value of less than 1.6.

The record

The record's target works like Other field or subfield except it contains condition options that apply to the entire record. If the condition passes, the command actions are run, otherwise nothing happens.

  • Material type is - the record's material type matches the material type selected. The material type of a record is determined by a combination of items in the record such as the record's Leader, control fields (007, 008), or subfields depending on the type selected. For instance, use this to write a condition to determine if the record is a Fiction Book, a DVD Videorecording, or a Map.

  • Material type is not - the record's material type does not match the material type selected

  • Leader - the record's Leader is checked and the character in the given position matches one of the character values you enter

Condition types

After selecting a target, valid condition types corresponding to that target are shown. Select one of the options and enter appropriate values for each as detailed below:

Condition types

Contains / Does not contain

The Contains condition searches the target for certain text and passes if it is found. The Does not contain condition returns the opposite of Contains, passing when the text is not found.

Contains

  • Any text - If the field or subfield has anything in it, the condition passes. If the subfield does not exist or is entirely empty, it fails.
  • Specific text - Enter the text to find. If the field or subfield has that value in it, the condition passes. If not, it fails.
  • Match case - When checked, the case of the entered characters must be exact. (i.e. A does not equal a). When unchecked, the case of the text is ignored (i.e. A equals a as well as A).
  • Whole words only - When checked, the Specific text must exist as a whole word. For instance, finding "cow" as a whole word will not match the "cow" in "coward".

Indicator is / Indicator is not

The Indicator is condition searches the target data field's indicator (either Indicator 1 or Indicator 2) for a given value and passes if it is found. The Indicator is not condition returns the opposite of Indicator is.

Indicator

  • A non-blank character - If the field's indicator has anything other than a space, the condition passes. If the indicator is a space, it fails.
  • One of these char(s) - Enter any number of characters to match against the indicator. If the indicator matches any of those characters, the condition passes. If not, it fails.
  • Match case - When checked, the case of the entered characters must be exact. (i.e. A does not equal a). When unchecked, the case of the characters is ignored (i.e. A equals a as well as A).

Is ALL UPPER CASE / is all lower case

The Is ALL UPPER CASE condition passes if all the characters of the target are in upper case. The is all lower case condition passes if all the characters of the target are in lower case. Many characters such as spacing or punctuation have no specified case, and are ignored.

Case

Value is

The Value is condition compares the contents of the target field with an entered value. Click one of the following operators:

  • < Is Less Than
  • Is Less Than or Equal To
  • = Is Equal to
  • > Is Greater Than
  • Is Greater Than or Equal To

Value

Enter the text you'd like to compare the value of the target MARC data to.

Comparisons are either Alphabetic or Numeric. Check the Use numeric comparisons box to select Numeric comparions.

  • Alphabetic comparisons - When comparing alphabetically, the condition is checking whether the alphabetic value in the target text comes before (less than) or after (greater than) the entered value.

    Use this setting only when the target value contains non-numerical data, such as wanting to global edit records that have a Call Number Prefix between F and G.

  • Numeric comparisons - When comparing numerically, the target text is searched for the first number it can find and then is compared numerically to the value entered (which must also be a number).

    • Other target text such as punctuation or surrounding abbreviations are ignored
    • Numbers can be whole (100) or decimal (125.50)
    • If no number is found, the condition fails

    For instance a price field with 123.45usd. in it will use the number 123.45 in the comparison and the usd. is ignored.

    See this example of a numeric comparison that updates only records with an Accelerated Reader value of less than 1.6.

Count is

The Count is condition counts the number of fields or subfields and compares it to the number entered.

  • If The ### field is selected, the number of target fields are counted and compared against the value number
  • If A subfield in the ### is selected, the number of target subfields of each field are counted and compared against the value number

Count

Click one of the following operators:

  • < Is Less Than
  • Is Less Than or Equal To
  • = Is Equal to
  • > Is Greater Than
  • Is Greater Than or Equal To

Enter the total count you'd like to compare the target number against.

For instance, selecting The 650 field, Count is < 3 matches records that have less than 3 subject heading (650) fields.

Index is

The Index is condition compares the sequence number of a given field to the number entered.

For example, the Index is condition can refer to fields like the second 008, 650 fields beyond the 5th one, or the first three Copy/holding in a record.

The index only refers to MARC fields, not subfields. If a subfield is entered, only the field part is used when determining if this condition passes.

Index

Click one of the following operators:

  • < Is Less Than
  • Is Less Than or Equal To
  • = Is Equal to
  • > Is Greater Than
  • Is Greater Than or Equal To

Enter the index of the field you'd like to compare the target number against. 1 refers to the first of that field tag in the record, 2 is the second, 3 is the third, etc.

For instance, selecting The 650 field, Index is > 5 matches all the 650 fields that are after the fifth 650 in the record (the 6th, 7th, 8th, etc).

Matches regular expression

The Matches regular expression condition uses the entered Regular Expression (RegEx) pattern and matches it against the MARC data. If a match is found, the condition passes.

Matches Regular Expression

RegEx patterns are an advanced way of searching through text, similar to wildcard notations, but with significantly more options. Many books and websites are devoted to helping people understand and write regular expression patterns.

When Match case is checked, the case of the alphabetic characters must be exact. (i.e. A does not equal a). When unchecked, the case of the characters is ignored (i.e. A equals a as well as A).

For more details about RegExes see the Regular Expressions page.

Example

You want to add 'EASY ' to the beginning of your Call Number Prefix (in the 852$k) for all records that have an Accelerated Reader score of less than 1.6.

Configure the Global Edit as follows:

Example

Command: Add or change field/subfields, Field to update: Copy/Holdings
Action 1: Add 'EASY ' to beginning of Call Number
Condition 1: A subfield in the copy/holding Call Number, Does not contain 'EASY'
Condition 2: Other field or subfield 526$a Contains 'Accelerated Reader'
Condition 3: Other field or subfield 526$c Value is < 1.6 (numeric)

Condition 1 ensures that we only add 'EASY ' to fields that don't already have it. This condition refers to the Copy/Holding that was described in the Field to update target of the command. It filters out all the Copy/Holdings that already have 'EASY' and will only update the ones that do not.

Condition 2 and 3 work together to check the record to see if it has a 526 with subfield $a containing 'Accelerated Reader' and a $c with a number less than 1.6. These use the Other field or subfield target conditions because they are merely checking the value of a field different than the one we are updating (Copy/Holding). If either of these conditions fail, the entire record does not pass and no changes are made.

Result: If a record is found that has a 526 that is both Accelerated Reader and has less than 1.6 points, every Copy/Holding that doesn't have 'EASY' in it will get 'EASY ' added to the beginning of the Call Number subfield.


< Previous: Actions Next: Regular Expressions >
Skip Navigation LinksAbout > User Guide > Batch Editing > Global Editing > Commands > Conditions
© 2024 Mitinet Library Services ▼