1st post. Please forgive me if my question is offensively dimwitted.
I am receiving marc records from a vendor that appear to break a simple
script I cobbled together using MARC.pm. The error I get is:
Invalid record, leader size not numeric at C:\ereserves\munge.pl line 23.
It was working previously until the vendor upgraded their product and
now provide records with longer leaders. Now I get the above error.
Would you point me in the right direction for help?
Thanks,
Ed
The code is as follows:
#!/user/bin/perl
use MARC;
$x = new MARC;
$x->openmarc({file=>"mymarc.dat",'format'=>"usmarc"});
open(OUTFILE, ">export.dat");
close OUTFILE;
while($x->nextmarc(1)){
$x->deletemarc({field=>'856'});
$x->addfield({record=>'1',field=>"856",value=>[3=>"Some reserve
materials are online. Follow this link to see if your course materials
are available online.",u=>"http://www.lib.unc.edu/reserves/"]});
# @url = $x->getvalue({record=>'1',field=>'856',subfield=>'u'});
# print $url[0]."\n";
# @note = $x->getvalue({record=>'1',field=>'856',subfield=>'a'});
# print $note[0]."\n";
$x->output({file=>">>export.dat",'format'=>"usmarc"});
$x->deletemarc();
}
$x->closemarc();
The two sample records I am trying to edit are copied into mymarc.dat
using the following batch file and then I run munge.pl (Perhaps I'm
messing up the numeric value here?):
echo %date% %time% >> log.txt
copy *.mrc mymarc.dat /y >> log.txt
REM del *.mrc
REM munge.pl
They are:
00347nam 2200109z
4500001001000000008004100010100002000051245001300071538003500084856008500119949003300204000029406051101s2005
eng 1 aCortazar, Julio10aBlow-up. aMode of Access: World
Wide
Web41aBlow-up.uhttp://eres.lib.unc.edu/eres/documentview.aspx?source=marc&docID=29406
cENGL047WdEnglish 47WeDoyne
and:
00352nam 2200109z
4500001001000000008004100010100002900051245001100080538003500091856008300126949003300209000029407051101s2005
eng 1 aDu Maurier, Daphne, Dame10aBirds. aMode of Access: World
Wide
Web41aBirds.uhttp://eres.lib.unc.edu/eres/documentview.aspx?source=marc&docID=29407
cENGL047WdEnglish 47WeDoyne