Skip to main content
ExLibris

Knowledge Assistant

BETA
 
  • Subscribe by RSS
  • Back
    Alma

     

    Ex Libris Knowledge Center
    1. Search site
      Go back to previous article
      1. Sign in
        • Sign in
        • Forgot password
    1. Home
    2. Alma
    3. Community Knowledge
    4. Drools Normalization - Copy exact positions of a controlfield to a datafield

    Drools Normalization - Copy exact positions of a controlfield to a datafield

    1. Last updated
    2. Save as PDF
    3. Share
      1. Share
      2. Tweet
      3. Share
    1. Question
    2. Answer
    Created By: Obv- alma
    Created on: 8/06/2018

    Question

    How can I copy the language code from controlfield 008 Pos. 35-37 to datafield 041 subf. a?

    Answer

    This can be achieved by a trick using Drools Normalization:

    rule "copy 008 language code to 041 if 041 does not exist"
    when
    ((not exists "041.a") AND (not existsControl "002"))
    then
    copyControlField "008" to "002"
    replaceControlContents "002.{0,35}" with " "
    replaceControlContents "002.{4,2}" with " "
    copyField "002" to "041.a"
    removeField "002"  
    end
    

    Additional Information

    First the whole controlfield 008 is copied to another controlfield (in this example 002) which is NOT in use.
    Next two lines are the crucial ones - we have to isolate the language code (pos. 35-37) from the rest of the controlfield, because we only want to copy the language code and not the whole field. Therefore we replace the contents of all positions except 35-37 with blanks.
    The remaining content is then copied to 041 subf. a.
    As a last step we remove controlfield 002.

     

    Report Abuse
    View article in the Exlibris Knowledge Center
    1. Back to top
      • Analytics Evidence CUSA3 - Platform Information Missing from Cost Usage - (Resolved)
      • Analytics Evidence EISA1 - Fund Information missing from e-inventory subject area at both portfolio and collection levels
    • Was this article helpful?

    Recommended articles

    1. Article type
      Topic
      Community Content Type
      How To
      Content Type
      Documentation
      Language
      English
      Product
      Alma
    2. Tags
      This page has no tags.
    1. © Copyright 2025 Ex Libris Knowledge Center
    2. Powered by CXone Expert ®
    • Term of Use
    • Privacy Policy
    • Contact Us
    2025 Ex Libris. All rights reserved