Hi, All -- Does anyone know if the Batch record modification tool can handle control fields? -- specifically, changes to various positions in the leader, 008, etc. We're trying to update the 008/33 in a large number of records. I've tried creating an action for this under a MARC modification template, but it seems to be expecting standard fields & subfields (i.e., it won't accept a 2 digit number to represent a position). We can always export to MarcEdit, but if we can do this from within Koha, that would be great. All best, Cab Vinton, Director Plaistow Public Library Plaistow, NH
Hi Cab, Unfortunately, Koha's MARC modification tool cannot do any changes in control fields, AFAIK. I usually tell people to use MarcEdit to do such batch changes. Here's a procedure I wrote (in French, but I'm sure Google can translate it for you) : https://inlibro.com/knowledge-base/modification-en-lot-des-zones-de-controle... I hope it helps, Caroline On 2021-08-24 11 h 38, Cab Vinton wrote:
Hi, All --
Does anyone know if the Batch record modification tool can handle control fields? -- specifically, changes to various positions in the leader, 008, etc. We're trying to update the 008/33 in a large number of records.
I've tried creating an action for this under a MARC modification template, but it seems to be expecting standard fields & subfields (i.e., it won't accept a 2 digit number to represent a position).
We can always export to MarcEdit, but if we can do this from within Koha, that would be great.
All best,
Cab Vinton, Director Plaistow Public Library Plaistow, NH _______________________________________________
Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha Caroline Cyr La Rose, M.L.I.S. Librarian | Product Manager
Phone: 1-833-465-4276, ext. 221 Caroline.Cyr-La-Rose@inLibro.com <mailto:caroline.cyr-la-rose@inLibro.com> INLiBRO | Document Technology Specialists | www.inLibro.com <http://www.inLibro.com>
Thanks so much, Caroline! Good excuse to brush up on my French. Have used MarcEdit before, but not for this, so your instructions will be vachement utiles :-) Btw, we've been using the report below to identify which records have issues w/ the 008/33. However, the ExtractValue statement is pulling spaces rather than the actual values. Would be grateful for any suggestions on why the SUBSTRING & ExtractValue statements don't appear to be working well together. All best, Cab Vinton, Director Plaistow Public Library SELECT SUBSTRING(ExtractValue(metadata,'//controlfield[@tag=008]'),33,1) AS LitForm, i.itemcallnumber, i.itype, i.ccode, CONCAT('<a href=\"/cgi-bin/koha/catalogue/detail.pl?biblionumber=', biblionumber, '\">', biblionumber, '</a>' ) AS bibnumber FROM biblio_metadata LEFT JOIN items i USING (biblionumber) ORDER BY i.biblionumber DESC, i.itemcallnumber
There is a particularity with substring and control fields in SQL. The difference has to do with the starting character of the substring, i.e. the 33 in the following sequence SUBSTRING(ExtractValue(metadata,'//controlfield[@tag=008]'),33,1) MARC starts counting at 1, whereas SQL starts counting at 0. Or it might be the reverse, I don't remember exactly. Anyway, the thing is that you can't use the MARC character position (in this case 33 because you're looking for 008/33), directly in the substring statement. You have to add 1. So to look for 008/33 you have to use SUBSTRING(ExtractValue(metadata,'//controlfield[@tag=008]'),34,1) to look for 008/15-17, like in the example in the link I sent, you have to use SUBSTRING(ExtractValue(metadata,'//controlfield[@tag=008]'),16,3) Does that make sense? Caroline On 2021-08-24 12 h 13, Cab Vinton wrote:
Thanks so much, Caroline! Good excuse to brush up on my French.
Have used MarcEdit before, but not for this, so your instructions will be vachement utiles :-)
Btw, we've been using the report below to identify which records have issues w/ the 008/33. However, the ExtractValue statement is pulling spaces rather than the actual values.
Would be grateful for any suggestions on why the SUBSTRING & ExtractValue statements don't appear to be working well together.
All best,
Cab Vinton, Director Plaistow Public Library
SELECT SUBSTRING(ExtractValue(metadata,'//controlfield[@tag=008]'),33,1) AS LitForm, i.itemcallnumber, i.itype, i.ccode, CONCAT('<a href=\"/cgi-bin/koha/catalogue/detail.pl?biblionumber=', biblionumber, '\">', biblionumber, '</a>' ) AS bibnumber FROM biblio_metadata LEFT JOIN items i USING (biblionumber) ORDER BY i.biblionumber DESC, i.itemcallnumber Caroline Cyr La Rose, M.S.I. Bibliothécaire | Responsable de produit
Tél. : 1-833-465-4276, poste 221 Caroline.Cyr-La-Rose@inLibro.com <mailto:caroline.cyr-la-rose@inLibro.com> INLiBRO | Spécialistes en technologies documentaires | www.inLibro.com <http://www.inLibro.com>
Does indeed make sense, Caroline. Thank you! Report now generates much more sensible results, though it's interesting that the previous version was also finding things. If the SUBSTRING was off by 1, in theory almost all of the values should have been spaces since the 008/32 is almost always blank (for books, at least). But I think we're on the right track now. Many thanks again. Cab Vinton, Director Plaistow Public Library On Tue, Aug 24, 2021 at 1:20 PM Caroline Cyr-La-Rose <caroline.cyr-la-rose@inlibro.com> wrote:
There is a particularity with substring and control fields in SQL.
The difference has to do with the starting character of the substring, i.e. the 33 in the following sequence
SUBSTRING(ExtractValue(metadata,'//controlfield[@tag=008]'),33,1)
MARC starts counting at 1, whereas SQL starts counting at 0. Or it might be the reverse, I don't remember exactly. Anyway, the thing is that you can't use the MARC character position (in this case 33 because you're looking for 008/33), directly in the substring statement. You have to add 1.
So to look for 008/33 you have to use
SUBSTRING(ExtractValue(metadata,'//controlfield[@tag=008]'),34,1)
to look for 008/15-17, like in the example in the link I sent, you have to use
SUBSTRING(ExtractValue(metadata,'//controlfield[@tag=008]'),16,3)
Does that make sense?
Caroline
participants (2)
-
Cab Vinton -
Caroline Cyr-La-Rose