Re: MARC21 record to CIP block

[email protected] (Bryan Baldus)
Newsgroups perl.perl4lib
Message-ID <a06110400c0e003eedc85@[4.254.84.215]>
At 4:22 PM -0700 7/13/06, [email protected] wrote:
>Hi there,
>
>However, can anyone here tell me of any tool or tutorialof how to
>create a CIP block out of a MARC 21 record?

I have posted a module, MARC::PCIPmaker.pm to:
<http://home.inwave.com/eija/inprocess/>. It should work to produce 
an ISBD/PCIP-block display from a raw MARC record (even one coded as 
full-level, though it is designed for CIP-level records). The code is 
based on a straight translation of code, originally in Visual Basic 
(with which I am rather unfamiliar, so the translation may be less 
than perfect), from the Library of Congress' CIP program.

The module is available in tar.gz or directly (with txt extension 
added for download/viewing on Web), but I haven't had a chance to 
create the necessary installation files, so it will need to be 
manually added to the same folder/directory as MARC::Record to be 
used.

Synopsis:

#open MARC file, get MARC::Record/MARC::Batch object
#$PCIPrecord = $batch->next in while loop, as generally constructed 
for most other MARC reading Perl programs

#convert MARC::Record into raw MARC (ISO 2709) format string
my $record_as_marc = $PCIPrecord->as_usmarc();

my ($PCIPblock, @errorsinPCIP) = MARC::PCIPmaker::makecard($record_as_marc);

if (@errorsinPCIP) {
     print "The following errors were found in generating the PCIP 
block\n", join "\n", @errorsinPCIP, "\n";
} #if errors
else {
     print OUT $PCIPblock;
}#else no errors

################################

I hope this helps. Please let me know of any problems or suggestions.

Bryan Baldus
[email protected]
http://home.inwave.com/eija
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.