Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEV-628 report of monographs with known renewal ending in ‘56 #128

Merged
merged 1 commit into from
Jan 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading