E-mailing a Report in PDF Format - mfx - 3.1

Syncsort™ MFX Programmers Guide

Product type
Software
Portfolio
Integrate
Product family
Syncsort™ Software
Product
Syncsort™ MFX > MFX
Version
3.1
Language
English
Content type
Programmer’s Guide
Product name
Syncsort™ MFX
Title
Syncsort™ MFX Programmers Guide
Copyright
2024
First publish date
2010
Last updated
2024-11-06
Published on
2024-11-06T17:38:26.716054

MFX’s output can be created as a PDF file and optionally sent as an e-mail attachment. In this example, there are two OUTFIL statements that each create a simple one-page report.

The OUTREC parameter of each OUTFIL reformats the input records to add spacing between fields and reformats a ZD field as a dollar amount. HEADER2 and TRAILER2 parameters add a page header and trailer with a date and total amount.

The first OUTFIL statement writes this report to the default SORTOUT DD statement SYSOUT output. The second OUTFIL statement writes the same report, but adds the OUTPUT parameter and EMAIL subparameter, directing it to the SORTOF1 DD statement, which defines an HFS file. The OUTPUT parameter requests creating the SORTOF1 file as a PDF file. (This is the default for OUTPUT.

Optionally, an HTML or RTF file could have been created.) OUTPUT also establishes a 144-point (2”) left margin, a background color of LIGHTGRAY, and different fonts and colors for the header (FONTH2), trailer (FONTT2), and detail lines (FONT). The EMAIL subparameter requests that an e-mail be sent to a named recipient (TO) and to a list of recipients defined in the EMAILDD DD statement (TODD), with the file sent as an e-mail attachment. FROM and SUBJECT are also defined for the e-mails.

The LINES parameter sets 38 lines per page, which is the proper number of report lines that will fit on a PDF page of the default LETTER page size when using a 12-point font and the default 36-point top and bottom margins.

On the following pages, the figure Figure 1 contains the JCL and control statements required to produce the generated PDF report in the figure PDF Report.

Figure 1. JCL and Required Control Statements

Figure 2. PDF Report