macro-enhancing connexion

24
Macro-Enhancing Connexion Learn how to improve your cataloging productivity using macros in the Connexion client February 8, 2005

Upload: tejana

Post on 21-Jan-2016

30 views

Category:

Documents


0 download

DESCRIPTION

Macro-Enhancing Connexion. Learn how to improve your cataloging productivity using macros in the Connexion client February 8, 2005. Harvey Hahn Arlington Heights Memorial Library, Arlington Heights, IL. Joel Hahn Niles Public Library District, Niles, IL. Who we are. Special thanks to…. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Macro-Enhancing  Connexion

Macro-Enhancing Connexion

Learn how to improve your cataloging productivity using macros in the Connexion client

February 8, 2005

Page 2: Macro-Enhancing  Connexion

Who we are

Harvey Hahn Arlington Heights Memorial

Library, Arlington Heights, IL

Joel Hahn Niles Public Library District,

Niles, IL

Page 3: Macro-Enhancing  Connexion

Special thanks to…OML “pioneers”

Eric Celeste (MIT) Jim Ferguson (TPOT-UCSD) Walt Nickeson (Univ. Rochester) Tim Shearer (UNC-Chapel Hill) Will Caine (SOLINET) Carl Ratz (Phoenix Pub. Lib.)

Kyle Banerjee (Oregon State Lib.) Jon Higgins (formerly WILS) Rhoda Bilansky (Boston Univ.)

and many other macro writers over the years

Page 4: Macro-Enhancing  Connexion

And special thanks to…

OCLC for providing a full-blown programming

language as an integrated part of their software products.

“If I have seen further than other men, it is because I stood on the shoulders of giants.” –Isaac Newton

Page 5: Macro-Enhancing  Connexion

Similarities between CatME and Connexion macros

OML Standard BASIC commands are identical.

Variables operate exactly the same.

Adding a field as line 99 (or better yet, 999) makes it the last line in the record.

Many OCLC-specific commands are identical (though Connexion has more).

Page 6: Macro-Enhancing  Connexion

Some commands are identical CS.CursorRow CS.CursorColumn CS.DeleteHoldings CS.DeleteRecord CS.Export CS.FindText CS.Print CS.QueryRecordStatus CS.Reformat CS.RunMacro CS.SetMyStatus CS.UpdateHoldings

Page 7: Macro-Enhancing  Connexion

Commands that are similar* CatME

CS.Insert

CS.GetFixedField

CS.SetFixedField

CS.GetFirstRecord

CS.GetNextRecord

CS.Replace

Connexion

CS.InsertMode

CS.GetFixedField

CS.SetFixedField

CS.GetFirstItem

CS.GetNextItem

CS.ReplaceRecord

* Similar does not mean identical!

Page 8: Macro-Enhancing  Connexion

Commands that are different* CatME

Dim CS As Object

Set CS = CreateObject (“CatME.Application”)

CS.ResaveOnlineFile CS.SaveLocal

CS.Validate

Connexion

Dim CS As Object

Set CS = CreateObject (“Connex.Client”)

CS.SaveOnline CS.SaveToLocalFile

(FALSE,FALSE) nNumErrs =

CS.Validate(sErrList)

* Different can mean better!

Page 9: Macro-Enhancing  Connexion

More differing commands

CatME CS.ItemType

CS.Scan

CS.Search(search string)

CS.SearchLocalFile (search string, file type)

Connexion CS.ItemType (Uses different

values)

CS.Browse

CS.Search(database, search string)

}

Page 10: Macro-Enhancing  Connexion

Some are similar and different

CatME

CS.GetFieldData

CS.SetFieldData

CS.AddField

Connexion

CS.GetFieldLine CS.GetField

CS.SetFieldLine CS.SetField

CS.AddFieldLine CS.AddField

