There are many requirements to send JES2
job output to end users via email or FTP. These include:
- the need to notify one or more users via email when a critical job
or systems task fails.
- the need to provide detailed information about how a job failed.
- the convenience of sending batch output to a user via email.
- the need to send a copy of a job to a PC via FTP or email for archival.
IOF now provides a simple mechanism for using email to notify a user
of a job's completion and to optionally attach reports from the job. The
notification can be unconditional or dependent on the success or failure
of the job. You can also select reports to be emailed directly from IOF
The XMITIP Shareware Package developed by Lionel Dyck at Kaiser
Permanente, Walnut Creek, CA provides a simple z/OS interface to
email. XMITIP is a series of Rexx execs and is already installed on many z/OS sites.
It can be downloaded from the Internet at no charge.
The IOF SENDMAIL interface is a series of IOF Rexx execs that
interface IOF to XMITIP. SENDMAIL provides the ability to send
jobs, output groups or sysout data sets to a PC user via email. These execs are
included in the IOF 8D clist library and can be installed on earlier
releases with an optional fix. SENDMAIL is pre-installed on
The XMITIP Package
Lionel Dyck, developer of XMITIP, describes it in the XMITIP Guide
Introduction as follows:
XMITIP is a mainframe based electronic mail application that
is capable of sending electronic mail to any valid Intranet or
Internet address. Along with messages, XMITIP can also send
mainframe files in one of several different file attachment formats.
The recipients can be on any mail system that connects to the
Internet (the world) or Intranet (in house). The Simple Mail
Transport Protocol, or SMTP, is used for sending the mail with data
sets attached using the appropriate SMTP statements. The name,
XMITIP, derives from the TSO TRANSMIT command, which has an alias of
XMIT, and from IP, which stands for Internet Protocol. Thus XMITIP
is TSO TRANSMIT using the Internet Protocol. XMITIP can be executed
as a step within a batch job, under TSO as a command, or under ISPF
using a robust ISPF interface. It can also be used within an
automated operations tool to generate messages related to system
events. XMITIP can be used very effectively as a step within a batch
job to send a report generated by that job via electronic mail
rather than printing the report. With this approach the report will
arrive in the intended users electronic mail inbox within a few
minutes after the job completes. This is much faster than waiting
for the hours for the report to be printed, removed from the
printer, separated from the other reports that were printed at the
same time, and then delivered or placed in a mail box for pickup.
The user can then view the report online or print as their needs
dictate. Some of the features of XMITIP are:
send electronic mail to one or more
send a quick message as a page
send one or more data sets as file
attachments in one of the following formats: plain text, HTML,
Rich Text Format (RTF), Portable Document Format (PDF), Comma
Separated Value (CSV), TSO Transmit (XMIT), and binary
supports address lists
supports CC and BCC
supports Priority, Sensitivity, and
The ISPF interface:
field level help for all entry
validation of all entered fields
address table for lookup and
data set table for multiple data
set selection and formatting
reports the complete XMITIP command
option to create a file with a
complete Batch Job which can be submitted, browsed, edited, or
The ISPF interface is an excellent tool to use to model the
XMITIP usage and once it is working completely then the generated
command can be integrated into a batch job step or TSO application.
Included with the XMITIP package are several tools that can be used
to invoke XMITIP from other applications. These tools interface to
XMITIP from SDSF, from IOF, and from other ISPF applications. XMITIP
is written almost completely in z/OS REXX, with one z/OS Assembler
program that performs the MIME (Multipurpose Internet Mail Encoding)
used for PDF and Binary attachments. The ISPF interface is also
written in z/OS REXX using the z/OS ISPF APIs.
If the XMITIP package is already installed at this site, the rest
of this section can be skipped. If XMITIP is not installed, at least the basic parts must be installed before the IOF SENDMAIL
interface can be used to send job output via email. XMITIP is not
required to send output via FTP.
XMITIP can be ordered from Lionel Dyck's web page at:
This web site gives a good insight into the capabilities of XMITIP.
It also provides documentation and installation hints.
Note that XMITIP is a series of Rexx execs that interface to SMTP on
the z/OS site. See the IBM manuals for information on installing
SMTP if it is not already installed at your site.
The IOF email applications use only a small part of the XMITIP
package. In fact, IOF SENDMAIL uses only four Rexx execs provided in the XMITIP package. These execs
- XMITIP - The command used to send a message
- XMITIPCU - The XMITIP customization exec.
This exec must be
edited to specify local parameters and definitions
- XMITLDAP - The local LDAP customization exec.
This exec must be edited to specify local parameters if you chose
to use the LDAP interface.
- XMITIPZP - The exec called when the ZIP parameter is specified.
If you want to install only enough of XMITIP to support the IOF
mail applications, these three execs are all that you need. Lional Dyck has permitted us to re-distribute these execs
as an IOF optional fix so long as we give full credit to Lionel and
Kaiser Permanente for the XMITIP development. Because XMITIP is
continually improving and evolving, we encourage you to download the
official version from the web site shown above and to install and use
the full package.
IOF Optional fix T8x9059 adds the first three XMITIP execs listed above to your IOF
CLIST library. This fix should not be applied if you already run
XMITIP at your site. If you subsequently install the full XMITIP
package at your site, XMITIP, XMITIPCU and XMITLDAP should be
removed from the IOF CLIST library.
IOFSEND Batch Step
The IOFSEND cataloged procedure shown below runs the
IOFSNDME Rexx exec as a job step in batch TSO. It
notifies a user by email that a job has run and optionally attaches the job's output. The IOFSEND cataloged procedure should be added to PROCLIB to simplify running the IOFSNDME exec in batch TSO.
A sample cataloged procedure is shown below. The
procedure has 4 keyword parameters:
||Email SENDTO email address
||Optional FROM email address
|Attach just the IOF Job Summary
Add the jobs log, JCL and messages data sets to attachment
Add all of the jobs sysout data sets to attachment
||IOF data set name prefix for convenience in writing the
IOFSEND Cataloged Procedure
//IOFSEND PROC TO=,FROM=,DATA=,DSNDS='IOF.IOFT8C0'
//* Send current job results via email
//* Input parms are:
//* TO=Required SENDTO email address
//* FROM=Optional FROM email address
//* DATA= send just the IOF Job Summary
//* DATA=JESDS add LOG, JCL and MESSAGES data sets
//* DATA=ALL add all sysout data sets
//SEND EXEC PGM=IKJEFT1B,PARM='IOFSNDME &TO &DATA FROM &FROM'
//SYSTSPRT DD SYSOUT=* XMITIP diagnostic information goes here
//SYSPROC DD DISP=SHR,DSN=&DSNDS..CLIST
//SYSEXEC DD DISP=SHR,DSN=SYSTSI.XMITIP.EXEC xmitip exec library
//SYSHELP DD DISP=SHR,DSN=&DSNDS..HELP
//SYSTSIN DD DUMMY
If the XMITIP execs are included in the IOF CLIST library, the
SYSEXEC DD statement is not required .
Several examples of using IOFSEND with parameters are shown below.
The JCL shown is added as the last step of a JOB or STC.
Notify a user when a job runs even if the job abends.
The IOF Job Summary is included in the email attachment.
//NOTIFY EXEC IOFSEND,TOfirstname.lastname@example.org',COND=EVEN
Notify two users only if a job abends
and send a copy of the Log, JCL and Messages data sets
//ABNDNTFY EXEC IOFSEND,COND=ONLY,
Send a copy of the job to a user if any step has a non-zero
return code or abends and
Specify a FROM email address.
// IF (ABEND | RC > ) THEN
//SEND EXEC IOFSEND,
IOFSEND provides a valuable communication tool to internet
users when used with the JCL IF/THEN/ELSE statements or with the COND
parameter. Simple JCL additions can cause users to be notified via
email when a job runs, or just when it fails.
A copy of the IOF Job Summary Display for the job will be attached to
the email by default.
The Log, JCL and Messages data sets can be added to the attachment by specifying DATA=JESDS.
All sysout data sets can be added to the attachment by specifying
IOFSEND SYSIN Parameters
IOFSEND parameters can also be specified in the optional SYSIN
dataset. SYSIN parameters offer significant additional function:
- Allow FTP parameters to be specified
- Allow selection of specific sysout data sets
- Support for additional email parameters
- Allow output to be zipped
Click here to see detailed specifications of SYSIN parameters.
SENDMAIL IOF Command
The SENDMAIL IOF command is used to send a JOB, Output Group or
Sysout Data Set via XMITIP from an interactive IOF session. SENDMAIL
is an ISPF application that prompts for SENDTO, CC, BCC and FROM
addresses. SENDMAIL is both a primary command and a line command
on the Job List Menu, Output Group Display, and IOF Job Summary. For simplicity, SENDMAIL is the only IOF command used
on each of these panels. SENDMAIL can be abbreviated "SEN".
SENDMAIL Option Menu
The SENDMAIL Option Menu is used to enter addresses and other
parameters used by the SENDMAIL command. This option menu is
displayed whenever the SENDMAIL command is entered.
------------------- Send Output via XMITIP Options ----------------------
NOPROMPT Disable this panel for the duration of this IOF session
(Email information below will be used for all jobs)
Enter email addresses below where the job(s) should be sent.
Enter the PC file name below or leave blank to have the default
file name of JOB/GRP/FILE.jobname.jobid.day.time
name ===> JOB.M18NEWOP.J716695.email@example.com
The TO address must be specified. CC, BCC and
FROM fields are optional. When FROM is not specified, the TSO
userid and default XMITIP server name are used as the FROM email
The default file name under which the output will be saved on the PC
is displayed and can be changed on this menu. Jobs and groups are
typically saved as an HTML file, and sysout data sets are saved as a
TEXT file by default.
Job List Menu and Output Group Display
SENDMAIL can be used as both a primary command and a line command on
the Job List Menu and Output Group Display.
The SENDMAIL command used as a primary command on the Job List
Menu or Output Group Display displays the Send Output via
XMITIP Options. The sole reason for this command is to allow
addressing information to be specified once for a list of jobs or
The SENDMAIL line command on the Job List Menu or Output
Group Display causes the whole job or group to be packaged as HTML
and sent via email. The
Send Output via XMITIP Email Options panel will be displayed to get
addressing parameters unless prompting was previously disabled for the
IOF session. The IOF Job Summary for the job, and all the
sysout data sets of the job are attached to the email. When the
attachment is browsed by a web browser, the Job Summary data set
section provides browser links to each sysout data set.
SENDMAIL can be used as both a primary command and a line command on
the IOF Job Summary.
When SENDMAIL is used as a primary command on the Job Summary,
the whole job is packaged and sent via XMITIP. The Send Output
via XMITIP Options menu is always displayed. However, sysout data sets that are
excluded from the Job Summary with the EXCLUDE command are
not included in the email. Otherwise, the SENDMAIL primary command
on Job Summary has the identical output as that produced by
the SENDMAIL line command on the Job List Menu.
The SENDMAIL line command on the IOF Job Summary causes the sysout
data set to be sent via email. The Send Output via XMITIP
Options menu is always
displayed. The default PC file type is TEXT although this can be
overtyped on the Option Menu.
IOFSNDME and the SENDMAIL command produce very similar email formats.
The SUBJECT line describes the output that is included in the mail.
The message text provides slightly more information about the job, group
or sysout data set. A copy of the IOF Job Summary Panel
and optionally sysout data sets are attached to the email.
The email client user is notified that a job has completed
without opening the email. More detail can be seen by opening the
mail. Finally, the full IOF Job Summary panel can be
displayed to tell more about how the job ran by selecting and/or saving
A typical Outlook panel displaying jobs is shown below. Note
that the SUBJECT line shows the jobname, where it ran, and the job
result. Result of 0 means that all job steps ran with return code
0. Result "*" means that at least one jobstep did not run.
System and user abends are displayed as Sccc and Ucccc. The
message for the first job, which had user abend 333, is shown below
with additional information.