Tech Blog

Alma Normalization Rule Examples

see also: Working with normalization rules

  • Note 1:  If you do copy/paste here make sure the quotation marks transfer correctly.
  • Note 2: Some of the examples use “priority” and some use “salience”.  The “priority” and the “salience” work the same way.
  • When there is a priority or a salience the the higher priority or salience occurs first. 2 occurs before 1 and 10 occurs before 9

Delete the 007 field if it begins with ‘c’

rule "remove 007 if it starts with c"
when
(TRUE)
then
removeControlField "007" if (existsControl "007.{0,1}.c")
end

Delete the 007 field if it begins with ‘c’ and there is also another 007 beginning with a different letter.

rule "remove 007 if it starts with c and there is another 007 beginning with a different letter"
when
(existsControl "007.{0,1}.a") OR  (existsControl "007.{0,1}.d") OR (existsControl "007.{0,1}.f") OR   (existsControl "007.{0,1}.g") OR (existsControl "007.{0,1}.h")  OR (existsControl "007.{0,1}.k") OR (existsControl "007.{0,1}.m") OR  (existsControl "007.{0,1}.o") OR (existsControl "007.{0,1}.q") OR   (existsControl "007.{0,1}.r") OR (existsControl "007.{0,1}.s")  OR (existsControl "007.{0,1}.t") OR   (existsControl "007.{0,1}.v") OR (existsControl "007.{0,1}.z")   
then
removeControlField "007" if (existsControl "007.{0,1}.c")
end

Deal with 955 and 954 when publishing to Rapid

(If both 955 and 954 exist then delete the 955.  If 955 exists and 954 does not exist then change the 955 to 954)

rule "if there is a 954 and a 955 then delete the 955"
when 
(exists "954.a.*" ) AND (exists "955.a.*" )
then
removeField "955"
end

rule "change 955 to 954 if there is a 955 and there is not a 954"
when 
(not exists "954.a.*" ) AND (exists "955.a.*" )
then
changeField "955" to "954" 
end

Add a period to the end of 500 subfield a if there is not already a period at the end

rule "Add a period to the end of field 500 subfield a if there is not already a period at the end"
    when
         (TRUE)
     then
            suffix "500.a" with "." if (not exists "500.a.*\\\\." )
end

Remove the last comma in 500 subfield a and do not touch the other commas

(it uses a temporary string with the comma by attaching a suffix to the end and removing the comma and suffix, then removing all other cases of the temporary suffix)

rule "one replace comma at end of 500 a with nothing"
priority 10
    when
         (TRUE)
     then
            suffix "500.a" with "temporary_suffix_to_replace"
end
rule "two replace comma at end of 500 a with nothing"
priority 9
    when
         (TRUE)
     then
            replaceContents "500.a.,temporary_suffix_to_replace" with ""
end
rule "three replace comma at end of 500 a with nothing"
priority 8
    when
         (TRUE)
     then
            replaceContents "500.a.temporary_suffix_to_replace" with ""
end
In:
Out:

Add 202B right to left embedding unicode character to 245 subfield a if it is not already there

rule "add 202B right to left embedding unicode character to 245 subfield a if it is not already there"
when
    TRUE
then
    prefix "245.a" with "u202B" if (not exists "245.a.u202B*")
end
BeforeAfter

Change all 519 fields to 919 then delete duplicate 919 fields

rule "change field 519 to 919"
# the higher priority occurs first.  2 before 1
priority 10
when
(true) 
then
changeField "519" to "919" 
end

rule "remove duplicate 919 fields"
priority 9
when
(TRUE) 
then
correctDuplicateFields "919"
end
BeforeAfter

Fix punctuation in field 245

Note: This rule has three different cases depending on the presence of subfields a, b and c in the 245.

  • If a and b and c are present then subfield a gets a : (colon) at the end it does not already have one and subfield b gets a forward slash (/) at the end if it does not already have one
  • If only a and b are present then subfield a gets a : (colon) at the end if it does not already have one
  • If only a and c are present then subfield a gets a forward slash (/) at the end if it does not already have one

Example 1:

In:     

Out:  

Example 2:

In:    

Out: 

Example 3:

In:    

Out: 

rule "fix 245 when it has sub-fields a and b and c"
# example of what this will do:
# change this:
# 24500 |a Rethinking the French classroom |b new approaches to teaching contemporary French and francophone women |c edited by E. Nicole Meyer and Joyce Johnston.
# to this:
# 24500 |a Rethinking the French classroom : |b new approaches to teaching contemporary French and francophone women / |c edited by E. Nicole Meyer and Joyce Johnston.

when 
(exists "245.a.*" ) and (exists "245.b.*") and (exists "245.c.*") 
then
suffix "245.a" with " :" if (not exists "245.a.*:")
suffix "245.b" with " /" if (not exists "245.b.*/")
end

rule "fix 245 when it has sub-fields a and c"
# example of what this will do:
# change this: 
# 24500 |a French women and the Age of Enlightenment |c edited by Samia I. Spencer.
# to this: 
# 24500 |a French women and the Age of Enlightenment / |c edited by Samia I. Spencer.
when 
(exists "245.a.*" ) and (not exists "245.b.*") and (exists "245.c.*") 
then
suffix "245.a" with " /" if (not exists "245.a.*/")
end

rule "fix 245 when it has sub-fields a and b"
# example of what this will do:
# change this: 
# 24510 |a Daughters of 1968 |b redefining French feminism and the women's liberation movement
# to this: 
# 24510 |a Daughters of 1968 : |b redefining French feminism and the women's liberation movement
when 
(exists "245.a.*" ) and (exists "245.b.*") and (not exists "245.c.*") 
then
suffix "245.a" with " :" if (not exists "245.a.*:")
end

Copy the value of the 008 language code to 041 subfield a in a hard-coded manner

rule "copy 008 language code to 041 if 041 does not exist for French"
when
(existsControl "008.{35,3}.fre") AND (not exists "041.a.*" )
then
addField "041.a.fre" 
end

rule "copy 008 language code to 041 if 041 does not exist for German"
when
(existsControl "008.{35,3}.ger") AND (not exists "041.a.*" )
then
addField "041.a.ger"
end

rule "copy 008 language code to 041 if 041 does not exist for Latin"
when
(existsControl "008.{35,3}.lat") AND (not exists "041.a.*" )
then
addField "041.a.lat"
end

rule "copy 008 language code to 041 if 041 does not exist for Hebrew"
when
(existsControl "008.{35,3}.heb") AND (not exists "041.a.*" )
then
addField "041.a.heb" 
end

Copy the value of the 008 language code to 041 subfield a in a not hard-coded manner

rule "copy 008 language code to 041 if 041 does not exist"
when
# Make sure 009 does not already exist so it will not be overwritten
(not existsControl "009") AND (not exists "041.a")
then
# copy the 008 to 009
copyControlField "008" to "009"
# remove the characters before the language code
replaceControlContents "009.{0,35}" with " "
# remove the characters after the language code
replaceControlContents "009.{4,2}" with " "
# Now you have just the language code so copy it to 041 subfield a
copyField "009" to "041.a"
# remove the temporary field
removeControlField "009"
end

Copy the value of 008 pos. 7-10 year to the 260 or 264 subfield c in a not hard-coded manner

rule "If 009 does not exist then copy the 008 to 009 and make it only year"
salience 100
when
# Make sure 009 does not already exist so it will not be overwritten
  (not existsControl "009" AND not exists "260.c" AND not exists "264.c" )
then
# copy the 008 to 009
  copyControlField "008" to "009"
# remove the characters before the language code
  replaceControlContents "009.{0,7}" with " "
# remove the characters after the language code
  replaceControlContents "009.{5,29}" with " "
# Now you have just the language code in 009
end
#
rule "copy 009 date to 264 if 264 is in use"
salience 90
when 
(exists "264.a.*" )
then
copyField "009" to "264.c"
combineFields "264" excluding ""
end
#
rule "copy 009 date to 260 if 260 is in use"
salience 80
when 
(exists "260.a.*" ) and (not exists "264.a.*") 
then
copyField "009" to "260.c"
combineFields "260" excluding ""
end
#
rule "remove the temporary field"
salience 70
when 
TRUE
then
removeControlField "009"
end

Remove all 650 fields which have 2nd indicator 7

rule "remove 650 if 2nd indicator 7"
when
(TRUE)
then
removeField "650" if (exists "650.{*,7}")
end

Replace “HEB” with “heb” in 041 subfield a

rule "replace 041 a HEB with 041 a heb" 
when 
(TRUE) 
then 
replaceContents "041.a.HEB" with "heb" if (exists "041.{*,*}.a.HEB")
end

Remove all 650 fields which have 2nd indicator 0

rule "remove 650 if 2nd indicator 0"
when
(TRUE)
then
removeField "650" if (exists "650.{*,0}")
end

Remove all 6XX fields which do not have a 2nd indicator 0 or 7

