Voyager to Alma Migration Query: Identify MFHDs that contain multiple 852 tags (Advanced!)
When migrating from Voyager to Alma, the MFHD will be copied over as is. The presence of additional 852 data will be concatenated into a combined display of the information. Ideally, before the migration, any additional 852 tags should be merged into the first 852 or changed to other tags. For additional information, discuss this with your migration team.
Note that while the MFHD MARC21 form allows 852 fields to be repeatable, it may be desirable to evaluate and cleanup multiple 852 tags before migration.
The following two queries can help you identify these MFHD records. However, the first query is a BLOB query and along with being very slow to run, it also requires you to add a new Visual Basic module with a new BLOB function called CountFieldAll. If you do not know how to create a new Visual Basic module in Access and add the VB code supplied below to it, STOP HERE.
Query 1: BLOB query that counts MFHD 852 Tags and write results into table named: mfhd_852_count_tbl -- this query creates a table used by the second query.
SELECT MFHD_MASTER.MFHD_ID, MFHD_MASTER.SUPPRESS_IN_OPAC, MFHD_MASTER.DISPLAY_CALL_NO, MFHD_MASTER.NORMALIZED_CALL_NO, CountFieldAll(GetMfhdBlob([mfhd_id]),'852') AS mfhd852ct INTO mfhd_852_count_tbl
FROM MFHD_MASTER;
Query 2: Identify MFHDs with multiple 852 tabs using the table from the previous query -- the results of this query will contain a long-text field, mfhd852all, with each 852 field present and separated by a line break. Extend the row height in Access or Excel to see all entries.
SELECT mfhd_852_count_tbl.MFHD_ID, mfhd_852_count_tbl.SUPPRESS_IN_OPAC, mfhd_852_count_tbl.DISPLAY_CALL_NO, mfhd_852_count_tbl.NORMALIZED_CALL_NO, mfhd_852_count_tbl.mfhd852ct, getfieldrawall(getmfhdblob([mfhd_id]),'852') AS mfhd852all
FROM mfhd_852_count_tbl
WHERE (((mfhd_852_count_tbl.mfhd852ct)>1));
Visual Basic for creating the CountFieldAll BLOB function VB Module
' This function is designed around the principles of the blob functions in module Marc Code, and is based off the GetFieldAll function.
' User may invoke by specifying a marc record string, or a marc record called in a Get<type>Blob, and identify a tag to count.
' Function may be used to identify the presence of a tag in a record,
' as well as the number of instances of a field that a report writer would need to apply a GetField function to retrieve.
' Sample usage: CountFieldAll(GetBibBlob(BIB_TEXT.BIB_ID),'590')
Function CountFieldAll(MARCRec As String, DTag As String) As Long
Dim sField As String
Dim iWhich As Long
Dim SubFlds As String
SubFlds = ""
Dim SubSep As String
SubSep = " "
iWhich = 1
sField = Trim(GetField(MARCRec, DTag, iWhich, SubFlds, SubSep))
While Len(sField) > 0
iWhich = iWhich + 1
sField = Trim(GetField(MARCRec, DTag, iWhich, SubFlds, SubSep))
Wend
CountFieldAll = iWhich - 1
End Function
Posted as is. If you need assistance in running custom SQL queries in Prepackaged Access Reports, consult the Voyager Customer Listserv.