'MacroName:RDAFunction global CS As Object '$Include "utilities!clearClipboard" '-------------- sub add344(soundType$) tag344$ = "344 digital " & chr(223) & "b optical " & chr(223) & "g " & soundType$ CS.AddField 99, tag344$ end sub '----------- function findSMD() do x% = x% + 1 bool = CS.GetField ("007", x%, tag007$) tag007$ = mid(tag007$, 6) if left(tag007$, 1) = "c" then findSMD = mid(tag007$, 6, 1) exit function else msgbox("missing 007") end if loop until tag007$ = "" end function '----------- sub addFields(MARCType$, Form$, ill$) if Form$ = "o" then Content$ = "WEBSITE" elseif MARCType$ = "a" then Content$ = "BOOK" elseif MARCType$ = "g" then Content$ = "VIDEO" elseif MARCType = "i" then if Form$ = "s" or Form$ = "q" then Content$ = "PLAYAWAY" else Content$ = "AUDIOBOOK" end if elseif MARCType = "j" then Content$ = "CD" elseif Form$ = "q" then Content$ = "CD-ROM" elseif MARCType = "c" then Content$ = "SCORE" elseif MARCType = "z" then Content$ = "Authority" elseif MARCType = "e" then Content$ = "MAP" else msgbox ("Huh?") exit sub end if select case Content$ case "BOOK" tag336a$ = "text" tag336b$ = "txt" tag337a$ = "unmediated" tag337b$ = "n" tag338a$ = "volume" tag338b$ = "nc" case "VIDEO" tag336a$ = "two-dimensional moving image" tag336b$ = "tdi" tag337a$ = "video" tag337b$ = "v" tag338a$ = "videodisc" tag338b$ = "vd" case "AUDIOBOOK" tag336a$ = "spoken word" tag336b$ = "spw" tag337a$ = "audio" tag337b$ = "s" tag338a$ = "audio disc" tag338b$ = "sd" case "CD" tag336a$ = "performed music" tag336b$ = "prm" tag337a$ = "audio" tag337b$ = "s" tag338a$ = "audio disc" tag338b$ = "sd" case "PLAYAWAY" tag336a$ = "spoken word" tag336b$ = "spw" tag337a$ = "audio" tag337b$ = "s" tag338a$ = "other audio carrier" tag338b$ = "sz" case "CD-ROM" tag336a$ = "computer program" tag336b$ = "cop" tag337a$ = "computer" tag337b$ = "c" tag007b$ = findSMD() select case tag007b$ case "b" tag338a$ = "computer chip cartridge" tag338b$ = "cb" case else tag338a$ = "computer disc" tag338b$ = "cd" end select case "SCORE" tag336a$ = "notated music" tag336b$ = "ntm" tag337a$ = "unmediated" tag337b$ = "n" tag338a$ = "volume" tag338b$ = "nc" case "MAP" tag336a$ = "cartographic image" tag336b$ = "cri" tag337a$ = "unmediated" tag337b$ = "n" tag338a$ = "volume" tag338b$ = "nc" case "WEBSITE" tag336a$ = "text" tag336b$ = "txt" tag337a$ = "computer" tag337b$ = "c" tag338a$ = "online resource" tag338b$ = "cr" end select if content = "Authority" then CS.SetFixedField "Rules", "z" bool = CS.GetField ("040", 1, temp$) if instr(temp$, "e rda") then 'do nothing else 'add $e CS.SetField 1, temp$ & " " & chr(223) & "e rda" end if CS.RunMacro "DPK_RDA!EarlierLater" CS.RunMacro "DPK_RDA!380" CS.RunMacro "DPK_RDA!378q" CS.RunMacro "DPK_RDA!046dateInHdg" else tag336$ = "336 " & tag336a$ & " " & chr(223) & "b " & tag336b$ & " " & chr(223) & "2 rdacontent" tag337$ = "337 " & tag337a$ & " " & chr(223) & "b " & tag337b$ & " " & chr(223) & "2 rdamedia" tag338$ = "338 " & tag338a$ & " " & chr(223) & "b " & tag338b$ & " " & chr(223) & "2 rdacarrier" 'CS.DeleteField "336", 1 'CS.DeleteField "337", 1 'CS.DeleteField "338", 1 CS.AddField 99, tag336$ CS.AddField 99, tag337$ CS.AddField 99, tag338$ 'if ill$ > "" then CS.AddField 2, "336 still image " & chr(223) & "b sti " & chr(223) & "2 rdacontent" end if if Content$ = "VIDEO" then bool = CS.GetField ("538", 1, tag538$) '380 motion picture x% = 1 bool = CS.GetField ("655", x%, temp$) do if instr$(temp$, "Feature films") then CS.SetField 1, "380 Motion picture" exit do end if x% = x% + 1 bool = CS.GetField ("655", x%, temp$) loop until not bool '380 television program x% = 1 bool = CS.GetField ("655", x%, temp$) do if instr$(temp$, "elevision ") then CS.SetField 2, "380 Television program" exit do end if x% = x% + 1 bool = CS.GetField ("655", x%, temp$) loop until not bool '347 Blu-ray or DVD if instr(tag538$, "DVD") then tag347b$ = "DVD video" elseif instr(tag538$, "Blu-") then tag347b$ = "Blu-ray" end if if instr(tag538$, "egion A") then tag347e$ = "region A" if instr(tag538$, "egion 0") then tag347e$ = "region 0" if instr(tag538$, "egion 1") then tag347e$ = "region 1" if instr(tag538$, "egion 2") then tag347e$ = "region 2" if instr(tag538$, "ll region") then tag347e$ = "all regions" tag347$ = "347 video file " & chr(223) & "b " & tag347b$ & " " & chr(223) & "e " & tag347e$ & " " & chr(223) & "2 rda" CS.AddField 99, tag347$ '344 sound characteristics if instr$(tag538$, "surround") or instr$(tag538$, ".1") then add344("surround") if instr$(tag538$, "stereo") or instr$(tag538$, "2.0") then add344("stereo") if instr$(tag538$, "mono") then add344("mono") '346 video characteristics if instr$(tag538$, "1080i") then tag346$ = tag346$ & ", 1080i" if instr$(tag538$, "1080p") then tag346$ = tag346$ & ", 1080p" if instr$(tag538$, "720p") then tag346$ = tag346$ & ", 720p" if instr$(tag538$, "480i") then tag346$ = tag346$ & ", 480i" if instr$(tag538$, "NTSC") then tag346$ = tag346$ & chr(223) & "b NTSC" if instr$(tag538$, "PAL") then tag346$ = tag346$ & chr(223) & "b PAL" if tag346$ > "" then tag346$ = "346 " & tag346$ CS.AddField 99, tag346$ end if CS.RunMacro "DPK!Add046" end if if Content$ = "AUDIOBOOK" or Content$ = "CD" then CS.AddField 99, "344 digital " & chr(223) & "b optical " & chr(223) & "2 rda" CS.AddField 99, "347 audio file " & chr(223) & "b CD audio " end if if Content$ = "CD-ROM" then CS.AddField 99, "347 data file " & chr(223) & "2 rda" end if end sub '-------------- Sub Main Set CS = CreateObject("Connex.Client") call clip bool = CS.GetFixedField ("Type", MARCType$) bool = CS.GetFixedField ("Form", Form$) bool = CS.GetFixedField ("ills", Ill$) call addFields(MARCType$, Form$, ill$) 'look for more MARC types x% = 1 do bool = CS.GetField ("006", x%, temp$) if temp$ = "" then exit do MARCType$ = mid(temp$, 6, 1) Form$ = mid(temp$, 12, 1) if MARCType$ = "a" then ill$ = mid(temp$, 7, 1) else ill$ = "" end if x% = x% + 1 call addFields(MARCType$, Form$, ill$) loop end sub