rule "remove 6XX if 2nd indicator is not 7 or 0"
    when
    (TRUE)
    then
    removeField "600" if (exists "600.{*,1}.a.*")
    removeField "600" if (exists "600.{*,2}.a.*")
    removeField "600" if (exists "600.{*,3}.a.*")
    removeField "600" if (exists "600.{*,4}.a.*")
    removeField "600" if (exists "600.{*,5}.a.*")
    removeField "600" if (exists "600.{*,6}.a.*")
    removeField "600" if (exists "600.{*,8}.a.*")
    removeField "600" if (exists "600.{*,9}.a.*")
    removeField "600" if (exists "600.{*, }.a.*")
  
    removeField "610" if (exists "610.{*,1}.a.*")
    removeField "610" if (exists "610.{*,2}.a.*")
    removeField "610" if (exists "610.{*,3}.a.*")
    removeField "610" if (exists "610.{*,4}.a.*")
    removeField "610" if (exists "610.{*,5}.a.*")
    removeField "610" if (exists "610.{*,6}.a.*")
    removeField "610" if (exists "610.{*,8}.a.*")
    removeField "610" if (exists "610.{*,9}.a.*")
    removeField "610" if (exists "610.{*, }.a.*")
  
    removeField "611" if (exists "611.{*,1}.a.*")
    removeField "611" if (exists "611.{*,2}.a.*")
    removeField "611" if (exists "611.{*,3}.a.*")
    removeField "611" if (exists "611.{*,4}.a.*")
    removeField "611" if (exists "611.{*,5}.a.*")
    removeField "611" if (exists "611.{*,6}.a.*")
    removeField "611" if (exists "611.{*,8}.a.*")
    removeField "611" if (exists "611.{*,9}.a.*")
    removeField "611" if (exists "611.{*, }.a.*")
  
    removeField "630" if (exists "630.{*,1}.a.*")
    removeField "630" if (exists "630.{*,2}.a.*")
    removeField "630" if (exists "630.{*,3}.a.*")
    removeField "630" if (exists "630.{*,4}.a.*")
    removeField "630" if (exists "630.{*,5}.a.*")
    removeField "630" if (exists "630.{*,6}.a.*")
    removeField "630" if (exists "630.{*,8}.a.*")
    removeField "630" if (exists "630.{*,9}.a.*")
    removeField "630" if (exists "630.{*, }.a.*")
  
    removeField "647" if (exists "647.{*,1}.a.*")
    removeField "647" if (exists "647.{*,2}.a.*")
    removeField "647" if (exists "647.{*,3}.a.*")
    removeField "647" if (exists "647.{*,4}.a.*")
    removeField "647" if (exists "647.{*,5}.a.*")
    removeField "647" if (exists "647.{*,6}.a.*")
    removeField "647" if (exists "647.{*,8}.a.*")
    removeField "647" if (exists "647.{*,9}.a.*")
    removeField "647" if (exists "647.{*, }.a.*")
  
    removeField "648" if (exists "648.{*,1}.a.*")
    removeField "648" if (exists "648.{*,2}.a.*")
    removeField "648" if (exists "648.{*,3}.a.*")
    removeField "648" if (exists "648.{*,4}.a.*")
    removeField "648" if (exists "648.{*,5}.a.*")
    removeField "648" if (exists "648.{*,6}.a.*")
    removeField "648" if (exists "648.{*,8}.a.*")
    removeField "648" if (exists "648.{*,9}.a.*")
    removeField "648" if (exists "648.{*, }.a.*")

    removeField "650" if (exists "650.{*,1}.a.*")
    removeField "650" if (exists "650.{*,2}.a.*")
    removeField "650" if (exists "650.{*,3}.a.*")
    removeField "650" if (exists "650.{*,4}.a.*")
    removeField "650" if (exists "650.{*,5}.a.*")
    removeField "650" if (exists "650.{*,6}.a.*")
    removeField "650" if (exists "650.{*,8}.a.*")
    removeField "650" if (exists "650.{*,9}.a.*")
    removeField "650" if (exists "650.{*, }.a.*")
  
    removeField "651" if (exists "651.{*,1}.a.*")
    removeField "651" if (exists "651.{*,2}.a.*")
    removeField "651" if (exists "651.{*,3}.a.*")
    removeField "651" if (exists "651.{*,4}.a.*")
    removeField "651" if (exists "651.{*,5}.a.*")
    removeField "651" if (exists "651.{*,6}.a.*")
    removeField "651" if (exists "651.{*,8}.a.*")
    removeField "651" if (exists "651.{*,9}.a.*")
    removeField "651" if (exists "651.{*, }.a.*")
 
    removeField "653" if (exists "653.{*,1}.a.*")
    removeField "653" if (exists "653.{*,2}.a.*")
    removeField "653" if (exists "653.{*,3}.a.*")
    removeField "653" if (exists "653.{*,4}.a.*")
    removeField "653" if (exists "653.{*,5}.a.*")
    removeField "653" if (exists "653.{*,6}.a.*")
    removeField "653" if (exists "653.{*,8}.a.*")
    removeField "653" if (exists "653.{*,9}.a.*")
    removeField "653" if (exists "653.{*, }.a.*")
  
    removeField "654" if (exists "654.{*,1}.a.*")
    removeField "654" if (exists "654.{*,2}.a.*")
    removeField "654" if (exists "654.{*,3}.a.*")
    removeField "654" if (exists "654.{*,4}.a.*")
    removeField "654" if (exists "654.{*,5}.a.*")
    removeField "654" if (exists "654.{*,6}.a.*")
    removeField "654" if (exists "654.{*,8}.a.*")
    removeField "654" if (exists "654.{*,9}.a.*")
    removeField "654" if (exists "654.{*, }.a.*")
  
    removeField "655" if (exists "655.{*,1}.a.*")
    removeField "655" if (exists "655.{*,2}.a.*")
    removeField "655" if (exists "655.{*,3}.a.*")
    removeField "655" if (exists "655.{*,4}.a.*")
    removeField "655" if (exists "655.{*,5}.a.*")
    removeField "655" if (exists "655.{*,6}.a.*")
    removeField "655" if (exists "655.{*,8}.a.*")
    removeField "655" if (exists "655.{*,9}.a.*")
    removeField "655" if (exists "655.{*, }.a.*")
  
    removeField "656" if (exists "656.{*,1}.a.*")
    removeField "656" if (exists "656.{*,2}.a.*")
    removeField "656" if (exists "656.{*,3}.a.*")
    removeField "656" if (exists "656.{*,4}.a.*")
    removeField "656" if (exists "656.{*,5}.a.*")
    removeField "656" if (exists "656.{*,6}.a.*")
    removeField "656" if (exists "656.{*,8}.a.*")
    removeField "656" if (exists "656.{*,9}.a.*")
    removeField "656" if (exists "656.{*, }.a.*")
  
    removeField "657" if (exists "657.{*,1}.a.*")
    removeField "657" if (exists "657.{*,2}.a.*")
    removeField "657" if (exists "657.{*,3}.a.*")
    removeField "657" if (exists "657.{*,4}.a.*")
    removeField "657" if (exists "657.{*,5}.a.*")
    removeField "657" if (exists "657.{*,6}.a.*")
    removeField "657" if (exists "657.{*,8}.a.*")
    removeField "657" if (exists "657.{*,9}.a.*")
    removeField "657" if (exists "657.{*, }.a.*")
  
    removeField "658" if (exists "658.{*,1}.a.*")
    removeField "658" if (exists "658.{*,2}.a.*")
    removeField "658" if (exists "658.{*,3}.a.*")
    removeField "658" if (exists "658.{*,4}.a.*")
    removeField "658" if (exists "658.{*,5}.a.*")
    removeField "658" if (exists "658.{*,6}.a.*")
    removeField "658" if (exists "658.{*,8}.a.*")
    removeField "658" if (exists "658.{*,9}.a.*")
    removeField "658" if (exists "658.{*, }.a.*")
  
    removeField "662" if (exists "662.{*,1}.a.*")
    removeField "662" if (exists "662.{*,2}.a.*")
    removeField "662" if (exists "662.{*,3}.a.*")
    removeField "662" if (exists "662.{*,4}.a.*")
    removeField "662" if (exists "662.{*,5}.a.*")
    removeField "662" if (exists "662.{*,6}.a.*")
    removeField "662" if (exists "662.{*,8}.a.*")
    removeField "662" if (exists "662.{*,9}.a.*")
    removeField "662" if (exists "662.{*, }.a.*")

    end

Remove fields 863 to 868 if they do not have subfield 9

rule "delete 863 4 5 6 7 8 if it does not have subfield 8 9"
when
(TRUE)
then
removeField "863" if (not exists "866.8.9")
removeField "864" if (not exists "867.8.9")
removeField "865" if (not exists "868.8.9")
removeField "866" if (not exists "866.8.9")
removeField "867" if (not exists "867.8.9")
removeField "868" if (not exists "868.8.9")
end

Remove field 035 if it begins with (OCoLC)

rule "remove 035 field if it begins with (OCoLC)"
when
(TRUE)
then
removeField "035" if (exists "035.a.(OCoLC)*")
end

Change 008 pos 35-37 from “HUN” to “hun”

rule "Change 008 pos 35-37 to hun if it is HUN"
when
(existsControl "008.{35,3}.HUN")
then
replaceControlContents "008.{35,3}" with "hun"
end

 

Add field 900 depending on contents of control field 008

rule "Add field 900 with subfield a Govt. Doc if 008 has a u in pos 17 and an f in pos 21"
when
existsControl "008.{17,1}.u" AND existsControl "008.{28,1}.f"
then
addField "900.a.Govt. Doc" if (not exists "900.a.Govt. Doc")
end

Create link to Primo by contents of MMSID

rule "Put Primo link temporary fields in YLK"
priority 10
when
not exists "856.z.Link to Primo"
then
addField "YLK.{9,0}.a.https://exldeveu00.primo.exlibrisgroup.com/discovery/search?query=any,contains,"
addField "YLK.{9,1}.a.&tab=LibraryCatalog&search_scope=MyInstitution&vid=EXLDEV1_INST:Alma&lang=en&offset=0"
end


rule "Add system number to 859.u from 001 prefixed by nothing"
priority 9
when
not exists "856.z.Link to Primo"
then
addSystemNumber "859.u" from "001" prefixed by "nothing"
end


rule "prefix and suffix the 859u which now has the MMSID"
priority 8
when
not exists "856.z.Link to Primo"
then
prefixSubField "859.u" with "YLK.{9,0}.a"  if (not exists "859.u.*.*")
suffixSubField  "859.u" with "YLK.{9,1}.a" if (exists "859.u.*primo.exlibrisgroup.com*")
end



rule "Add subfield z to the 859"
priority 7
when
  not exists "856.z.Link to Primo"
then
   addSubField "859.z.Link to Primo" if (exists "859.u.https://exldeveu00.primo.exlibrisgroup.com*")
