change to the data directly automatically with mig env use
[migration-tools.git] / kmig.d / bin / mig-bibstats
index c115dd6..c2568bd 100755 (executable)
@@ -96,7 +96,7 @@ my @ilses = (
        ['Polaris','852','p'],
        ['TLC','949','g'],
        ['Koha','952','p'],
-       ['Sympony','999','i'],
+       ['Symphony','999','i'],
     ['Destiny','852','p']
 );
 
@@ -110,11 +110,14 @@ if ($p_holding_code) {
 
 #to do - add a check for exportbarcodes being in @ilses
 
-my $batch = MARC::Batch->new('USMARC', $file);
-$batch->strict_off();
 my $filetype = `file $file`;
-if ($filetype =~ m/MARC21/ or $p_ignore_filetype eq 'true') { print "$filetype.\n" }
-    else { abort("File is not MARC21."); }
+my $batch;
+if ($filetype =~ m/MARC21/) {
+    $batch = MARC::Batch->new( 'USMARC', $file );
+} else {
+    $batch = MARC::Batch->new( 'XML', $file );
+}
+$batch->strict_off();
 
 my $i = 0;
 my $uri_count = 0;
@@ -241,7 +244,10 @@ print "  $author_sub0 245 fields have a subfield 0\n";
 print "\n===== Holdings Analysis\n";
 foreach my $key (keys %holding_counts) {
        my $c = $holding_counts{$key};
-       if (((100/$i)*$c) >= $holding_threshold) { print "  $key $holding_counts{$key} holdings in $i bibs with $barcode_counts{$key} unique barcodes\n"; }
+       if (((100/$i)*$c) >= $holding_threshold) { 
+               if ($key ne 'Symphony') { print "  $key - $holding_counts{$key} holdings in $i bibs with $barcode_counts{$key} unique barcodes\n"; }
+               else { print "  $key - $holding_counts{$key} holdings in $i bibs with $barcode_counts{$key} unique barcodes - 999 FIELDS MUST BE MOVED WITH kmig prepbibs\n"; } 
+       }
 }
 
 print "\n===== URI values are domains and filtered to only show those with more than $uri_threshold\n";