[OPEN-ILS-DEV] Using marc_export to extract only a single library's holdings

Dan Scott dan at coffeecode.net
Fri Jun 15 09:27:53 EDT 2012


On Fri, Jun 15, 2012 at 12:28:44AM -0400, Ben Shum wrote:
> I'm not sure, but it seems like it may not be possible to use
> marc_export script to extract only a single library's holdings as
> associated to bib records.
> 
> Using an option for --library SHORTNAME definitely gives me the bib
> records with that library attached, but using the option for --items
> seems to drag in all holdings associated to that bib record and not
> just the one for the library specified.
> 
> Is it possible (or has anyone already modified marc_export) to
> include the capability of extracting only a single library's bibs
> and associated holdings if specified?

marc_export doesn't do it out of the box, but it is definitely possible
to modify to make it work that way.

Inside add_bib_holdings() in the loop where it issues the
$r->insert_grouped_field() call to add each copy, you can add
preliminary tests, e.g.:

next unless $orgs{$cn->owning_lib}->shortname eq 'BR1';
next unless $orgs{$cp->circ_lib}->shortname eq 'BR1';
next if $cp->opac_visible eq 'f';

... and the like, that would skip inserting copies unless they match the
desired criteria.

We could standardize those into flags for marc_export if there's
significant interest.


More information about the Open-ils-dev mailing list