end

rule "Fix indicators"
priority 7
when
  TRUE
then
changeFirstIndicator "859" to "4" if (exists "859.z.Link to Primo")
changeSecondIndicator "859" to "0" if (exists "859.z.Link to Primo")
end 

rule "Copy the 859 to 856"
priority 6
when
TRUE
then
copyField "859" to "856"
end

rule "Remove the YLK and 859 temporary fields"
priority 5
when
TRUE
then
removeField "859"
removeField "YLK" if (exists "YLK.{9,0}.a.https://exldeveu00.primo.exlibrisgroup.com*")
removeField "YLK" if (exists "YLK.{9,1}.a.*&tab=LibraryCatalog*")
end

Replace a backslash with nothing

rule "replace a backslash with nothing (blank)"
when
(TRUE)
then
replaceContents "245.a." with ""
end

Add a field using the pipe OR condition

rule "Add field 901 if 900 exists with Architecture or Design in subfield a"
when
# ((exists "900.a.Design") OR (exists "900.a.Architecture"))
((exists "900.a.Design|Architecture") AND (not exists "901.a.248365-613"))
then
addField "901.{-,-}.a.248365-613"
end

Change Sex change with and without a period at the end to Gender transition in 650 only when 2nd indicator is 0

rule "change 650 Sex change with and without a period at the end to Gender transition"
// updates 650 from "Sex change" to "Gender transition"
when 
TRUE
then 
replaceContents "650.a.Sex change" with "Gender transition" if(exists "650.{*,0}.a.Sex change")
replaceContents "650.a.Sex change" with "Gender transition" if(exists "650.{*,0}.a.Sex change\.")
end

 

Change Swaziland to Eswatini in 610 650 and 651 only when 2nd indicator is 0

rule "Swaziland LCSH update"
when
(TRUE)
then
replaceContents "610.z.Swaziland" with "Eswatini" if(exists "610.{*,0}.z.Swaziland")
replaceContents "650.z.Swaziland" with "Eswatini" if(exists "650.{*,0}.z.Swaziland")
replaceContents "651.a.Swaziland" with "Eswatini" if(exists "651.{*,0}.a.Swaziland")
replaceContents "651.z.Swaziland" with "Eswatini" if(exists "651.{*,0}.z.Swaziland")
end

Add 520 subfield a “The Thomas J. Safransky Collection” if not already exist

rule "Add field 520"
when
not exists "520.{-,-}.a.The Thomas J. Safransky Collection"
then
addField "520.{-,-}.a.The Thomas J. Safransky Collection"
end

Add field 650 2nd indicator 0 and subfield a “Feminist theory” if  not already exist

rule "Add field 650 Feminist theory"
when
not exists "650.{*,*}.a.Feminist theory*"
then
addField "650.{-,0}.a.Feminist theory"
end

Add field 650 2nd indicator 7 subfield a “Feministin” and subfield 2 “GND” if  not already exist

rule "add 650_7 $$a Feministin $$2 GND"
when
(not exists "650.{-,7}.a.Feministin")
then
addField "650.{-,7}.a.Feministin"
addSubField "650.2.GND" if (exists "650.{-,7}.a.Feministin")
end

Add 880 subfield e with text “author” only if the 880 is linked to the 100

rule "Add subfield 880 e author only if the 880 is linked to a 100"
when
not exists "880.{1,-}.e.author"
then
addSubField "880.e.author" if ( exists "880.6.100*" )
end

Add RDA fields 336 337 and 338

rule "RDA Fields - 336"
salience 30
when
(not exists "336")
then
addField "336.a.text" //Change as appropriate
addSubField "336.b.txt"//Change as appropriate
addSubField "336.2.rdacontent" //Change as appropriate
end

rule "RDA Fields - 337"
salience 20
when
(not exists "337")
then
addField "337.a.unmediated" //Change as appropriate
addSubField "337.b.n"//Change as appropriate
addSubField "337.2.rdamedia" //Change as appropriate
end

rule "RDA Fields - 338"
salience 10
when
(not exists "338")
then
addField "338.a.volume" //Change as appropriate
addSubField "338.b.nc"//Change as appropriate
addSubField "338.2.rdacarrier" //Change as appropriate
end

Add a new field based on the existence of multiple subfields in another field

rule "If 650 has subfield a with Thomas and subfield b with Safransky then create 700 subfield a Safransky, Thomas"
when
((exists "650.a.Thomas") AND (exists "650.b.Safransky") AND (not exists "700.{1,-}.a.Safransky, Thomas"))
then
addField "700.{1,-}.a.Safransky, Thomas"
end

Move the text in parentheses of 020 subfield a to be in subfield q

rule "EXL - change (pbk) in 020 a to be in subfield q"
when
(TRUE)
then
addSubField "020.q.(pbk)" if (exists "020.a.*(pbk)")
replaceContents "020.a.(pbk)" with "" 
end

rule "EXL - change (paperback) in 020 a to be in subfield q"
when
(TRUE)
then
addSubField "020.q.(paperback)" if (exists "020.a.*(paperback)")
replaceContents "020.a.(paperback)" with "" 
end

rule "EXL - change (hbk) in 020 a to be in subfield q"
when
(TRUE)
then
addSubField "020.q.(hbk)" if (exists "020.a.*(hbk)")
replaceContents "020.a.(hbk)" with "" 
end

rule "EXL - change (hardback) in 020 a to be in subfield q"
when
(TRUE)
then
addSubField "020.q.(hardback)" if (exists "020.a.*(hardback)")
replaceContents "020.a.(hardback)" with ""
end

rule "EXL - change (electronic) in 020 a to be in subfield q"
when
(TRUE)
then
addSubField "020.q.(electronic)" if (exists "020.a.*(electronic)")
replaceContents "020.a.(electronic)" with ""
end

rule "EXL - change (electronic bk) in 020 a to be in subfield q"
when
(TRUE)
then
addSubField "020.q.(electronic bk)" if (exists "020.a.*(electronic bk)")
replaceContents "020.a.(electronic bk)" with ""
end

Change 008 position 23 to be o unconditionally

rule "Change 008 pos 23 to o"
when
(TRUE)
then
replaceControlContents "008.{23,1}" with "o"
end

Change LDR position 7 to be b unconditionally

rule "Change LDR pos 7 to b"
when
(TRUE)
then
replaceControlContents "LDR.{7,1}" with "b"
end

Change 440 to 490 and 830

rule "change 440 to 490 and 830"
# Background:
# - 440 was made obsolete in 2008 
# - all title series statements would be entered in the 490 field 
# - all title series added entries in the 830.
#
# Change 440 to 490 and 830 in accordance with LOC MARC standards
# Official standards at: http://www.loc.gov/marc/bibliographic/bd440.html
#
# Create the 490 field as follows:
# - Construct field 490 (Series Statement)
# - set 490 indicator 1 to 1
# - set 490 indicator 2 to blank
# - concatenate field 440 subfields $a, $n and $p and place the new string into 490 subfield $a
# (the above means to concatenate subfield n and p with a)
# - and copy the content of 440 subfields $v, $x, $6, and $8 into the same subfields in field 490. 
# - Any additional subfields in field 440 (not mentioned above) go to 830 (as described below)
#
# Create the 830 field as follows:
# - Construct field 830 (Series Added Entry - Uniform Title)
# - all 440 indicators and subfields convert to field 830 with same indicators and subfields.
# (this appears to mean "copy 440 to 80 as is")
priority 40
when
( exists "440.a" ) AND ( not exists "490.a" )
then
copyField "440" to "490"
changeFirstIndicator "490" to "1"
changeSecondIndicator "490" to " "
suffix "490.a" with " " if (exists "490.n")
suffixSubField "490.a" with "490.n" if (exists "490.n")
suffix "490.a" with " " if (exists "490.p")
suffixSubField "490.a" with "490.p" if (exists "490.p")
end

rule "remove from 490 all subfields except a v x 6 8"
priority 40
when 
( exists "490" )
then
removeSubField "490.w"
removeSubField "490.0"
end

rule "change 440 to 830"
priority 30
when
(( exists "440.a" ) AND ( not exists "830.a" ))
then
copyField "440" to "830"
end

rule "remove the 440"
priority 20
when
( exists "440.a" )
then
removeField "440"
end

rule "remove from 490 subfields n and p"
priority 10
# must remove also 490 n and p because we suffixed them above to a)
when
(TRUE)
then
removeSubField "490.n"
removeSubField "490.p"
end

Change a backslash to nothing in 245 subfield a

rule "replace a backslash with nothing (blank)"
    when
         (TRUE)
     then
            replaceContents "245.a." with ""
end

Add field 906 as a local field of a member institution in a consortia

rule "Add field 996 and make it be a local extension"
when
( not exists "996.a.YILIS" )
then
addField "996.a.YILIS"
addSubField "996.b.YLK" if ( exists "996.a.YILIS" )
addSubField "996.c.Dimona" if ( exists "996.a.YILIS" )
addSubField "996.9.local" if ( exists "996.a.YILIS" )
end

Prefix a subfield with text of another field/subfield and hardcoded text

rule "Combine 906 subfield a with 907 subfield c into new field 910 subfield a if it does not already exist and put two dashes between the text of each former subfield"
when
 ( not exists "910.a" )
then
addField "910.a. -- " 
prefixSubField "910.a" with "906.a" if (exists "910.a")
suffixSubField "910.a" with "907.c" if (exists "910.a")
end

Add a field with a period in the middle and with a period at the end

rule "Add field 906 with text Architecture and period at end and also add field 907 with F.L.T."
salience 100
when
  TRUE
then
        addField "906.a.Architecture."
        addField "907.a.F.L.T."
end

Replace all periods with nothing in 245 subfield a

rule "remove period in 245 subfield a (replace it with nothing) period is specified by preceding it with four backslashes"
    when
         (TRUE)
     then
         replaceContents "245.a.." with ""
