NAME
MARC.pm
SYNOPSIS
@marc_array = &marc2array ($marc_record);
$marc_record = &array2marc (@marc_array);
$MARC::Base::REC_SEP (MARC Record Separator: 0x1d)
DESCRIPTION
MARC::Base.pm contains a set of utilities for encoding and decoding MARC format records.
A MARC record is simply an ASCII string of arbitrary length.
MARC record structure
Leader: start: 0 length: 24
Base Address (start of data): start: 12 length: 5
Directory: start: 24, length: (base - 24)
Tag number: 3 bytes
data length: 4 bytes
data offset: 5 bytes
Subfields begin with 0x1f
Fields end with 0x1e
Records end with 0x1d
Array element structure
The encoding/decoding routines make use of a simple array structure, where each array element contains the tag and data for a single MARC field, separated by a single space.
cols. 0-2 : tag number
col. 3 : blank
cols. 4-5 : indicators
cols. 6- : tag data
e.g.
245 10|aSome title|h[GMD]
The '|' character is used to represent MARC subfield separators (0x1f).
If it is desired to provide particular Leader codes, a template MARC record Leader can be provided using 'LDR' as Tag, e.g.
LDR 00000nas 2200000uu 4500
This will be replaced in the output record with a leader reflecting the correct record and directory lengths.
VERSION
Version 2.001 (1999-Mar-29)
The latest version of this script should be found at: http://www.library.adelaide.edu.au/~sthomas/scripts/
AUTHOR
Steve Thomas <sthomas@library.adelaide.edu.au>
LICENCE
Copyright (C) 1998,1999 Steve Thomas
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.