batchhow
DESCRIPTION
Cross-Platform Batch reports using WinBatchpresented at VUGM 2001TRANSCRIPT
![Page 1: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/1.jpg)
Cross-platform Batch Reports
Waldo Library
Western Michigan University
![Page 2: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/2.jpg)
Objectives
show an implementation of automated, cross-platform, hands-off report generation in the Voyager environment
provide you with the information to do this at your site
![Page 3: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/3.jpg)
Bonus!!!!!
Source code for
BLOB access and
a table+column schema listing
included in the handout.
![Page 4: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/4.jpg)
Brief Bio
![Page 5: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/5.jpg)
Brief Bio
Working at WMU for 16 years now
![Page 6: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/6.jpg)
Brief Bio
Working at WMU for 16 years now Initially spent many years on the VAX
![Page 7: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/7.jpg)
Brief Bio
Working at WMU for 16 years now Initially spent many years on the VAX Struggled for several years with the IBM
mainframe and NOTIS
![Page 8: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/8.jpg)
Brief Bio
Working at WMU for 16 years now Initially spent many years on the VAX Struggled for several years with the IBM
mainframe and NOTIS Supporting Voyager for close to 3 years
![Page 9: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/9.jpg)
Brief Bio
Working at WMU for 16 years now Initially spent many years on the VAX Struggled for several years with the IBM
mainframe and NOTIS Supporting Voyager for close to 3 years Picked up some Oracle, (PL/)SQL, Perl,
and Unix along the way
![Page 10: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/10.jpg)
Why We Did This
![Page 11: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/11.jpg)
Why We Did This
initially no access to Access with ODBC stuff; had no clue
![Page 12: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/12.jpg)
Why We Did This
initially no access to Access with ODBC stuff; had no clue
explored our Voyager Unix box, located SQL*PLUS
![Page 13: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/13.jpg)
Why We Did This
So we created reports - run them on the Voyager box, transfer to PC format and print in Word, etc...
![Page 14: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/14.jpg)
Why We Did This
So we created reports - library liked them - I got tired of:
![Page 15: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/15.jpg)
Why We Did This
So we created reports - library liked them - I got tired of: running reports ftping them formatting them printing them physically delivering them
![Page 16: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/16.jpg)
Cross-Platform Batch Reports
Overview of Process(Handout page 4)
Unix
![Page 17: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/17.jpg)
cron Cross-Platform Batch Reports
Overview of Process
Unix
![Page 18: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/18.jpg)
cron Cross-Platform Batch Reports
Overview of Process
Unix
Time/dateparameters in one crontabfile
![Page 19: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/19.jpg)
cron Cross-Platform Batch Reports
Overview of Process
Unix
Time/dateparameters in one crontabfile
script
![Page 20: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/20.jpg)
cron Cross-Platform Batch Reports
Overview of Process
Unix
Time/dateparameters in one crontabfile
script
SQL,PL/SQL,
Perl
![Page 21: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/21.jpg)
cron Cross-Platform Batch Reports
Overview of Process
Unix
Time/dateparameters in one crontabfile
script
SQL,PL/SQL,
Perl
report Onecron process
running
![Page 22: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/22.jpg)
cron Cross-Platform Batch Reports
Overview of Process
Unix
Time/dateparameters in one crontabfile
script
SQL,PL/SQL,
Perl
report Onecron process
running
Batch PC
![Page 23: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/23.jpg)
cron Cross-Platform Batch Reports
Overview of Process
Unix
Time/dateparameters in one crontabfile
script
SQL,PL/SQL,
Perl
report Onecron process
running
Batch PC
WinBatch
![Page 24: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/24.jpg)
cron Cross-Platform Batch Reports
Overview of Process
Unix
Time/dateparameters in one crontabfile
script
SQL,PL/SQL,
Perl
report Onecron process
running
Batch PC
WinBatch
script or .exe
![Page 25: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/25.jpg)
cron Cross-Platform Batch Reports
Overview of Process
Unix
Time/dateparameters in one crontabfile
script
SQL,PL/SQL,
Perl
report Onecron process
running
Batch PC
WinBatch
script or .exe
use ftp toget the report
pull itinto Word
formatthe report
![Page 26: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/26.jpg)
cron Cross-Platform Batch Reports
Overview of Process
Unix
Time/dateparameters in one crontabfile
script
SQL,PL/SQL,
Perl
report Onecron process
running
Batch PC
WinBatch
script or .exe
use ftp toget the report
pull itinto Word
formatthe report
time/date parameters stored in each script
![Page 27: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/27.jpg)
cron Cross-Platform Batch Reports
Overview of Process
Unix
Time/dateparameters in one crontabfile
script
SQL,PL/SQL,
Perl
report Onecron process
running
Batch PC
WinBatch
script or .exe
use ftp toget the report
pull itinto Word
formatthe report
time/date parameters stored in each script
copy report todestination
on LAN
![Page 28: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/28.jpg)
cron Cross-Platform Batch Reports
Overview of Process
Unix
Time/dateparameters in one crontabfile
script
SQL,PL/SQL,
Perl
report Onecron process
running
Batch PC
WinBatch
script or .exe
use ftp toget the report
pull itinto Word
formatthe report
time/date parameters stored in each script
copy report todestination
on LAN
print reportto location
![Page 29: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/29.jpg)
cron Cross-Platform Batch Reports
Overview of Process
Unix
Time/dateparameters in one crontabfile
script
SQL,PL/SQL,
Perl
report Onecron process
running
Batch PC
WinBatch
script or .exe
use ftp toget the report
pull itinto Word
formatthe report
time/date parameters stored in each script
copy report todestination
on LAN
print reportto location
Library AdministrationLibrary SystemsMedia ResourcesMono AcquisitionsSerials
![Page 30: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/30.jpg)
When to Choose SQL, PL/SQL, or Perl SQL
![Page 31: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/31.jpg)
When to Choose SQL, PL/SQL, or Perl SQL invoked from within SQL*PLUS
![Page 32: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/32.jpg)
When to Choose SQL, PL/SQL, or Perl SQL invoked from within SQL*PLUS sufficient for most reports
![Page 33: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/33.jpg)
When to Choose SQL, PL/SQL, or Perl SQL invoked from within SQL*PLUS sufficient for most reports easy control of page & line size, page
formatting
![Page 34: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/34.jpg)
When to Choose SQL, PL/SQL, or Perl SQL invoked from within SQL*PLUS sufficient for most reports easy control of page & line size, page
formatting takes control, does most of the work for
you
![Page 35: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/35.jpg)
When to Choose SQL, PL/SQL, or Perl SQL invoked from within SQL*PLUS sufficient for most reports easy control of page & line size, page
formatting takes control, does most of the work for
you output to screen or file
![Page 36: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/36.jpg)
When to Choose SQL, PL/SQL, or Perl SQL sample of code… (Handout page 5)
output snippet below
![Page 37: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/37.jpg)
When to Choose SQL, PL/SQL, or Perl identify what the report generates
![Page 38: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/38.jpg)
When to Choose SQL, PL/SQL, or Perl include Word format settings
![Page 39: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/39.jpg)
When to Choose SQL, PL/SQL, or Perl
define output columns
![Page 40: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/40.jpg)
When to Choose SQL, PL/SQL, or Perl
these two columns are for sorting only
![Page 41: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/41.jpg)
When to Choose SQL, PL/SQL, or Perl
The call to FISCYRSETUP creates a temporary table, for the durationof this report, that contains the name and start date for the current andprevious year. This is used in a number of reports to automaticallyreference fiscal year data.
![Page 42: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/42.jpg)
When to Choose SQL, PL/SQL, or Perl
Set up title and some report parameters.Want output in a file.
![Page 43: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/43.jpg)
When to Choose SQL, PL/SQL, or Perl
Run the query tocreate the report.Clean up when done.
![Page 44: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/44.jpg)
When to Choose SQL, PL/SQL, or Perl PL/SQL
![Page 45: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/45.jpg)
When to Choose SQL, PL/SQL, or Perl PL/SQL invoked from within SQL*PLUS, or
embedded in / combined with SQL
![Page 46: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/46.jpg)
When to Choose SQL, PL/SQL, or Perl PL/SQL invoked from within SQL*PLUS, or
embedded in / combined with SQL provides SQL capabilities with
programming language control added
![Page 47: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/47.jpg)
When to Choose SQL, PL/SQL, or Perl PL/SQL invoked from within SQL*PLUS, or
embedded in / combined with SQL provides SQL capabilities with
programming language control added functionality sort of in-between SQL and
Perl
![Page 48: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/48.jpg)
When to Choose SQL, PL/SQL, or Perl PL/SQL output to screen or to screen
![Page 49: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/49.jpg)
When to Choose SQL, PL/SQL, or Perl PL/SQL output to screen or to screen Oracle allows output to file, but the
Voyager installation does not enable this
![Page 50: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/50.jpg)
When to Choose SQL, PL/SQL, or Perl PL/SQL output to screen or to screen Oracle allows output to file, but the
Voyager installation does not enable this
size limited to 1 million bytes output
![Page 51: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/51.jpg)
When to Choose SQL, PL/SQL, or Perl PL/SQL output to screen or to screen Oracle allows output to file, but the
Voyager installation does not enable this
size limited to 1 million bytes output screen output can be captured to file
![Page 52: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/52.jpg)
When to Choose SQL, PL/SQL, or Perl PL/SQL sample of code… (Handout pages 6 & 7)
output snippet below
![Page 53: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/53.jpg)
When to Choose SQL, PL/SQL, or Perlstart off with some comments…
output limitation…
![Page 54: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/54.jpg)
When to Choose SQL, PL/SQL, or Perl
important reminder
![Page 55: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/55.jpg)
When to Choose SQL, PL/SQL, or Perl
note the order by
![Page 56: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/56.jpg)
When to Choose SQL, PL/SQL, or Perl
variables must be declared
![Page 57: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/57.jpg)
When to Choose SQL, PL/SQL, or Perl
fields from the table
![Page 58: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/58.jpg)
When to Choose SQL, PL/SQL, or Perl you have control of looping through results
![Page 59: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/59.jpg)
When to Choose SQL, PL/SQL, or Perl
What is a BLOB?
It stands for Binary Large Object. More simply put, it is a collection of bytes that can contain both printable and unprintable characters. This is how MARC data is stored under Voyager.
![Page 60: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/60.jpg)
When to Choose SQL, PL/SQL, or PerlThe BLOB can be stored in one or more sections:
BibID: 57 Seqnum: 1 Recseg: BLOB Part A
BibID: 57 Seqnum: 2 Recseg: BLOB Part B
![Page 61: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/61.jpg)
When to Choose SQL, PL/SQL, or PerlThe BLOB can be stored in one or more sections:
BibID: 57 Seqnum: 1 Recseg: BLOB Part A
BibID: 57 Seqnum: 2 Recseg: BLOB Part B
The BLOB is put together in
reverse order, because we can
depend on Seqnum #1 being
the last one that way.
![Page 62: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/62.jpg)
When to Choose SQL, PL/SQL, or Perl
get data from the header,then get each tag’s data as we loopthrough the directory structure
![Page 63: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/63.jpg)
When to Choose SQL, PL/SQL, or Perl
do some formatting...
![Page 64: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/64.jpg)
When to Choose SQL, PL/SQL, or Perl
print formatted tag data…
finish looping and end the program
![Page 65: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/65.jpg)
When to Choose SQL, PL/SQL, or Perl
Without the closing “/”, your PL/SQL codewill NOT run!
![Page 66: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/66.jpg)
When to Choose SQL, PL/SQL, or Perl Perl
![Page 67: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/67.jpg)
When to Choose SQL, PL/SQL, or Perl Perl invoked from the operating system (can be called from within SQL(*PLUS)
![Page 68: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/68.jpg)
When to Choose SQL, PL/SQL, or Perl Perl invoked from the operating system (can be called from within SQL(*PLUS) you have control over everything, which
means:
![Page 69: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/69.jpg)
When to Choose SQL, PL/SQL, or Perl Perl invoked from the operating system (can be called from within SQL(*PLUS) you have control over everything, which
means: relatively unlimited flexibility that you have to do ALL the work
![Page 70: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/70.jpg)
When to Choose SQL, PL/SQL, or Perl Perl invoked from the operating system (can be called from within SQL(*PLUS) you have control over everything, which
means: relatively unlimited flexibility that you have to do ALL the work output to screen or file
![Page 71: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/71.jpg)
When to Choose SQL, PL/SQL, or Perl Perl sample of code… (Handout pages 8 -10)
output snippet below
![Page 72: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/72.jpg)
When to Choose SQL, PL/SQL, or Perl
start off with some comments
![Page 73: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/73.jpg)
When to Choose SQL, PL/SQL, or Perl
You’ll need to have DBI and
DBD for Oracle set up on your Unix box.
![Page 74: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/74.jpg)
When to Choose SQL, PL/SQL, or Perl
set up some variables
![Page 75: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/75.jpg)
When to Choose SQL, PL/SQL, or Perl
need to be able to talk to the database
![Page 76: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/76.jpg)
When to Choose SQL, PL/SQL, or Perl
Get all the table names.
In my experience, I was unable to use the
reserved word “distinct” in the query.
Thus the extract code to dedupe the results.
![Page 77: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/77.jpg)
When to Choose SQL, PL/SQL, or Perl
need to know how many
columns per table to aid
in output formatting
![Page 78: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/78.jpg)
When to Choose SQL, PL/SQL, or Perl
set up and initiate output
![Page 79: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/79.jpg)
When to Choose SQL, PL/SQL, or Perl
get the report’s data
![Page 80: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/80.jpg)
When to Choose SQL, PL/SQL, or Perl
keep track of column names ending in “_id”
![Page 81: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/81.jpg)
When to Choose SQL, PL/SQL, or Perl
go through array, output columns
ending in “_id” first
![Page 82: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/82.jpg)
When to Choose SQL, PL/SQL, or Perl
go through array, output columns
ending in “_id” first
Remember counting columns per table?
Here we advance to the next page,
if the table doesn’t fit on the current page.
![Page 83: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/83.jpg)
When to Choose SQL, PL/SQL, or Perl
then repeat this process for columns
that do not end in “_id”
![Page 84: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/84.jpg)
When to Choose SQL, PL/SQL, or Perl
if not enough room for smallest
possible table, go to next page
![Page 85: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/85.jpg)
When to Choose SQL, PL/SQL, or Perl
clean up when done
![Page 86: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/86.jpg)
The Batch PC
![Page 87: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/87.jpg)
The Batch PC
Should be dedicated to this task
![Page 88: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/88.jpg)
The Batch PC
Should be dedicated to this task configuration...
![Page 89: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/89.jpg)
The Batch PC
Hardware
![Page 90: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/90.jpg)
The Batch PC
Hardware older pc will be adequate
![Page 91: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/91.jpg)
The Batch PC
Hardware older pc will be adequate we’re using a 133MHz Pentium
![Page 92: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/92.jpg)
The Batch PC
Hardware older pc will be adequate we’re using a 133MHz Pentium 32 meg RAM
![Page 93: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/93.jpg)
The Batch PC
Hardware older pc will be adequate we’re using a 133MHz Pentium 32 meg RAM 1.5 gig hard disk, which is way more
than necessary
![Page 94: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/94.jpg)
The Batch PC
Software
![Page 95: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/95.jpg)
The Batch PC
Software running Windows 95
![Page 96: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/96.jpg)
The Batch PC
Software running Windows 95 WinBatch software (see www.windowware.com)
![Page 97: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/97.jpg)
The Batch PC
Software running Windows 95 WinBatch software (see www.windowware.com) the scripts that you write...
![Page 98: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/98.jpg)
The Batch PC
The Batch Software
![Page 99: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/99.jpg)
The Batch PC
The Batch Software WinBatch installation will leave it
running in the background
![Page 100: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/100.jpg)
The Batch PC
The Batch Software WinBatch installation will leave it
running in the background in Windows Explorer, double click on
your WinBatch script, identified as a .WBT file
![Page 101: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/101.jpg)
The Batch PC
The Batch Software WinBatch installation will leave it running
in the background in Windows Explorer, double click on
your WinBatch script, identified as a .WBT file
it will either run right away, or appear on the task bar, awaiting its time
![Page 102: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/102.jpg)
Quick
Process
Review
![Page 103: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/103.jpg)
cronCross-Platform Batch Reports
Overview of Process
Unix
Time/dateparameters in one crontabfile
script
SQL,PL/SQL,
Perl
report Onecron process
running
Batch PC
WinBatch
script or .exe
use ftp toget the report
pull itinto Word
formatthe report
time/date parameters stored in each script
copy report todestination
on LAN
print reportto location
Library AdministrationLibrary SystemsMedia ResourcesMono AcquisitionsSerials
![Page 104: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/104.jpg)
The Batch PC
The Batch Software FINALLY, a script! (Handout pages 11 & 12)
![Page 105: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/105.jpg)
The Batch PC
start off with comments,
including instructions on
when the script can be started safely
to avoid duplication of report printing
![Page 106: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/106.jpg)
The Batch PC
set up paths and filenames on the Unix box
and the batch PC,
get the database password from a file
![Page 107: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/107.jpg)
The Batch PC
determine if it’s time for the script to run
![Page 108: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/108.jpg)
The Batch PC
Encapsulating the ftp process in a WinBatch
script file works well.
Use the DOS ftp program supplied with Windows.
![Page 109: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/109.jpg)
The Batch PCwait a minute for ftp to complete
![Page 110: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/110.jpg)
The Batch PCmake sure file exists, then launch Word with it
![Page 111: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/111.jpg)
The Batch PCsend formatting keystrokes to Word
![Page 112: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/112.jpg)
The Batch PCGet the printer pull-down menu,
select the desired printer,
and print.
Wait a minute for printing to
complete before closing Word.
![Page 113: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/113.jpg)
The Batch PC
The rest of the code closes loops and makes the script wait
until the next run time occurs.
![Page 114: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/114.jpg)
Example from another scriptillustrating how to trigger on
day of the week.
This script runs early in the morning,
six days a week.
![Page 115: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/115.jpg)
The Batch PC
The Batch Software Some final hints
![Page 116: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/116.jpg)
The Batch PC
The Batch Software Some final hints WinBatch appears to get application
Windows confused, despite referring to them by name in the scripts
![Page 117: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/117.jpg)
The Batch PC
The Batch Software Some final hints WinBatch appears to get application
Windows confused, despite referring to them by name in the scripts
set up trigger and run times so that they do not overlap
![Page 118: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/118.jpg)
The Batch PC
The Batch Software Some final hints long lines in your scripts: don’t break them up! WinBatch expects them to remain contiguous!
![Page 120: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/120.jpg)
Better Call Number Sorting
Roll your own!
![Page 121: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/121.jpg)
What Voyager gives us…
![Page 122: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/122.jpg)
We can achieve better results…
this is now our input
correctly sorted
![Page 123: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/123.jpg)
Better Call Number Sorting
originally written in SAS back in our NOTIS days
![Page 124: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/124.jpg)
Better Call Number Sorting
originally written in SAS back in our NOTIS days
ported to Perl for use with Voyager
![Page 125: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/125.jpg)
Better Call Number Sorting
originally written in SAS back in our NOTIS days
ported to Perl for use with Voyager with NOTIS, could only sort on whole
call number field, with expected atrocious results
![Page 126: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/126.jpg)
Better Call Number Sorting
originally written in SAS back in our NOTIS days
ported to Perl for use with Voyager with NOTIS, could only sort on whole call
number field, with expected atrocious results Voyager provides normalized call number,
which allows for better than 80% correct sorting
![Page 127: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/127.jpg)
Better Call Number Sorting
with intelligent parsing applied to the call number, we can achieve about 99% correct sorting
implemented it as a Perl module put use Sort::CallNumber; at the
beginning of your Perl code
![Page 128: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/128.jpg)
Better Call Number Sorting
one call returns the call number chunks: @cnparts = cnparse($callnum); then sort on the cnparts
![Page 129: Batchhow](https://reader036.vdocuments.us/reader036/viewer/2022062513/554f38d4b4c905cd048b4f19/html5/thumbnails/129.jpg)
Thanks for listening.
Contact me if you want to receivethe CallNumber Perl module.
Questions?
Email: [email protected]
Phone: 616.387.3885