end

Replace a period with nothing in 245 subfield a if it is followed by a space then a forward slash

This:

245 $$a A Brief relation of the plague at Naples, in the year M.DC.LVI. / $$c Translated out of Italian into English.

Will change to:

245 $$a A Brief relation of the plague at Naples, in the year M.DC.LVI / $$c Translated out of Italian into English.

(note the period before the forward slash which gets removed at end of subfield a)

rule "remove period in 245 subfield a (replace it with nothing) if it is followed by a space then a forward slash"
    when
         (TRUE)
     then
         replaceContents "245.a.. /" with ""
end

Add a field with a pipe as a character as in P|pes

rule "Add 490 1st indicator 1 P|pes"
when
TRUE
then
        addField "490.{1,-}.a.P|pes in code"
end

Change 650_4 a Ferðamálafræði to 650_7 a Ferðamálafræði 2 ICEAUT

rule "remove field 650_4 with Ferðamálafræði"
  when
    (true)
  then
    removeField "650" if (exists "650.{-,4}.a.Ferðamálafræði")
end

rule "add field 650 with Ferðamálafræði"
  when
    (not exists "650.{-,7}.a.Ferðamálafræði")
  then
    addField "650.{-,7}.a.Ferðamálafræði"
    addSubField "650.2.ICEAUT"  if (exists "650.{-,7}.a.Ferðamálafræði")
end

Change field 955 to 655

rule "Move field 955 to 655"
when
(TRUE)
then
changeField "955" to "655"
end

Copy field 001 to 035 subfield a

rule "copy 001 Field to 035 Field"
when
(TRUE)
then
copyField "001" to "035.a"
end

Copy contents of 245 subfield c to 900 subfield a

rule "copy 245 subfield c to 900 subfield a"
when
TRUE
then
copyField "245.c" to "900.a"
end

Copy contents of 300 field to 901 with 1st indicator 1 and 2nd indicator 2

rule "copy 300 to 90112"
when
  TRUE
then
  copyField "300" to "901.{1,2}"
end

Copy contents of 245 ist indicator 1 2nd indicator 4 to 902 1st indicator 1 and 2nd indicator 4

rule "copy 24514 to 90214"
when
  TRUE
then
  copyField "245" to "902.{1,4}" if(exists "245.{1,4}")
end

Add field 901 subfield a “Architecture” conditionally

rule " Add field 901 with sub field a with text Architecture Dept. only if it is not already there and if 902 subfield b has 034-ARC" 
when ((exists "902.b.034-ARC") AND (not exists "901.a.Architecture Dept")) 
then 
addField "901.a.Architecture Dept" 
end

Change 035 subfield b to 035 subfield a

rule "Copy 035 subfield b to 035 subfield a"
when
(TRUE)
then
changeSubField "035.b" to "a"
end

Change 856 2nd indicator 1 to 0

rule "Change second indicator of field 856 to 0 if the value is 1"
when
(TRUE)
then
changeSecondIndicator "856" to "0" if (exists "856.{*,1}")
end

Change the first occurrence of 040 subfield d to a and do not change other ones

rule "change the first occurrence of 040 subfield d to a and do not change other ones"
when
(TRUE)
then
changeSubFieldOnlyFirst "040.d" to "a"
end

Change all occurrences of 040 subfield d to a except the first one

rule "change all occurrences of 040 subfield d to a except the first one"
when
(TRUE)
then
changeSubFieldExceptFirst "040.d" to "a"
end

Replace “Baker and Taylor” with “B and T” in 938 subfield a but only the first occurence

rule "Replace the first occurrence of Baker and Taylor in subfield a with B and T  Do not change other occurrences of other subfield a with Baker and Taylor”

    when
         (TRUE)
     then
            replaceContentsOnlyFirst "938.a.Baker and Taylor" with "B and T"
end

Replace “Baker and Taylor” with “B and T” in 938 subfield a for all occurences except the first one

rule "Replace all occurrences of Baker and Taylor in subfield a with B and T  except for the first occurrence”

    when
         (TRUE)
     then
            replaceContentsExceptFirst "938.a.Baker and Taylor" with "B and T"
end

Copy the MMSID in 001 and prefix it by what is in 003 in parentheses

rule "Add system number 035.a from 001 prefixed by 003"
when
(TRUE)
then
addSystemNumber "035.a" from "001" prefixed by "003"
end

Change control field 001 to 009

rule "Move field 001 to 009"
when
(not existsControl "009")
then
changeControlField "001" to "009"
end

Fix 245 2nd indicator based on language of record and beginning text of 245

rule "Fix 2nd indicator for English"
when
(existsControl "008.{35,3}.eng")
then
changeSecondIndicator "245" to "4" if (exists "245.{*,*}.a.The *")
changeSecondIndicator "245" to "3" if (exists "245.{*,*}.a.An *")
changeSecondIndicator "245" to "2" if (exists "245.{*,*}.a.A *")
end

rule "Fix 2nd indicator for French"
when
(existsControl "008.{35,3}.fre")
then
changeSecondIndicator "245" to "3" if (exists "245.{*,*}.a.La *")
changeSecondIndicator "245" to "3" if (exists "245.{*,*}.a.Le *")
changeSecondIndicator "245" to "4" if (exists "245.{*,*}.a.Les *")
changeSecondIndicator "245" to "3" if (exists "245.{*,*}.a.Un *")
changeSecondIndicator "245" to "4" if (exists "245.{*,*}.a.Une *")
changeSecondIndicator "245" to "2" if (exists "245.{*,*}.a.L'*")
changeSecondIndicator "245" to "4" if (exists "245.{*,*}.a.Des *")
end

rule "Fix 2nd indicator for Spanish"
when
(existsControl "008.{35,3}.spa")
then
changeSecondIndicator "245" to "3" if (exists "245.{*,*}.a.El *")
changeSecondIndicator "245" to "3" if (exists "245.{*,*}.a.Lo *")
changeSecondIndicator "245" to "3" if (exists "245.{*,*}.a.La *")
changeSecondIndicator "245" to "4" if (exists "245.{*,*}.a.Las *")
changeSecondIndicator "245" to "4" if (exists "245.{*,*}.a.Los *")
changeSecondIndicator "245" to "4" if (exists "245.{*,*}.a.Uno *")
changeSecondIndicator "245" to "4" if (exists "245.{*,*}.a.Una *")
changeSecondIndicator "245" to "3" if (exists "245.{*,*}.a.Un *")
changeSecondIndicator "245" to "5" if (exists "245.{*,*}.a.Unos *")
changeSecondIndicator "245" to "5" if (exists "245.{*,*}.a.Unas *")
end

rule "Fix 2nd indicator for German"
when
(existsControl "008.{35,3}.ger")
then
changeSecondIndicator "245" to "4" if (exists "245.{*,*}.a.Das *")
changeSecondIndicator "245" to "4" if (exists "245.{*,*}.a.Der *")
changeSecondIndicator "245" to "4" if (exists "245.{*,*}.a.Din *")
changeSecondIndicator "245" to "5" if (exists "245.{*,*}.a.Dine *")
changeSecondIndicator "245" to "4" if (exists "245.{*,*}.a.Die *")
end

rule "Fix 2nd indicator for Italian"
when
(existsControl "008.{35,3}.ita")
then
changeSecondIndicator "245" to "4" if (exists "245.{*,*}.a.Gli *")
changeSecondIndicator "245" to "4" if (exists "245.{*,*}.a.Gl' *")
changeSecondIndicator "245" to "2" if (exists "245.{*,*}.a.I *")
changeSecondIndicator "245" to "3" if (exists "245.{*,*}.a.Il *")
changeSecondIndicator "245" to "3" if (exists "245.{*,*}.a.La *")
changeSecondIndicator "245" to "3" if (exists "245.{*,*}.a.Le *")
changeSecondIndicator "245" to "3" if (exists "245.{*,*}.a.Lo *")
changeSecondIndicator "245" to "3" if (exists "245.{*,*}.a.L' *")
end

rule "Fix 2nd indicator for Dutch"
when
(existsControl "008.{35,3}.dut")
then
changeSecondIndicator "245" to "4" if (exists "245.{*,*}.a.Een *")
changeSecondIndicator "245" to "4" if (exists "245.{*,*}.a.Het *")
changeSecondIndicator "245" to "3" if (exists "245.{*,*}.a.De *")
changeSecondIndicator "245" to "4" if (exists "245.{*,*}.a.Des *")
changeSecondIndicator "245" to "4" if (exists "245.{*,*}.a.Der *")
changeSecondIndicator "245" to "3" if (exists "245.{*,*}.a.'s *")
changeSecondIndicator "245" to "3" if (exists "245.{*,*}.a.'t *")
changeSecondIndicator "245" to "5" if (exists "245.{*,*}.a.Eene *")
changeSecondIndicator "245" to "3" if (exists "245.{*,*}.a.'n *")
changeSecondIndicator "245" to "4" if (exists "245.{*,*}.a.Ene *")
end

rule "Fix 2nd indicator for Portuguese"
when
(existsControl "008.{35,3}.por")
then
changeSecondIndicator "245" to "2" if (exists "245.{*,*}.a.O *")
changeSecondIndicator "245" to "2" if (exists "245.{*,*}.a.A *")
changeSecondIndicator "245" to "3" if (exists "245.{*,*}.a.Os *")
changeSecondIndicator "245" to "3" if (exists "245.{*,*}.a.As *")
changeSecondIndicator "245" to "3" if (exists "245.{*,*}.a.Um *")
changeSecondIndicator "245" to "4" if (exists "245.{*,*}.a.Uma *")
end

Fix 130 1st indicator based on language of record and beginning text of 130

rule "Fix 1st indicator for English" 
when 
(existsControl "008.{35,3}.eng") 
then 
changeFirstIndicator "130" to "4" if (exists "130.{*,*}.a.The *") 
changeFirstIndicator "130" to "3" if (exists "130.{*,*}.a.An *") 
changeFirstIndicator "130" to "2" if (exists "130.{*,*}.a.A *") 
end 

