[Wactclc-alma] Automatically generated cutters in Connexion Client

Thomas, Kirsti Kirsti.Thomas at seattlecolleges.edu
Thu Mar 4 13:17:03 PST 2021


Cara Beth,

We have 2 macros we use in Connextion Client to create special call number cutters based on author's name and/or title.  It shouldn't be too difficult to modify them (after we get our patron load working) to automatically generate Cutters for you, and even trim the Dewey number after the 3rd character.

To run the macros, our cataloger Mary Matney just has to select Alt + [some key I forget right now].  I always forget the shortcut, so I go into Tools > Macros > Manage, click on the macro name, and click Run.

We did have to ask our IT staff to grant everyone read/writer permissions to the following folder to be able to use Connexion Client macros:
        C:\Program Files (x86)\OCLC





Here's how a bib record looks before the macro-there are 2 LC call numbers, a Dewey call number field that doesn't actually have a DDC number, an author in a 100 field, and a title in a 245 field.




Immediately after clicking Run, the record looks like this: Now there's an 099 field with FIC automatically added at the beginning of the call number field and the first 3 letters of the author's name were automatically copied to create a Cutter.




There's another one that will automatically copy the first 5 letters from the author's name and first 5 letters from the title:




I'm sharing the text of the macros below-not because I'm expecting you to edit them-but so if other people (like Wade) are interested they can borrow and modify them:

MacroName:CentralEasyFictionCallNum
'MacroDescription:Creates an 099 call number with the first 5 characters of the author's name (if present) and title

Sub Main

   Dim CS As Object
   Set CS = CreateObject("Connex.Client")

   Dim bool As Integer
   Dim Place As Integer
   Dim AuthorCutter As String
   Dim TitleCutter As String
   Dim CutterTest As String
   Dim Indicator1 As String
   Dim Indicator2 As String

'The first 5 characters of each MARC field are always the MARC tag (characters 1-3)
'and the indicators (characters 4-5).
'When using the "place" command to identify where in the MARC field a given text string occurs,
'always subtract "6" to take the MARC tag and indicators into account.
'When using the "Mid" command to trim a variable text string from a MARC field,
'always use "6" as the starting point to take the MARC tag and indicators into account.

'Copies the first filing word of the title to create a Title Cutter

   bool = CS.GetField("245", 1, TitleCutter)

'This retrieves the 2nd indicator

   Indicator2 = Mid(TitleCutter, 5, 1)

'This retrieves the first filing word when there are no direct/indirect articles in the title

   If Indicator2="0" Then
      place = InStr(TitleCutter, " ")-6
      TitleCutter = Mid(TitleCutter, 6, place)

'This retrieves the first filing word, using the value of the second indicator
'to identify how many characters to ignore at the start of the title field

   Else
      place = InStr(Val(Indicator2) + 6,  TitleCutter, " ")-6
      TitleCutter = Mid(TitleCutter, Val(Indicator2) + 6, place - Val(Indicator2))

   End If


'If the Title Cutter is longer than 5 characters, this trims the Cutter to 5 letters

   If Len(TitleCutter) > 5 Then
      TitleCutter = Left(TitleCutter, 5)
   End If

'If the final character of the Title Cutter is not a letter, this removes the character

        CutterTest = Right(TitleCutter, 1)
        If Not CutterTest Like "[a-zA-Z]" Then
            TitleCutter = Left(TitleCutter, Len(TitleCutter) -1)
        End If

'If the first filing word of the title isn't capitalized, this capitalizes the first letter

   If Left (TitleCutter,1) Like "[a-z]" Then
      TitleCutter = UCase(Left(TitleCutter, 1)) & Mid(TitleCutter, 2)
   End If


