Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Last revision Both sides next revision | ||
phelp:helprunmg [2016/08/22 21:55] |
phelp:helprunmg [2021/12/29 16:21] 127.0.0.1 external edit |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | NAME | ||
+ | runMG - exe for launching TMQ's MARC Global in scriptable/ | ||
+ | |||
+ | RUNNING IN WINDOWS | ||
+ | The file runMG.exe must be installed in the MARC Report program folder. | ||
+ | From there, you may create a shortcut to the exe and relocate the shortcut | ||
+ | wherever you desire. Or, create a shortcut for a command prompt, and then | ||
+ | configure the shortcut to start in the MARC Report program folder. | ||
+ | |||
+ | SYNOPSIS | ||
+ | runmg | ||
+ | | ||
+ | runmg " | ||
+ | |||
+ | runmg " | ||
+ | |||
+ | runmg " | ||
+ | |||
+ | DESCRIPTION | ||
+ | A scriptable interfact to TMQ's MARC Global utility (available as an | ||
+ | add-on product to MARC Report). Records are read from the ' | ||
+ | file; the instructions in the ' | ||
+ | records are output to the ' | ||
+ | result of the processing are output to the ' | ||
+ | |||
+ | OPTIONS | ||
+ | When ' | ||
+ | is launched which makes it possible to enter the parameters using a form | ||
+ | and test them. | ||
+ | | ||
+ | In all other cases, runMG must be launched with parameters matching one | ||
+ | of the entries in the SYNOPSIS above. The parameter statement must begin | ||
+ | with | ||
+ | | ||
+ | " | ||
+ | |||
+ | ... and end with | ||
+ | | ||
+ | )" | ||
+ | | ||
+ | Each parameter, except the last, must be followed by the " | ||
+ | We recommend using fully-qualified pathnames for the parameters. | ||
+ | | ||
+ | CONFIGFILE | ||
+ | runMG gets its processing instructions from the ' | ||
+ | is an .xml file that must be created using the ' | ||
+ | MARC Global. | ||
+ | | ||
+ | In general, use the following procedure to create a configFile (for | ||
+ | details see the appropriate help files in MARC Global): start MARC | ||
+ | Global and setup the parameters for the job(s) that you want to run | ||
+ | in batch mode. Test the job, etc, then save it to your saved reviews. | ||
+ | Next, goto the ' | ||
+ | job(s) you want to run in batch mode to it. Exit the ' | ||
+ | select ' | ||
+ | ' | ||
+ | | ||
+ | LOG | ||
+ | runMG generates a summary each time it runs which contains essentially the | ||
+ | same | ||
+ | this log is ' | ||
+ | logfile will be written to the workingFolder. Thus, for the first example | ||
+ | below, this log would be named ' | ||
+ | | ||
+ | The name and location of this log can be changed in the fifth command-line | ||
+ | parameter (see the last example in the Synopsis), by giving a fully-qualified | ||
+ | filename that ends with the ' | ||
+ | does not end in ' | ||
+ | | ||
+ | Do not confuse the runMG log with the default MARC Global ' | ||
+ | and maintained for each MARC Global task. | ||
+ | | ||
+ | NOTES | ||
+ | When an an Autoreview is exported to xml, the program writes the default | ||
+ | ' | ||
+ | runs the Autoreview, taking care to avoid filename collisions at runtime; | ||
+ | however, when the autoreview is complete, runMG will rename the MARC | ||
+ | output files to the filenames specified in the command-line options. | ||
+ | | ||
+ | Even if there is only one job that you want to use in runMG, that job | ||
+ | must still be saved as an Autoreview in MARC Global before it is exported | ||
+ | to xml. | ||
+ | | ||
+ | When creating an Autoreview it will be helpful to remember that the name | ||
+ | you assign to the Autoreview in MARC Global becomes the name assigned to | ||
+ | the .xml file created by the Export option; which in turn becomes the | ||
+ | filename that must be used as the 4th parameter in the runMG options. | ||
+ | | ||
+ | MARC REVIEW | ||
+ | Also unlike MARC Global (and Autoreviews), | ||
+ | MARC Review job to runMG. This may be useful in batch processing, when at | ||
+ | some point you want to create two separate streams of records and apply | ||
+ | different processing to each. | ||
+ | | ||
+ | Once you have created and saved the necessary MARC Review job (assuming | ||
+ | it splits the MARC inputfile into two output files), follow these steps to | ||
+ | get it into runMG: start MARC Global (not MARC Review) and goto the | ||
+ | ' | ||
+ | (if this option does not appear there is an installation or registration | ||
+ | problem). Create a new Autoreview. Add the MARC Review to the Autoreview, | ||
+ | press Save, and exit the form. Proceed to export the Autoreview as above. | ||
+ | | ||
+ | When using this configFile in a runMG task, follow the parameter-options | ||
+ | format used to support two output files: | ||
+ | | ||
+ | runmg " | ||
+ | |||
+ | Note: if an Autoreview contains a MARC Review job, that must be the only | ||
+ | review present in the Autoreview (this makes sense if you think about it). | ||
+ | | ||
+ | EXAMPLES | ||
+ | | ||
+ | The simplest case: | ||
+ | |||
+ | runmg " | ||
+ | |||
+ | This job applies the Autoreview exported to 'add 001.xml' | ||
+ | uses MARC Global' | ||
+ | and writes the results to ' | ||
+ | |||
+ | A more interesting example: | ||
+ | |||
+ | runmg " | ||
+ | runmg " | ||
+ | mconcat --sourcefile=" | ||
+ | runmg " | ||
+ | |||
+ | The first step is a MARC Review task that splits the input file into two pieces | ||
+ | based on whether the XXX field matches a pattern. The second step applies a | ||
+ | fix-up autoreview to the records from the first job that did not match (and were | ||
+ | thus split to a separate file); this job splits any records that it could not | ||
+ | fix to a file called ' | ||
+ | to the main file (using a concatenation utility); finally, in step 4, a large | ||
+ | autoreview containing various tasks is applied to the re-joined records. | ||
+ | |||
+ | A .bat script for the above might look like this: | ||
+ | |||
+ | c: | ||
+ | cd " | ||
+ | runmg " | ||
+ | runmg " | ||
+ | mconcat --sourcefile=" | ||
+ | runmg " | ||
+ | d: | ||
+ | |||
+ | |||
+ | BUGS, LIMITATIONS, | ||
+ | |||
+ | Because of the default behavior used when assigning MARC Global output options, | ||
+ | preserving the ' | ||
+ | becomes problematic. Because of the internal processing performed by the program | ||
+ | to avoid using saved filenames (assuming that they will nearly always become | ||
+ | invalid over time), the only feasible workaround for this problem is to rename | ||
+ | the MARC Global log after each autoreview using the batch script; eg. | ||
+ | |||
+ | c: | ||
+ | cd " | ||
+ | |||
+ | runmg " | ||
+ | rename d: | ||
+ | |||
+ | runmg " | ||
+ | rename d: | ||
+ | | ||
+ | ... | ||
+ | |||