rule "Fix 1st indicator for French" 
when 
(existsControl "008.{35,3}.fre") 
then 
changeFirstIndicator "130" to "3" if (exists "130.{*,*}.a.La *") 
changeFirstIndicator "130" to "3" if (exists "130.{*,*}.a.Le *") 
changeFirstIndicator "130" to "4" if (exists "130.{*,*}.a.Les *") 
changeFirstIndicator "130" to "3" if (exists "130.{*,*}.a.Un *") 
changeFirstIndicator "130" to "4" if (exists "130.{*,*}.a.Une *") 
changeFirstIndicator "130" to "2" if (exists "130.{*,*}.a.L'*") 
changeFirstIndicator "130" to "4" if (exists "130.{*,*}.a.Des *") 
end 

rule "Fix 1st indicator for Spanish" 
when 
(existsControl "008.{35,3}.spa") 
then 
changeFirstIndicator "130" to "3" if (exists "130.{*,*}.a.El *") 
changeFirstIndicator "130" to "3" if (exists "130.{*,*}.a.Lo *") 
changeFirstIndicator "130" to "3" if (exists "130.{*,*}.a.La *") 
changeFirstIndicator "130" to "4" if (exists "130.{*,*}.a.Las *") 
changeFirstIndicator "130" to "4" if (exists "130.{*,*}.a.Los *") 
changeFirstIndicator "130" to "4" if (exists "130.{*,*}.a.Uno *") 
changeFirstIndicator "130" to "4" if (exists "130.{*,*}.a.Una *") 
changeFirstIndicator "130" to "3" if (exists "130.{*,*}.a.Un *") 
changeFirstIndicator "130" to "5" if (exists "130.{*,*}.a.Unos *") 
changeFirstIndicator "130" to "5" if (exists "130.{*,*}.a.Unas *") 
end 

rule "Fix 1st indicator for German" 
when 
(existsControl "008.{35,3}.ger") 
then 
changeFirstIndicator "130" to "4" if (exists "130.{*,*}.a.Das *") 
changeFirstIndicator "130" to "4" if (exists "130.{*,*}.a.Der *") 
changeFirstIndicator "130" to "4" if (exists "130.{*,*}.a.Din *") 
changeFirstIndicator "130" to "5" if (exists "130.{*,*}.a.Dine *") 
changeFirstIndicator "130" to "4" if (exists "130.{*,*}.a.Die *") 
end 

rule "Fix 1st indicator for Italian" 
when 
(existsControl "008.{35,3}.ita") 
then 
changeFirstIndicator "130" to "4" if (exists "130.{*,*}.a.Gli *") 
changeFirstIndicator "130" to "4" if (exists "130.{*,*}.a.Gl' *") 
changeFirstIndicator "130" to "2" if (exists "130.{*,*}.a.I *") 
changeFirstIndicator "130" to "3" if (exists "130.{*,*}.a.Il *") 
changeFirstIndicator "130" to "3" if (exists "130.{*,*}.a.La *") 
changeFirstIndicator "130" to "3" if (exists "130.{*,*}.a.Le *") 
changeFirstIndicator "130" to "3" if (exists "130.{*,*}.a.Lo *") 
changeFirstIndicator "130" to "3" if (exists "130.{*,*}.a.L' *") 
end 

rule "Fix 1st indicator for Dutch" 
when 
(existsControl "008.{35,3}.dut") 
then 
changeFirstIndicator "130" to "4" if (exists "130.{*,*}.a.Een *") 
changeFirstIndicator "130" to "4" if (exists "130.{*,*}.a.Het *") 
changeFirstIndicator "130" to "3" if (exists "130.{*,*}.a.De *") 
changeFirstIndicator "130" to "4" if (exists "130.{*,*}.a.Des *") 
changeFirstIndicator "130" to "4" if (exists "130.{*,*}.a.Der *") 
changeFirstIndicator "130" to "3" if (exists "130.{*,*}.a.'s *") 
changeFirstIndicator "130" to "3" if (exists "130.{*,*}.a.'t *") 
changeFirstIndicator "130" to "5" if (exists "130.{*,*}.a.Eene *") 
changeFirstIndicator "130" to "3" if (exists "130.{*,*}.a.'n *") 
changeFirstIndicator "130" to "4" if (exists "130.{*,*}.a.Ene *") 
end 

rule "Fix 1st indicator for Portuguese" 
when 
(existsControl "008.{35,3}.por") 
then 
changeFirstIndicator "130" to "2" if (exists "130.{*,*}.a.O *") 
changeFirstIndicator "130" to "2" if (exists "130.{*,*}.a.A *") 
changeFirstIndicator "130" to "3" if (exists "130.{*,*}.a.Os *") 
changeFirstIndicator "130" to "3" if (exists "130.{*,*}.a.As *") 
changeFirstIndicator "130" to "3" if (exists "130.{*,*}.a.Um *") 
changeFirstIndicator "130" to "4" if (exists "130.{*,*}.a.Uma *") 
end

Fix and populate 008 position 7-10 year from 260 and 264 subfield c

rule "populate 008 7-10 1970"
when
((exists "260.{*,*}.c.*1970*") OR (exists "264.{*,*}.c.*1970*"))
then
replaceControlContents "008.{7,4}" with "1970"
end

rule "populate 008 7-10 1971"
when
((exists "260.{*,*}.c.*1971*") OR (exists "264.{*,*}.c.*1971*"))
then
replaceControlContents "008.{7,4}" with "1971"
end

rule "populate 008 7-10 1972"
when
((exists "260.{*,*}.c.*1972*") OR (exists "264.{*,*}.c.*1972*"))
then
replaceControlContents "008.{7,4}" with "1972"
end

rule "populate 008 7-10 1973"
when
((exists "260.{*,*}.c.*1973*") OR (exists "264.{*,*}.c.*1973*"))
then
replaceControlContents "008.{7,4}" with "1973"
end

rule "populate 008 7-10 1974"
when
((exists "260.{*,*}.c.*1974*") OR (exists "264.{*,*}.c.*1974*"))
then
replaceControlContents "008.{7,4}" with "1974"
end

rule "populate 008 7-10 1975"
when
((exists "260.{*,*}.c.*1975*") OR (exists "264.{*,*}.c.*1975*"))
then
replaceControlContents "008.{7,4}" with "1975"
end

rule "populate 008 7-10 1976"
when
((exists "260.{*,*}.c.*1976*") OR (exists "264.{*,*}.c.*1976*"))
then
replaceControlContents "008.{7,4}" with "1976"
end

rule "populate 008 7-10 1977"
when
((exists "260.{*,*}.c.*1977*") OR (exists "264.{*,*}.c.*1977*"))
then
replaceControlContents "008.{7,4}" with "1977"
end

rule "populate 008 7-10 1978"
when
((exists "260.{*,*}.c.*1978*") OR (exists "264.{*,*}.c.*1978*"))
then
replaceControlContents "008.{7,4}" with "1978"
end

rule "populate 008 7-10 1979"
when
((exists "260.{*,*}.c.*1979*") OR (exists "264.{*,*}.c.*1979*"))
then
replaceControlContents "008.{7,4}" with "1979"
end

rule "populate 008 7-10 1980"
when
((exists "260.{*,*}.c.*1980*") OR (exists "264.{*,*}.c.*1980*"))
then
replaceControlContents "008.{7,4}" with "1980"
end

rule "populate 008 7-10 1981"
when
((exists "260.{*,*}.c.*1981*") OR (exists "264.{*,*}.c.*1981*"))
then
replaceControlContents "008.{7,4}" with "1981"
end

rule "populate 008 7-10 1982"
when
((exists "260.{*,*}.c.*1982*") OR (exists "264.{*,*}.c.*1982*"))
then
replaceControlContents "008.{7,4}" with "1982"
end

rule "populate 008 7-10 1983"
when
((exists "260.{*,*}.c.*1983*") OR (exists "264.{*,*}.c.*1983*"))
then
replaceControlContents "008.{7,4}" with "1983"
end

rule "populate 008 7-10 1984"
when
((exists "260.{*,*}.c.*1984*") OR (exists "264.{*,*}.c.*1984*"))
then
replaceControlContents "008.{7,4}" with "1984"
end

rule "populate 008 7-10 1985"
when
((exists "260.{*,*}.c.*1985*") OR (exists "264.{*,*}.c.*1985*"))
then
replaceControlContents "008.{7,4}" with "1985"
end

rule "populate 008 7-10 1986"
when
((exists "260.{*,*}.c.*1986*") OR (exists "264.{*,*}.c.*1986*"))
then
replaceControlContents "008.{7,4}" with "1986"
end

rule "populate 008 7-10 1987"
when
((exists "260.{*,*}.c.*1987*") OR (exists "264.{*,*}.c.*1987*"))
then
replaceControlContents "008.{7,4}" with "1987"
end

rule "populate 008 7-10 1988"
when
((exists "260.{*,*}.c.*1988*") OR (exists "264.{*,*}.c.*1988*"))
then
replaceControlContents "008.{7,4}" with "1988"
end

rule "populate 008 7-10 1989"
when
((exists "260.{*,*}.c.*1989*") OR (exists "264.{*,*}.c.*1989*"))
then
replaceControlContents "008.{7,4}" with "1989"
end

rule "populate 008 7-10 1990"
when
((exists "260.{*,*}.c.*1990*") OR (exists "264.{*,*}.c.*1990*"))
then
replaceControlContents "008.{7,4}" with "1990"
end

rule "populate 008 7-10 1991"
when
((exists "260.{*,*}.c.*1991*") OR (exists "264.{*,*}.c.*1991*"))
then
replaceControlContents "008.{7,4}" with "1991"
end

