
As part of our discovery and reading list projects, I’ve had to get even more familiar with Z39.50* as a method of retrieving MARC records from our Horizon catalogue.
(*I can hear the groans even now.)
I had been using the Library of Congress’s Z39.50 test search form along with (Basedow Information Systems’) Mercury client software to test our Z setup, but I was beginning to find that we needed more flexibility. Enter YAZ, a “programmers’ toolkit supporting the development of Z39.50/SRW/SRU clients and servers”.
YAZ comes with a(n initially scary but actually very useful) command-line client for dialling up databases over Z39.50, querying them, and displaying the results retrieved. Here are my notes on how to use it with our own catalogue.
open tcp:www.library.lincoln.ac.uk:210/lincoln
- Opens a connection to our catalogue’s Z server.
format 1.2.840.10003.5.102
- Chooses the record syntax format. This is the record syntax object identifier for “OPAC format“, which returns our item holdings alongside the bibliographic data. Other valid format syntax supported by Horizon are Marc21, UniMarc, XML, and SUTRS. (Link: more information on Z39.50 record syntaxes.)
find @attr 1=1016 “<search_phrase>“
- Searches the catalogue for <search_phrase> using attribute code number 1016 (“Any”), which is paired with our HiP keyword index .GW (General Keyword). Here’s a list of some Z39.50 attribute codes, and the University of Lincoln HiP indexes which which they correspond (N.B. we can tweak these using HiP admin):
- 4 (Title) = .TW (Title Keyword)
- 7 (ISBN) = ISBNEX (ISBN/ISSN Exact Match)
- 8 (ISSN) = ISBNEX (ISBN/ISSN Exact Match)
- 12 (Local number) = .BI (Bib#)
- 27 (LC subject heading) = .SW (Subject Keyword)
- 1003 (Author) = .AW (Author Keyword)
- 1016 (Any) = .GW (General Keyword)
Boolean searches can be constructed by using @and, @or, etc. For example:
find @and @attr 1=4 “newspapers” @attr 1=1003 “Keeble”
~~~~~~~~~~
show
- This displays the first record matching the most recent ‘find’ command. Repeating ‘show’ returns each subsequent record in turn.
close
- Closes the connection to the Z server.
Couple of final links:
- Instructions on using the YAZ client, including a full list of commands and switches
- PHP/YAZ client library, which I suspect is going to come in handy…