{

{

{

Page 11: Macro-Enhancing  Connexion

One major programming difference between CatME and Connexion

CatME Retrieved field data

has spaces surrounding the indicators.

245_14_Some title

Connexion Retrieved field data

does not have spaces surrounding the indicators.

24514Some title

This difference affects how you write macros!

Page 12: Macro-Enhancing  Connexion

Obsolete CatME commands CS.GetActiveRecord CS.GetActiveTruncatedList

Page 13: Macro-Enhancing  Connexion

Difficult CatME tasks that are simple commands in Connexion

CS.GetField(“650”, 1, SubjectData) Grab the contents of the first 650 field

CS.EndCell : CS.PrevSubfield Jump the cursor to the start of the last subfield

in the current field

CS.DeleteToEndOfCell Delete from the cursor to the end of the field

Page 14: Macro-Enhancing  Connexion

Things to watch out for Connexion always handles the character

internally.

If you see ö in a record, what's really there and what macros will report is o¨ (not ¨o) Note that the order of letter and diacritic may differ

from what local systems expect (and from what is in exported records). Connexion’s editor and macros follow the Unicode standard.

Page 15: Macro-Enhancing  Connexion

More things to watch out for Connexion has no spaces between a MARC

tag & indicators and none between indicators & field contents.

However, CS.CursorPosition acts as if there were spaces there and also as if there were a space between the indicators.

OCLC recommends using CS.CursorColumn instead

245 1 4 The adventures of Tom Sawyer

24514The adventures of Tom Sawyer

Page 16: Macro-Enhancing  Connexion

Impossible in CatME but simple in Connexion

Recording macros Can be a good way to learn OML. Recorded macros may still need to be

edited. They tend to be inefficient and use many more

commands than are necessary. They may not work with all records.

Some tasks cannot be recorded.

Page 17: Macro-Enhancing  Connexion

Converting CatME macros to ConnexionWhen to simply translate?

Does the old macro use only commands that are similar in Connexion?

When to record a new version? Does the macro never depend upon the

content or status of the record? Does the macro only navigate to fields that

are always present, then insert new data? Do you want a template on which to build

the macro from scratch?

Page 18: Macro-Enhancing  Connexion

Converting CatME macros to ConnexionWhen to start from scratch?

Does the macro react to the content or status of the record?

Is the macro complex?

When not to convert at all? Is the macro still necessary, or could this

task be done instead… By an existing command? With constant data? With text strings?

Page 19: Macro-Enhancing  Connexion

Connexion macro tips & tricks Option Explicit

CS.IsOnline

CS.ItemType

When deleting several fields, work backwards

Page 20: Macro-Enhancing  Connexion

Connexion macro tips & tricks Iterate through all 6XX fields in a record:

bool = TRUE nTagNum = 0Do Until bool = FALSE nTagNum = nTagNum + 1 bool = CS.GetFieldLine( nTagNum, sField ) If Mid(sField, 2, 3) Like "6##" Then

'Put code that alters the record here. 'Use nTagNum for the field number in CS.* commands

ElseIf Mid(sField, 2, 3)) > 699 Then Exit Do End IfLoop

Page 21: Macro-Enhancing  Connexion

Connexion macro tips & tricks Iterate through all records in a list:

bool = CS.GetFirstItembNextRec = TRUEDo While bNextRec <> FALSE

'Put code that looks at or alters each item here

bool = CS.SaveOnline 'OR: bool = CS.SaveToLocalFile(FALSE,FALSE)

bNextRec = CS.GetNextItem If bNextRec = FALSE Then Exit DoLoopbool = CS.CloseRecord(TRUE)

Page 22: Macro-Enhancing  Connexion

Connexion macro tips & tricks Copy data directly into MS Office programs:

Dim CS As ObjectSet CS = CreateObject("Connex.Client")bool = CS.GetField("092", 1, sCall)bool = CS.GetField("245", 1, sTitle)

Dim XL as ObjectSet XL = CreateObject("Excel.Application")XL.Sheets("Sheet1").SelectXL.Range("A1").Value = "Call #"XL.Range("A2").Value = sCallXL.Range("B1").Value = "Title"XL.Range("B2").Value = sTitle

(Check the VBA help file in your version of Excel for the proper commands to use.)

Page 23: Macro-Enhancing  Connexion

Further resourcesOCLC-CAT mailing list

Archives are now available

OCLC’s 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

Joel’s OML web page http://users.rcn.com/aardy/oml/index.html

Harvey’s OML web page http://www.ahml.info/oml/

Page 24: Macro-Enhancing  Connexion

Questions, comments, etc.

To contact us after the live presentation:

Harvey Hahn <[email protected]>

Joel Hahn <[email protected]>