'This checks for the existence of an author field

   bool = CS.GetField("100", 1, AuthorCutter)

     'If no author field is present, the macro
     'creates an 099 field with just the title Cutter
     'and quits the macro

      If bool = FALSE Then

         bool = CS.AddField(1, "099  " & TitleCutter)
         Goto Done

     'If an author field is present, the macro copies the author's last name to create an author Cutter

      Else

         'This retrieves the first indicator in the author field

         Indicator1 = Mid(AuthorCutter, 4, 1)

         'If the author's name has no surname, the macro retrieves everything up to the period
         'at the end of the author's name.

         If Indicator1 = "0" Then

            place = InStr(AuthorCutter, ".")-6
            AuthorCutter = Mid(AuthorCutter, 6, place)

         Else

            'If the author's name has a surname, the macro retrieves everything up to the comma
            'between the author's surname and first name.

            place = InStr(AuthorCutter, ",")-6
            AuthorCutter = Mid(AuthorCutter, 6, place)

         End If

       'If the Author Cutter is longer than 5 characters, this trims the Cutter to 5 letters

        If Len(AuthorCutter) > 5 Then
            AuthorCutter = Left(AuthorCutter, 5)
        End If

       'If the final character of the Author Cutter is a hyphen, this trims removes the character

        CutterTest = Right(AuthorCutter, 1)

         If CutterTest = "-"  Then
            AuthorCutter = Left(AuthorCutter, 4)
         End If

     'If both an author and title are present, the macro creates an 099 field
     'with an author and a title Cutter

         bool = CS.AddField(1, "099  " & AuthorCutter & " ßa " & TitleCutter)


      End If

Done:
End Sub




'MacroName:PaperbackCollectionCallNum
'MacroDescription:Creates a 3-character 099 call number from the main entry (author or title)

Sub Main

   Dim CS As Object
   Set CS = CreateObject("Connex.Client")

   Dim bool As Integer
   Dim Place As Integer
   Dim Cutter As String
   Dim CutterTest As String
   Dim Indicator1 As String
   Dim Indicator2 As String



'Copies the Main Entry to create a call number Cutter
'If there's no author main entry, the Cutter is created from the first filing word in the title

   bool = CS.GetField("100", 1, Cutter)
      If bool = FALSE Then

         bool = CS.GetField("245", 1, Cutter)

            Indicator2 = Mid(Cutter, 5, 1)

               If Indicator2="0" Then

                  place = InStr(Cutter, " ")-6
                  Cutter = Mid(Cutter, 6, place)

               Else

                  place = InStr(Val(Indicator2) + 6, Cutter, " ")-6
                  Cutter = Mid(Cutter, Val(Indicator2) + 6, place - Val(Indicator2))

               End If
      Else

         Indicator1 = Mid(Cutter, 4, 1)

            If Indicator1="0" Then

               place = InStr(Cutter, ".")-6
               Cutter = Mid(Cutter, 6, place)

            Else

               place = InStr(Cutter, ",")-6
               Cutter = Mid(Cutter, 6, place)

            End If

      End If

'If the Cutter is longer than 3 characters, this trims the Cutter to 3 letters

   If Len(Cutter) > 3 Then
      Cutter = Left(Cutter, 3)
   End If


'If the final character of the Cutter is a hyphen, this trims and removes the character

   CutterTest = Right(Cutter, 1)

   If CutterTest = "-"  Then
      Cutter = Left(Cutter, 2)
   End If


   bool = CS.AddField(1, "099  FIC " & Cutter)



End Sub


Kirsti S. Thomas
Library Technical Services Manager
Seattle Colleges
kirsti.thomas at seattlecolleges.edu



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ctc.edu/pipermail/wactclc-alma_lists.ctc.edu/attachments/20210304/854f89bb/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Picture (Device Independent Bitmap) 1.jpg
Type: image/jpeg
Size: 31924 bytes
Desc: Picture (Device Independent Bitmap) 1.jpg
URL: <http://lists.ctc.edu/pipermail/wactclc-alma_lists.ctc.edu/attachments/20210304/854f89bb/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Picture (Device Independent Bitmap) 2.jpg
Type: image/jpeg
Size: 40679 bytes
Desc: Picture (Device Independent Bitmap) 2.jpg
URL: <http://lists.ctc.edu/pipermail/wactclc-alma_lists.ctc.edu/attachments/20210304/854f89bb/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Picture (Device Independent Bitmap) 3.jpg
Type: image/jpeg
Size: 38485 bytes
Desc: Picture (Device Independent Bitmap) 3.jpg
URL: <http://lists.ctc.edu/pipermail/wactclc-alma_lists.ctc.edu/attachments/20210304/854f89bb/attachment-0002.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Picture (Device Independent Bitmap) 4.jpg
Type: image/jpeg
Size: 40148 bytes
Desc: Picture (Device Independent Bitmap) 4.jpg
URL: <http://lists.ctc.edu/pipermail/wactclc-alma_lists.ctc.edu/attachments/20210304/854f89bb/attachment-0003.jpg>


More information about the Wactclc-alma mailing list