Operation support personnel are needed to monitor jobs for abends. They spent their days staring at the screen, refreshing the screen manually by pressing the Return key.
Even mainframe developers cannot escape this. When you are doing testing, you may be required to wait for a long-running job before you can initiate your own tests.
Fortunately there is a simple way to address this using the email service commonly available in the mainframe.
Since most companies are using TN3270 (with TCP/IP) to connect to the mainframe, the Simple Mail Transfer Protocol (SMTP) service is probably already active in your system. If not, you will need the help of your systems support group to enable it.
Getting started.
Setting up a JCL that sends email from the mainframe is easy. You can start with any copy step using mainframe utilities with repro capability. IEBGENER, IDCAMS, SAS, Fileaid, and Eztrieve are some of the many choices available.
My personal preference is SORT and the jobstep will be similar to the one below.
//SORT EXEC PGM=SORT,REGION=0M
//SYSOUT DD SYSOUT=*
//SORTMSG DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=your.email.dsn
//SORTOUT DD SYSOUT=(B,SMTP)
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(10,10),RLSE),DISP=(NEW,PASS)
//SYSIN DD *
SORT FIELDS=COPY
As you can see, it looks like any regular SORT job. The only noticeable difference is with the output (SORTOUT). Instead of a dataset, the output is being routed to the sysout that will be picked up by the SMTP later for processing.
There is another difference that is not apparent. The data found in the input (SORTIN) requires to follow a certain format. The simplest of which is shown below.
helo hostname
mail from: <youremail@address>
rcpt to: <receiver@address>
data
From: youremail@address
To: receiver@address
Subject: your subject
your body text
You need to update the items in italics. Most of these are familiar variables found in any other email except for the hostname. This variable refers to the JES node name for your system.
The items you need to think about are the subject and the body text. For abend monitoring, the common information included in the subject are the jobname, abending step and the return code. Depending upon the nature of the abend, you can include additional details in the body text of the email.
Beyond end-of-job notification.
What if you can do formatting?
How about adding some attachments?
These capabilities are available through Multipurpose Internet Mail Extensions (MIME). MIME is the standard for multi part, multimedia, and binary data in e-mails.
MIME is important as it opens the opportunity to create reports and sending them directly to the users. No more need for printing. Reports are sent on time. There is an added security as no other person has access to the reports except for the intended recipients.
Email standards discussion is another article in itself. If you want to learn more about this, I recommend reading this good article from Planet MVS.

0 comments:
Post a Comment