How sysout2pdf works
sysout2pdf is a z/OS UNIX shell script. sysout2pdf reformats a z/OS batch report as XML and then uses Apache FOP (an open-source tool) to output the report as PDF.
sysout2pdf performs the following steps:
- If requested (by the -fold option), splits the input file into multiple lines by inserting newline characters at regular intervals. This is only necessary if the batch report does not contain end-of-record delimiters (in which case, the resulting z/OS UNIX file consists of a single, and possibly very long, line).
- Replaces XML-significant characters (< > &) with references to the equivalent XML entities (lt gt amp).
- Unless the -nocc ("no carriage control") option was specified,
treats the first column of each line as a carriage-control character.
Converts some, ignores others (such as overstrike), and then removes
the first column. For example, replaces "new page" characters except
for the first with the XML tags:
This means "end the current section, and then start another."</section><section>
- Applies a filter, if specified (by the -filter option).
- Adds the following XML to the start of the file:
<?xml version="1.0"?>" <report><section>
- Adds the following XML to the end of the file:
</section></report>
- Calls FOP to transform the XML into XSL-FO (a particular type of XML) according to the XSLT stylesheet, and then convert the XSL-FO to PDF.
- If requested (by the -mailto option), sends an email containing the PDF.