Skip to content

Commit

Permalink
DEV-628 report of monographs with known renewal ending in ‘56
Browse files Browse the repository at this point in the history
- Add renNum and Stanford ODAT fields to narrow pub date.
  • Loading branch information
moseshll committed Jan 19, 2024
1 parent 7593832 commit d409379
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions bin/pdd_renewal_report.pl
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,18 @@ END

my $ref = $crms->SelectAll($sql);
my %seen;
print "HTID\trenDate\tCurrent rights\n";
print "HTID\trenDate\trenNum\tStanford ODAT\tCurrent rights\n";
foreach my $row (@$ref) {
my ($id, $json) = @$row;
next if $seen{$id};
my $data = $jsonxs->decode($json);
my $renDate = $data->{'renDate'};
my $renNum = $data->{'renNum'} || '';
my $odat = '';
if ($renNum) {
$sql = 'SELECT ODAT FROM stanford WHERE ID=?';
$odat = $crms->SimpleSqlGet($sql, $renNum);
}
# Narrow results down to year of interest.
# renDate as represented in Catalog of Copyright Entries is of the form D[D]mmmYY
# e.g., "4Nov52" or "31Mar59"
Expand All @@ -100,7 +106,7 @@ END
# Narrow results further to anything not pd or pdus.
my $rights = $crms->CurrentRightsString($id);
if ($rights !~ /^pd/) {
print "$id\t$renDate\t$rights\n";
print "$id\t$renDate\t$renNum\t$odat\t$rights\n";
$seen{$id} = 1;
}
}
Expand Down

0 comments on commit d409379

Please sign in to comment.