From d409379b9fe767420ef47d096dad38008e70fd6a Mon Sep 17 00:00:00 2001 From: Moses Hall Date: Fri, 19 Jan 2024 11:15:48 -0500 Subject: [PATCH] =?UTF-8?q?DEV-628=20report=20of=20monographs=20with=20kno?= =?UTF-8?q?wn=20renewal=20ending=20in=20=E2=80=9856=20-=20Add=20renNum=20a?= =?UTF-8?q?nd=20Stanford=20ODAT=20fields=20to=20narrow=20pub=20date.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/pdd_renewal_report.pl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/pdd_renewal_report.pl b/bin/pdd_renewal_report.pl index f6ba7221..306ccd07 100755 --- a/bin/pdd_renewal_report.pl +++ b/bin/pdd_renewal_report.pl @@ -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" @@ -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; } }