OCLC Connexion Macros - PowerPoint PPT Presentation

1 / 27
About This Presentation
Title:

OCLC Connexion Macros

Description:

OCLC Connexion Macros. Using Connexion Commands to Accomplish Cataloging Tasks ... Each diacritic & special character has a number to use with Chr ... – PowerPoint PPT presentation

Number of Views:119
Avg rating:3.0/5.0
Slides: 28
Provided by: joel62
Category:

less

Transcript and Presenter's Notes

Title: OCLC Connexion Macros


1
OCLC Connexion Macros
  • Using Connexion Commands to Accomplish Cataloging
    Tasks

Harvey Joel Hahn June 27, 2005
2
Who we are
  • Joel Hahn
  • Niles Public Library District, Niles, IL
  • ltjhahn_at_nileslibrary.orggt
  • Harvey Hahn
  • Arlington Heights Memorial Library, Arlington
    Heights, IL
  • lthhahm_at_ahml.infogt

3
Introduction
  • Writing macros is like creating a recipe.
  • There are many ingredients to choose from.
  • Which ingredients you choose and the order in
    which you add them can make a big difference in
    the results.
  • Writing a macro is all about figuring out what
    ingredients you have available and how they work
    together.

4
Working with data
  • Four basic tasks
  • Find the data
  • Get the data to modify
  • Change (or examine) the data
  • Save the data

5
Working with data MARC fields
  • Basic format of MARC fields in macros
  • tttiiFirst subfield b Second subfield etc.
  • To get the tag
  • Left( sField, 3 )
  • To get the 1st indicator
  • Mid( sField, 4, 1 )
  • To get the 2nd indicator
  • Mid( sField, 5, 1 )
  • To get just the variable data
  • Mid( sField, 6 )
  • The exception is ACJK data Data contains
    non-latin script

6
Working with data Delimiters
  • Delimiter Chr(223)
  • "First subfield " Chr(223) "b Second
    subfield"
  • InStr( sField, Chr(223) )
  • InStr( sField, Chr(223) "x" )
  • Chr(223) appears as ß in other fonts.
  • Each diacritic special character has a number
    to use with Chr( ).
  • The codes are listed in the help file.

7
Working with fields
  • Four basic tasks
  • Find the field
  • Get the contents of the field
  • Change (or examine) the field
  • Save the field

8
Working with fields Find
  • CS.Find
  • CS.GetField
  • CS.GetFieldLine

9
Working with fields Find
  • Find all fields matching a given pattern
  • nCount 1
  • IsField CS.GetField( sTagNum, nCount, sField )
  • Do While IsField ltgt FALSE
  • If ltinsert command here to i.d. the fieldgt
    Then
  • 'Put commands here to change the
    identified field
  • 'Exit Do (To only find the first
    matching field)
  • End If
  • nCount nCount 1
  • IsField CS.GetField( sTagNum, nCount,
    sField )
  • Loop

10
Working with fields Get
  • CS.GetField( "500", 1, sField )
  • CS.GetFieldLine( 10, sField )
  • CS.GetFixedField( "Lang", sField )

Working with fields Change
  • Use the four basic tasks of working with data

11
Working with fields Save
  • CS.SetField( 1, sField )
  • CS.SetFieldLine( 10, sField )
  • CS.SetFixedField( "Lang", "eng" )

12
Working with fields Practical Examples
  • Create populate a default III 949 field Copy to
    paste from Sirsi Workflows
  • Add a 590 with the cataloger's initials today's
    date
  • Enhance 505 fields

13
Working with records
  • Four basic tasks
  • Find the record
  • Get (display) the record
  • Change (or examine) the record
  • Save the field

14
Working with records Find
  • CS.Search( sDatabase, sSearchTerm )

Working with records Get
  • CS.Search( sDatabase, sSearchTerm )
  • CS.GetFirstItem
  • CS.GetFirstSelectedItem
  • CS.GetListItem( nListNumber)

15
Working with records Change
  • Use the four basic tasks of working with fields
  • nNumErrors CS.Validate( sErrList )
  • CS.Update
  • CS.Export
  • CS.QueryRecordStatus
  • CS.SetMyStatus
  • CS.SetWorkflowStatus

16
Working with records Change
  • Working with the OCLC number
  • CS.GetFixedField( "OCLC", sOCLCNum )
  • CS.QueryRecordStatus( "NUM", sOCLCNum )

17
Working with records Save
  • CS.SaveOnline
  • CS.SaveToLocalFile
  • CS.CloseRecord( TRUE )

18
Working with records Practical Examples
  • Validate, Update, Save, and Close in one step
  • Delete all non-LCSH/LCAC subject headings
  • Copy the call number from an 050 field to an 090
    field
  • Copy the call number from an 050 to an 090, apply
    any of several constant data records depending on
    the record format, and add a default III 949 field

19
Working with lists
  • Choose your starting point
  • CS.GetFirstItem
  • CS.GetFirstSelectedItem
  • CS.GetListItem
  • Move on to the next record
  • CS.GetNextItem
  • CS.GetNextSelectedItem
  • CS.GetListItem
  • Determine whether youre done
  • If a GetNext-type command fails, then there are
    no more records to process.

20
Working with lists
  • Combining those three steps into the basic
    pattern of looping through records
  • Bool CS.GetFirstItem
  • (or CS.GetFirstSelected or
    CS.GetListItem)
  • If Bool FALSE Then
  • Exit Sub
  • End If
  • Do
  • 'Put commands here to edit each record
  • Loop Until CS.GetNextItem FALSE
  • (or CS.GetNextSelectedItem)

21
Working with lists Practical Examples
  • Resave the entire online bibliographic save file
  • Copy the call number from an 050 to an 090, apply
    any of several constant data records depending on
    the record format, and add a default III 949
    field for all listed records from your local save
    file

22
General Connexion commands
  • CS.ItemType
  • Checking if Connexion is online
  • If CS.IsOnline FALSE Then
  • Bool CS.Logon("", "", "") 'Use your default
    logon
  • If Bool FALSE Then
  • MsgBox "Unable to log on. Exiting"
  • Exit Sub
  • End If
  • End If
  • CS.SendKeys

23
Working with the Macro Recorder
  • One way to find ingredients and how they can be
    put together is to record macros.
  • However, the recorder can only recreate your
    exact keystrokes and mouse clicks.
  • Cant use efficient programming methods like
    IfThen and loops
  • May sometimes make it harder to learn to write
    your own macros

24
Working with the Macro Recorder Practical
Examples
  • Validate, Update, Save, and Close in one step
  • Add a default III 949 field

25
Copy macros from other sources
  • From e-mail webpages
  • Create a new macro
  • Open it for editing
  • Select copy the macro from the e-mail/web
  • Paste the macro in the new one you created
  • From macrobook files on webpages
  • Click the link, save the .mbk file to your
    ../OCLC/Program/Macros directory
  • From other computers
  • Copy the macrobook from that computers
    ../OCLC/Program/Macros directory to that
    directory on your computer.

26
Further resources
  • OCLC-CAT mailing list
  • OCLCs Connexion macros web page
  • http//www.oclc.org/connexion/support/macros.htm
  • OML for the Complete Beginner
  • http//users.rcn.com/aardy/oml/lessons/index.html
  • Joels OML web page
  • http//users.rcn.com/aardy/oml/index.html
  • Harveys OML web page
  • http//www.ahml.info/oml/

27
QA
  • Thanks for coming!
Write a Comment
User Comments (0)
About PowerShow.com