rule "populate 008 7-10 1992"
when
((exists "260.{*,*}.c.*1992*") OR (exists "264.{*,*}.c.*1992*"))
then
replaceControlContents "008.{7,4}" with "1992"
end

rule "populate 008 7-10 1993"
when
((exists "260.{*,*}.c.*1993*") OR (exists "264.{*,*}.c.*1993*"))
then
replaceControlContents "008.{7,4}" with "1993"
end

rule "populate 008 7-10 1994"
when
((exists "260.{*,*}.c.*1994*") OR (exists "264.{*,*}.c.*1994*"))
then
replaceControlContents "008.{7,4}" with "1994"
end

rule "populate 008 7-10 1995"
when
((exists "260.{*,*}.c.*1995*") OR (exists "264.{*,*}.c.*1995*"))
then
replaceControlContents "008.{7,4}" with "1995"
end

rule "populate 008 7-10 1996"
when
((exists "260.{*,*}.c.*1996*") OR (exists "264.{*,*}.c.*1996*"))
then
replaceControlContents "008.{7,4}" with "1996"
end

rule "populate 008 7-10 1997"
when
((exists "260.{*,*}.c.*1997*") OR (exists "264.{*,*}.c.*1997*"))
then
replaceControlContents "008.{7,4}" with "1997"
end

rule "populate 008 7-10 1998"
when
((exists "260.{*,*}.c.*1998*") OR (exists "264.{*,*}.c.*1998*"))
then
replaceControlContents "008.{7,4}" with "1998"
end

rule "populate 008 7-10 1999"
when
((exists "260.{*,*}.c.*1999*") OR (exists "264.{*,*}.c.*1999*"))
then
replaceControlContents "008.{7,4}" with "1999"
end

rule "populate 008 7-10 2000"
when
((exists "260.{*,*}.c.*2000*") OR (exists "264.{*,*}.c.*2000*"))
then
replaceControlContents "008.{7,4}" with "2000"
end

rule "populate 008 7-10 2001"
when
((exists "260.{*,*}.c.*2001*") OR (exists "264.{*,*}.c.*2001*"))
then
replaceControlContents "008.{7,4}" with "2001"
end

rule "populate 008 7-10 2002"
when
((exists "260.{*,*}.c.*2002*") OR (exists "264.{*,*}.c.*2002*"))
then
replaceControlContents "008.{7,4}" with "2002"
end

rule "populate 008 7-10 2003"
when
((exists "260.{*,*}.c.*2003*") OR (exists "264.{*,*}.c.*2003*"))
then
replaceControlContents "008.{7,4}" with "2003"
end

rule "populate 008 7-10 2004"
when
((exists "260.{*,*}.c.*2004*") OR (exists "264.{*,*}.c.*2004*"))
then
replaceControlContents "008.{7,4}" with "2004"
end

rule "populate 008 7-10 2005"
when
((exists "260.{*,*}.c.*2005*") OR (exists "264.{*,*}.c.*2005*"))
then
replaceControlContents "008.{7,4}" with "2005"
end

rule "populate 008 7-10 2006"
when
((exists "260.{*,*}.c.*2006*") OR (exists "264.{*,*}.c.*2006*"))
then
replaceControlContents "008.{7,4}" with "2006"
end

rule "populate 008 7-10 2007"
when
((exists "260.{*,*}.c.*2007*") OR (exists "264.{*,*}.c.*2007*"))
then
replaceControlContents "008.{7,4}" with "2007"
end

rule "populate 008 7-10 2008"
when
((exists "260.{*,*}.c.*2008*") OR (exists "264.{ , }.c.*2008*"))
then
replaceControlContents "008.{7,4}" with "2008"
end

rule "populate 008 7-10 2009"
when
((exists "260.{*,*}.c.*2009*") OR (exists "264.{*,*}.c.*2009*"))
then
replaceControlContents "008.{7,4}" with "2009"
end

rule "populate 008 7-10 2010"
when
((exists "260.{*,*}.c.*2010*") OR (exists "264.{*,*}.c.*2010*"))
then
replaceControlContents "008.{7,4}" with "2010"
end

rule "populate 008 7-10 2011"
when
((exists "260.{*,*}.c.*2011*") OR (exists "264.{*,*}.c.*2011*"))
then
replaceControlContents "008.{7,4}" with "2011"
end

rule "populate 008 7-10 2012"
when
((exists "260.{*,*}.c.*2012*") OR (exists "264.{*,*}.c.*2012*"))
then
replaceControlContents "008.{7,4}" with "2012"
end

rule "populate 008 7-10 2013"
when
((exists "260.{*,*}.c.*2013*") OR (exists "264.{*,*}.c.*2013*"))
then
replaceControlContents "008.{7,4}" with "2013"
end

rule "populate 008 7-10 2014"
when
((exists "260.{*,*}.c.*2014*") OR (exists "264.{*,*}.c.*2014*"))
then
replaceControlContents "008.{7,4}" with "2014"
end

rule "populate 008 7-10 2015"
when
((exists "260.{*,*}.c.*2015*") OR (exists "264.{*,*}.c.*2015*"))
then
replaceControlContents "008.{7,4}" with "2015"
end
rule "populate 008 7-10 2016"
when
((exists "260.{*,*}.c.*2016*") OR (exists "264.{*,*}.c.*2016*"))
then
replaceControlContents "008.{7,4}" with "2016"
end

rule "populate 008 7-10 2017"
when
((exists "260.{*,*}.c.*2017*") OR (exists "264.{*,*}.c.*2017*"))
then
replaceControlContents "008.{7,4}" with "2017"
end

rule "populate 008 7-10 2018"
when
((exists "260.{*,*}.c.*2018*") OR (exists "264.{*,*}.c.*2018*"))
then
replaceControlContents "008.{7,4}" with "2018"
end

rule "populate 008 7-10 2019"
when
((exists "260.{*,*}.c.*2019*") OR (exists "264.{*,*}.c.*2019*"))
then
replaceControlContents "008.{7,4}" with "2019"
end

Remove all 9XX fields then add 900 using priority

rule "Remove all 9XX"
# the higher priority occurs first.  2 before 1
# must first remove all 9XX fields and then afterwards add the 9XX
priority 2
when
(TRUE)
then
removeField "9*"
end

rule "Add data field 900 with subfield a = copied from National Catalog if it does not exist"
priority 1
when
TRUE
then
addField "900.a.Copied from National Catalog"
end

Add 853 and 863 using salience

rule "add Hol 853"
#the highest salience occurs first.  100 before 99.  Like priority
salience 100
when
  (TRUE)
then
  addField "853.{2,0}.8.1"
  addSubField "853.a.v."
  addSubField "853.b.no."
  addSubField "853.u.9"
  addSubField "853.v.r"
  addSubField "853.i.(year)"
  addSubField "853.j.(month)"
  addSubField "853.w.m"
  addSubField "853.x.01"
#  addSubField "853.y.om06,07,08"
end

rule "add first Hol 863"
salience 90
when
  (TRUE)
then
  addField "863.{3,2}.8.1.1"
  addSubField "863.a.1-4"
  addSubField "863.i.1941-1943"
  addSubField "863.w.g"
end

rule "add second Hol 863"
salience 80
when
(TRUE)
then
addField "863.{3,2}.8.1.2"
addSubField "863.a.6-86" if ( exists "863.{3,2}.8.1.2" )
addSubField "863.i.1945-1987" if ( exists "863.{3,2}.8.1.2" )
end

Replace semicolon space with space – – space

rule "Replace semicolon space with space -- space"
when
(TRUE)
then
replaceContents "505.a."; "" with " -- "
end

Append text “(January 19, 1971)” to the end of the 590

rule "Suffix 590.a with (January 19, 1971) if not already there" 
when 
(TRUE) 
then suffix "590.a" with " (January 19, 1971)" if (not exists "590.a.*(January 19, 1971)") 
end

Move all contents in angled brackets of subfield h to subfield k

This will change

8520_ $$b ULINC $$c GEN $$h <Ref> GT3405 $$i .A23 2019

to

8520_ $$b ULINC $$c GEN $$k Ref $$h GT3405 $$i .A23 2019

 

rule "01 Move all contents in angled brackets of subfield h to subfield k"
    when
         (exists "852.h.<Vid>*")
     then
            replaceContents "852.h.<Vid>" with ""
            addSubField "852.k.Vid"
end

rule "02 Move all contents in angled brackets of subfield h to subfield k"
    when
         (exists "852.h.<Ref>*")
     then
            replaceContents "852.h.<Ref>" with ""
            addSubField "852.k.Ref"
end

rule "03 Move all contents in angled brackets of subfield h to subfield k"
    when
         (exists "852.h.<Oversize>*")
     then
            replaceContents "852.h.<Oversize>" with ""
            addSubField "852.k.Oversize"
end

Normalization rule for autopopulating 008 fields

Contribution from Hanoch Roniger of The Hebrew University of Jerusalem

See: Normalization rule for autopopulating 008 fields from Hanoch Roniger of The Hebrew University of Jerusalem

Normalization rule for combining 949 fields based on subfield 8 from Hanoch Roniger of The Hebrew University of Jerusalem

Contribution from Hanoch Roniger of The Hebrew University of Jerusalem

See: Normalization rule for combining 949 fields based on subfield 8 from Hanoch Roniger of The Hebrew University of Jerusalem

Remove Redundant spaces from 245 subfield a

rule "Replace 8 spaces with one space"
salience 100
when
(TRUE)
then
ReplaceContents "245.a.        " with " "
end
rule "Replace 7 spaces with one space"
salience 90
when
(TRUE)
then
ReplaceContents "245.a.       " with " "
end
rule "Replace 6 spaces with one space"
salience 80
when
(TRUE)
then
ReplaceContents "245.a.      " with " "
end
rule "Replace 5 spaces with one space"
salience 70
when
(TRUE)
then
ReplaceContents "245.a.     " with " "
end
rule "Replace 4 spaces with one space"
salience 60
when
(TRUE)
then
ReplaceContents "245.a.    " with " "
end
rule "Replace 3 spaces with one space"
salience 50
when
(TRUE)
then
ReplaceContents "245.a.   " with " "
end
rule "Replace 2 spaces with one space"
salience 40
when
(TRUE)
then
ReplaceContents "245.a.  " with " "
end

