The second sample shows a page from a report created through HercPrt using the predefined job sepa-
rator control file for MVS 3.8J.

Figure 60: HercPrt Report Sample

6.3 PRTPUB (Mainframe Print Publishing Pprogram)

The mainframe print publishing program is written by Dan Nelson and can be obtained in the file section
of the Hercules-390 discussion group ( ).

6.3.1 Function

The mainframe print publishing program was designed to be used with Hercules' printing facilities. Her-
cules emulates line printers as simple text files containing printed output. This output can be viewed using
a text editor or some other mechanism (such as being served via a web server).

This PRTPUB program converts the raw printer output to a more readable form by replacing form feed
characters with line break lines, converting newlines to CR/LF pairs if desired (for Windows viewing), and
placing the result in a specified file.

Several facilities are provided to allow for publishing the printed output in an automated way (e.g. to a
web server) as follows.

1) You can choose to publish the output only if the input file size has changed since the last time the pro-
gram was run. The file size is stored in a file for comparison on each run and the program terminates with
return code 4 if the input file size has not changed since the last run. This allows efficient mirroring of the
printed output to a separate file on a schedule, only updating the target file if the source file has changed.
There is also an option that permits the polling for change to be carried out in this program, thus saving
the resources that would otherwise be used to launch the program, parse the options, and so forth on
each iteration.

2) You can choose to publish only the last part of the printed output. Hercules printer files tend to grow
and grow in size and users are typically only interested in the last part, printed most recently. An option
lets you specify the number of lines at the end of the file to publish to the target file, or lets you publish
only the new data since the last run.

3) Locking is provided under UNIX type operating systems. As a courtesy this program will acquire an ad-
visory read lock on the entire file before it starts processing. If the emulator uses an advisory write lock
then this program can be scheduled to publish the output asynchronously to the emulator producing that
output and the result will always be consistent.

4) If you want to publish the output as a web page without using a mechanism like server side includes,
this program provides the option of supplying HTML tags to wrap the output, although this facility is only
rudimentary. For sophisticated formatting server side includes are likely more appropriate to pull data into
a page but this facility may be useful for simple scenarios.

The program should be used in a batch file. It is possible to use it for a single call or to build a loop for
continuous processing (see examples below).

The possible return codes and their meaning are:

0 Translation was done.

4 Translation was skipped because the file size did not change.

8 Processing failed for an ordinary reason. An error message is sent to stderr indicating why.

16 Processing failed due to some abnormality. An abend code is given for diagnostic purposes. This
code will be the source line where the error occurred so you can use it with the source listing to
diagnose the cause of the failure.

Previous Page Next Page