Table of Contents

mrbatch.exe

mrbatch.exe is a commandline module for MARC Report's Batch Mode report engine.

This module was added in MARC Report version 238.

Setup requirements

The executable, mrbatch.exe, must be installed in the MARC Report installation directory (usually “C:\Program Files (x86)\TMQ\MARC Report\”)

Parameters

Parameters are to be given on the command line.

All param names begin with “–”; all param values should be enclosed in doublequotes.

The complete parameter list is shown in the following screenshot:

marc specifies the file path of the MARC21 file to be checked for errors.

work specifies a write-able folder where the program will output the report.

rept specifies the filename of the report being produced.

ini specifies the file path of a MARC Report profile. The program will read this .ini to determine the options to be used when running the batch mode task, checking for errors, etc.

The simplest possible command needed to run mrbatch.exe would be:

"C:\Program Files (x86)\TMQ\MARC Report\mrbatch" --marc="d:\marc\daily.mrc" 

Parameter Notes

If the work folder is specified, and the rept param is omitted, a report filename will be automatically generated in the working folder.

If a rept name is specified and includes a path, the work param may be omitted.

If the ini param is omitted, the program will attempt to automatically discover the user's “\documents\MarcReport” folder and load the marcreport.ini that it finds there. If this autodiscovery fails, you must specify an ini file on the commandline.

When mrbatch runs, it displays the MARC Report batch mode progress form used by the Windows version. The user may press the Cancel button to stop the job1). When the batch run is complete, the progress form automatically closes. At present, there is no parameter available to suppress the display of the progress form.

If not specified on the command-line, the program automatically generates a filename for the report by appending a datestamp to 'marcrept':

marcrept-110214.txt

If the report filename that is automatically generated already exists, a sequence number will be added, as follows:

marcrept-210214(1).txt
marcrept-210214(2).txt

If, on the other hand, a rept param is given on the commandline, and the specified file already exists, it will be overwritten.

Scripting

The benefit of using mrbatch is of course to automate the error checking performed by MARC Report.

For example, you want to run batch mode every week on all new files that you receive, but each file will need a different MARC Report profile in order to produce the precise error report that you want.

First, use the MARC Report interface to setup the different option profiles.
Given files from three different sources, name the profiles accordingly: sourceABC.ini, sourceDEF.ini, sourceXYZ.ini.

Once you have designed the profiles, you will be able to review the associated marc files for errors using a script, perhaps like this:

set mrbatch=C:\Program Files (x86)\TMQ\MARC Report\mrbatch.exe
set mrhome=C:\users\richard\documents\MarcReport\
set inidir=%mrhome%\profiles\
set reptdir=%mrhome%reports\
set marcdir=D:\marc\new\week18\
"%mrbatch%" --marc="%marcdir%ABC.mrc" --ini="%inidir%sourceABC.ini" --rept="%reptdir%ABC.txt"
"%mrbatch%" --marc="%marcdir%DEF.mrc" --ini="%inidir%sourceDEF.ini" --rept="%reptdir%DEF.txt"
"%mrbatch%" --marc="%marcdir%XYZ.mrc" --ini="%inidir%sourceXYZ.ini" --rept="%reptdir%XYZ.txt"

When the script is complete, if all went well, there should be three reports waiting for you in the reptdir folder.

If one of the specified MARC files is not present, that command will be skipped and the script will move on to the next one.

Here is a list of options in marcreport.ini that might be useful in a batchmode run.

MARC Report Version

In most cases, mrbatch should be able to follow MARC Report version updates without itself being updated.

This is because all of the options used by our error-checking engine are located either in the MARC Report installation folder, or the user's MARC Report options folder.

It is possible that future updates to MARC Report might break this compatibility. In that case, a quick recompile of mrbatch should resolve the problem.

1)
Note that pressing <Ctrl-C> has no effect once the progress from is displayed