Remove all fields except for LDR 001 020 022 and 035. 

rule "remove all fields except LDR 001 020 022 and 035"
# This rule first copies the fields to temporary field alphabetic fields  then deletes all other fields except 001 then puts the alphabetic fields to what they were
when
(TRUE)
then
copyField "020" to "ABC"
copyField "022" to "DEF"
copyField "035" to "GHI"
removeControlField "002"
removeControlField "003"
removeControlField "004"
removeControlField "005"
removeControlField "006"
removeControlField "007"
removeControlField "008"
removeControlField "009"
removeField "0*"
removeField "1*"
removeField "2*"
removeField "3*"
removeField "4*"
removeField "5*"
removeField "6*"
removeField "7*"
removeField "8*"
removeField "9*"
copyField "ABC" to "020"
copyField "DEF" to "022"
copyField "GHI" to "035"
removeField "ABC"
removeField "DEF"
removeField "GHI"
end

Add a 999 field with subfield a “Govt. Publication” or “Not a Govt. Publication” based on the contents of 008 position 21.

rule "Check 008 position 28 and if it is a Govt. Publication then add field 999 with text Govt. Publication in subfield a"
when
(existsControl "008.{28,1}.a") OR (existsControl "008.{28,1}.c") OR (existsControl "008.{28,1}.f") OR (existsControl "008.{28,1}.i") OR (existsControl "008.{28,1}.l") OR (existsControl "008.{28,1}.m") OR (existsControl "008.{28,1}.o") OR (existsControl "008.{28,1}.s") OR (existsControl "008.{28,1}.z") 
then
addField "999.a.Govt. Publication"
end

rule "Check 008 position 28 and if it is a Govt. Publication then add field 999 with text Not a Govt. Publication in subfield a"
when
(not existsControl "008.{28,1}.a") AND (not existsControl "008.{28,1}.c") AND (not existsControl "008.{28,1}.f") AND (not existsControl "008.{28,1}.i") AND (not existsControl "008.{28,1}.l") AND (not existsControl "008.{28,1}.m") AND (not existsControl "008.{28,1}.o") AND  (not existsControl "008.{28,1}.s") AND (not existsControl "008.{28,1}.z") 
then
addField "999.a.Not a Govt. Publication"
end

Combine 852 subfields h and i and put space between them

This rule will change for example this:

852 $$b SPMS $$c FG $$h 210.19 $$i Y957p

to this

852 $$b SPMS $$c FG $$h 210.19 Y957p

It uses a temporary text as a placeholder for the space, then changes the temorary text to a spoace, then removes the temporary text.

rule "add temporary field and subfield to later be a space"
priority 10
when
(true)
then
# assumes field 999 is not already in use if it is in use different field
addField "999.z.temporary_placeholder_to_later_be_space"
end

rule "copy 852.i to 852.h and remove 852.i"
priority 9
when
(exists "852.i")
then
prefixSubField "852.i" with "999.z"
suffixSubField "852.h" with "852.i"
removeSubField "852.i"
end

rule "change temporary text to space"
priority 8
when
(true)
then
ReplaceContents "852.h.temporary_placeholder_to_later_be_space" with " "
end

rule "remove the temporary field"
priority 7
when
(true)
then
removeField "999"
end

Replace the 852 subfield c with ENT if it is currently with value UNASSIGNED and there is a 852 subfield h

Input: $$b ULINC $$c UNASSIGNED $$h HD6054.3 $$i .S265 2013

Output: $$b ULINC $$c ENT $$h HD6054.3 $$i .S265 2013

rule "Make the 852 subfield c be ENT if it is now UNASSIGNED and there is an 852 subfield h"
when
     (TRUE)
 then
        replaceContents "852.c.UNASSIGNED" with "ENT" if (exists "852.{*,*}.h.*")
 end

Add a 590 field with subfield a “Sent to Hathi Trust” and subfield b “Sent from Alma University”.

rule "Add field 590"
salience 10
when
not exists "590.{-,-}.a.Sent to Hathi Trust"
then
        addField "590.{-,-}.a.Sent to Hathi Trust"
        addSubField "590.b.Sent from Alma University"  if ( exists "590.{-,-}.a.Sent to Hathi Trust" )
end

35 Replies to “Alma Normalization Rule Examples”

  1. Is there an equivalent article with examples for modifying Dublin Core records in Alma D? We would like to add dcterms:accessRights field to several hundred records so that we can display the Open Access indicator in Primo.

  2. Hi, Yoel. I need to know if it’s possible in NR syntax to express a condition at action level to decide if a subfield is empty.
    Thanks and kind regards,
    Hugo

  3. Hi Hugo. Are you asking “Can I make a condition that a subfield does not exist?” You say “empty” but that would mean it does not exist.
    Here is an example of 650 z not existing
    ….
    then suffix “650.a” with “Zimbabwe” if (not exists “650.z.*”)

  4. Hi Yoel, thanks for answering so fast. I mean tags that exist but are empty. In my case these are 245 (and others) labels that are duplicated and one of them is empty:

    LDR #####nas#a22#####7u#4500
    008 ######s2013####xx######o#####000#0#eng#d
    020 __ |a
    035 __ |a (OCoLC)
    040 __ |a
    041 0_ |a
    050 00 |a
    100 1_ |a |b |c |d
    100 __ |a Project Management Institute
    240 10 |a
    245 10 |a |b |c |h
    245 __ |a Project Manager Competency Development Framework – Third Edition
    246 11 |a |b
    250 __ |a |b
    260 __ |a |b |c
    260 __ |b Project Management Institute |c 04/07/2017
    300 __ |a
    490 0_ |a |v
    500 __ |a
    502 __ |a
    505 0_ |a
    650 _0 |a
    650 _0 |a
    651 _0 |a |x
    700 1_ |a |b |c |d
    710 1_ |a |b
    710 2_ |a |b
    711 2_ |a |n |c |d

    I need to delete this empty tags.
    Hugo

  5. Hello Hugo I suggest you use the syntax I provided with the “if not exists:
    ….
    then suffix “650.a” with “Zimbabwe” if (not exists “650.z.*”)

  6. Hi Daniela. You state “I would like help with a rule to add an endpoint (\\\\.) In the 1XX fields”.

    I am not quite sure exactly what you want. Is it to add a period at the end of the 1XX field?

    If so there is a rule above called “Add a field with a period in the middle and with a period at the end”.
    Does this achieve your desired goal?

  7. Hi Yoel,

    How can I correct invalid language codes: both fields 008 and 041 have capital letters as codes? For example: HEB or ENG.

    Thank you in advance,
    Anat

  8. Anat:
    Thank you for your message.
    You ask:
    “How can I correct invalid language codes: both fields 008 and 041 have capital letters as codes? For example: HEB or ENG.?”
    I respond:
    See “How to use normalization rules to change the text of invalid language codes in fields 008 and 041” at https://knowledge.exlibrisgroup.com/@api/deki/files/86260/How_to_use_normalization_rules_to_change_the_text_of_invalid_language_codes_in_fields_008_and_041.pptx

  9. Hello Yoel,

    Does the correctDuplicateFields action need to be in a separate rule?

    I was just testing a correction for our 650 fields and this (folowing your example):

    rule “Ajusta 650 para Autoridades”
    priority 2
    when
    TRUE
    then
    changeSecondIndicator “650” to “7”
    removeSubField “650.2”
    addSubField “650.2.UNESP”
    end

    rule “Deduplica 650”
    priority 1
    when
    TRUE
    then
    correctDuplicateFields “650”
    end

    Gave me the same result as this:

    rule “Ajusta 650 para Autoridades”
    priority 2
    when
    TRUE
    then
    changeSecondIndicator “650” to “7”
    removeSubField “650.2”
    addSubField “650.2.UNESP”
    correctDuplicateFields “650”
    end

    Thanks in advance,

    Oberdan

  10. Hello Oberdan
    As a “best practice” it is recommended to do as you did in your first example and separate the correctDuplicateFields “650”
    as a separate rule.
    In this way you are sure of the order in which this will occur (whereby you are using the priority function) and also it is easier to “debug” the entire rule when it consists of separate rules, rather than having all functions together.
    So in sum while both examples you give may to do the same thing, the first example is more “orderly” and easier to maintain.

  11. Hello Joel,
    I am wondering if you can give me an advice about a normalization rule for our Holdings.
    After to import a new catalogue in our Alma,
    We have the 852 in this way: 852 $$b SPMS $$c FG $$h 210.19 $$i Y957p
    We want to get the following: 852 $$b SPMS $$c FG $$h 210.19 Y957p
    I built a normalization rule:
    rule “copy 852.i to 852.h and remove 852.i”
    when
    (exists “852.i”)
    then
    prefixSubField “852.i” with ” ”  it cause troubles
    suffixSubField “852.h” with “852.i”
    RemoveSubField “852.i”

    But it not work when I add the line: prefixSubField “852.i” with ” “, we need to add a space before the 852.i content.
    How you can add a space like a prefix or suffix?
    Thanks in advance,
    Maribel Alvarado

  12. Hi Yoel,

    I am trying to add a period to the end of a subfield by using changeSubfield with the \\. but it doesn’t seem to be working. Does the \\. only work for addField?

    Thanks!

  13. Hi Alie:
    I added a new example specifically for this question. It is called “Add a period to the end of 500 subfield a if there is not already a period at the end”. Please see it above and try the syntax in this example. Thanks.

  14. Hi, Yoel:

    I am trying to write a rule that adds a local field (and all of its subfields). This is a field for recording the library, cataloger and the action taken on the record. There can be multiple of these fields in any given record, with different subfield values.

    When I preview the rule, it adds all the subfields I want in the new field to the existing fields as well! Which I don’t want. :\

    For example:

    BEFORE:
    962 $$a law $$b cdh $$c rev

    New field that I want to add:
    962 $$ a law $$b mmb $$c new

    AFTER (when I preview in MDE):
    962 $$a law $$b cdh $$c rev $$b mmb $cc new
    962 $$a law $$b mmb $$c new

    I cannot find an example of adding a field with multiple subfields in one line. When I add the subfields separately, the above is what happens.

    Thanks!

  15. Hello Melissa:
    First add it as a different field (not 962) which you do not use, then change it at the end to 962. That way you will not influence existing 962 fields.
    For example below I add the new field as YLK then at the end I change field YLK to 962:

    rule “add new field YLK to not change existing 962 fields”
    priority 99
    when
    (TRUE)
    then
    addField “YLK.{-,-}.a.law”
    addSubField “YLK.b.mmb”
    addSubField “YLK.c.new”
    end

    rule “change the YLK to 962”
    priority 98
    when
    (TRUE)
    then
    changeField “YLK” to “962”
    end

  16. Hi Yoel,

    I’m from University of Macau Library. The NR really helps a lot for our records. Now we are facing one difficulty to remove the “.” right before “/”.

    Example 1:
    Before:
    245 $$a A Brief relation of the plague at Naples, in the year M.DC.LVI. / $$c Translated out of Italian into English.
    After:
    245 $$a A Brief relation of the plague at Naples, in the year M.DC.LVI / $$c Translated out of Italian into English.

    Example 2:
    Before:
    245 $$a A Brief relation of the plague at Naples, in the year M.DC.LVI. $$h [electronic resource] : $$b Where died 10, some days 15, and one day 20000 at least, (some say 25000) and the next day but 500. : With observations, preservatives, and cures. / $$c Translated out of Italian into English.
    After:
    245 $$a A Brief relation of the plague at Naples, in the year M.DC.LVI. $$h [electronic resource] : $$b Where died 10, some days 15, and one day 20000 at least, (some say 25000) and the next day but 500. : With observations, preservatives, and cures / $$c Translated out of Italian into English.

    Can you please suggest on that. Thank you!

    Best regards,
    Linlin Geng
    University of Macau Library

    1. Dear Stephen Lei
      Please see example above called “Replace a period with nothing in 245 subfield a if it is followed by a space then a forward slash”

  17. Hi Yoel,

    I’m stuck with a problem. How can I conditionally remove fields that do or do not meet a certain criteria, when there are several of these fields?

    Example (imaginary):
    I have multiple 246 fields. I want to keep the ones with subfield $5 with a certain code, AND the ones without a $$5, but NOT the ones with $5 with a different code:

    246 33 $$a Field I want to keep $$5 NL-LeU
    246 33 $$a Field I also want to keep
    246 33 $$a Field I want to delete $$5 DLC

    How can I do this? The rules I make seem to evaluate all 246 fields in one go, so conditions I set are either always true or always false and thus remove all, or remove none.

    Thanks and regards,
    Martijn

    1. Hello. If you want to delete a certain field but only in certain cases then you can out a condition in the level of the field as opposed to the level of the rule.
      For example see the rule called “Remove field 035 if it begins with (OCoLC)” It has this line:
      removeField “035” if (exists “035.a.(OCoLC)*”)
      That means that there may be many 035 fields but only certain ones will be deleted (in this case only ones beginning with “(OCoLC)”

  18. Thanks for your reply.

    I must be missing something here, because that does not work. The condition does not evaluate every single marc-tag but evaluates them all at once. So my condition is always true, or always false.

    In my examples above, I want to remove only the MARC-field that has a $$5 that does NOT have “NL-LeU”. The field that has NO $$5 at all, has to remain also.

    I can’t know in advance what code is used in $$5, as there are thousands of institution codes that can appear there.

    Thanks,
    Martijn

  19. Hi Yoel,

    I’m from Harvard Library. I’m trying to create a norm rule that would flip the deprecated heading, “Sex change,” to “Gender transition”, but it is not working when I test it in the new MDE. My proposed norm rule is adapted from an existing norm rule that another staff member had written. But I’m also aware of the Alma “Swaziland LCSH update” example. My proposed rule is:

    rule “change 650 Sex change to Gender transition”

    // updates 650 from “Sex change” to “Gender transition”

    when
    exists “650.{*,0}.a.Sex change”

    then
    replaceContents “650.a.Sex change” with “Gender transition” if (exists “650.{*,0}.a.Sex change”)

    end

    The model for my rule is:

    rule “update qualifier in 651”

    // updates main hdg from “Debar Region (Macedonia)” “Debar Region (North Macedonia)”
    // geographic hdgs with free-floating terms (H362; e.g. Region) not updated by PTC (unless established as separate authority (e.g. sh 85015815 ))

    when
    exists “651.{*,0}.a.Debar Region (Macedonia)”

    then
    replaceContents “651.a.Macedonia” with “North Macedonia” if (exists “651.a.Debar Region*”)

    end

    I also have a couple of general questions:

    1. It doesn’t seem to matter (or does it?) whether one writes:

    when
    (True) [the Alma Swaziland example]

    or

    when
    exists “650.{*,0}.a.Sex change” [based on the local Debar example]

    To me (a non-programmer), both environments seem the same.

    2. It doesn’t seem to matter whether one uses indents or not (judging by the ExLibris examples, and if so, the number of spaces for the indents doesn’t seem to matter). Are indentations there just to make the code easier to read, or do they serve a functional purpose?

    3. The “if exists” statement can include the field indicators or not: if(exists “610.{*,0}.z.Swaziland”) vs. if (exists “651.a.Debar Region*”)

    4. For comments, you can preface them either by “//” or “#” or either?

    5. If and when my rule can be made to work, will it also work when the subject heading has subdivisions, or would a separate norm rule have to be created for each instance of a subdivision?

    e.g. Sex change–Case studies; Sex change–Chile, etc.

    Thank you for your help!
    Best,
    Craig Thomas

  20. p.s., I apologize; my formatting was lost after I had sent it. I can resubmit if it makes it easier for you to read. Craig Thomas

  21. Dear Craig:

    1. Please see working example which I added with title called “Change Sex change to Gender transition in 650 only when 2nd indicator is 0”
    2. In this specific rule after the initial “when” you can use “true” because there is a specific condition on the level of the replaceContents line. You do not need it on the level of the entire rule if you have it ion the level of the replaceContents
    3. Indents in the rule have no functional value, they just make the rule easier to read and understand
    4. Comments can be prefaced by either two forward slashes or a hash sign (// or #)
    5. The rule cited here in number 1 works whether there are or are not subdivisions. It will work for “650_0 $$a Sex change $$x history” and it will also work for “650_0 $$a Sex change”

    Thanks
    Yoel

  22. Hi Yoel,

    Thank you for vetting my example. And also for your answers to my question; they are very helpful to know. I’m wondering if I am still doing something incorrectly. I created the rule in the Shared file and input it exactly as you suggest. Bib is in the left pane; norm rule is in the right pane. But it doesn’t change the subject heading.

    Could it be a permissions issue? I’m not currently authorized to run batch jobs in Alma. Would that affect my ability to test a norm rule in the MDE on a single record?

    Thank you for your help!

    Craig

  23. Hi Yoel,
    Any hints on how to approach a norm rule that removes $8 with Holdings ID from holdings fields output by Alma general publishing while still retaining the instances of $8 for sequence number in caption/pattern fields 85X/86X. For example:

    =LDR 00288ny 22001213n 4500
    =001 222047986150003941
    =004 990085350100203941
    =008 0101104p\\\\8\\\2001uueng0020608
    =014 \\$a25290806$bOCoLC$8222047986150003941
    =852 8\$aMH-S$bGEN$hPERIODICAL$8222047986150003941
    =853 00$81$av.$bno.$i(year)$8222047986150003941
    =863 30$81.1$a8-$i1998-$8222047986150003941

    Thanks, Allison

  24. Dear Craig Thomas:
    Please see sample rule above called “Change Sex change with and without a period at the end to Gender transition in 650 only when 2nd indicator is 0”
    Thank you
    Yoel

  25. Hi Yoel,

    Can you provide me advice on changing the capitalization of titles in the MARC 222 and 245 field?

    222 CONTACT LENS JOURNAL
    222 Contact Lens Journal

    245 THE CONTACT LENS JOURNAL
    245 The Contact Lens Journal

    Regards,

    Sandra Morgan

  26. Hello Sandra:

    rule “Contact Lens Journal”
    when
    (TRUE)
    then

    ReplaceContents “222.a.CONTACT LENS JOURNAL” with “Contact Lens Journal” if(exists “222.a.CONTACT LENS JOURNAL”)
    ReplaceContents “222.a.CONTACT LENS JOURNAL” with “Contact Lens Journal” if(exists “222.a.CONTACT LENS JOURNAL\\\\.”)

    ReplaceContents “245.a.CONTACT LENS JOURNAL” with “Contact Lens Journal” if(exists “245.a.CONTACT LENS JOURNAL”)
    ReplaceContents “245.a.CONTACT LENS JOURNAL” with “Contact Lens Journal” if(exists “245.a.CONTACT LENS JOURNAL\\\\.”)
    end

  27. I would like to copy the first 5 characters of the 245 subfield a into the 092 subfield b for a group of DVDs. Then, I want to copy the whole 092 to the 852 h in the holdings record. Is there a way to do that? Thanks in advance for any help.

    1. Dear Skagit Valley:
      It is not possible via a normalization rule to
      1. copy pos. X to pos. Y of a non-control field to another field (what you refer to as “copy the first 5 characters of the 245 subfield a …”)
      2. copy a field from a bibliographic record to a holdings record (what you refer to as “copy the whole 092 to the 852 h in the holdings record”)
      Thank you.

Leave a Reply