MVS Mail
MVS Mail
MVS Mail
Yes, this is Steve Bigwig here, did my extracts run last night??
Let me check. <click click>
Thanks
Next week..same exact phone call!!!
Introduction
Need to notify users when certain
Provide some kind of automated reporting ie..send data to someone on a regular basis
gap between you (the developer) and end users. The rest of the world uses email to notify people about things, why not you and your MVS-based FOCUS programs?
Presentation Agenda
How does it work?
1 - Dynamically create your NOTE CONTROL FILE or use one that you have already created. 2 - NOTE CONTROL file contains the secret handshake as well as your note body text. 3 - Send NOTE CONTROL file off to SMTP via IEBGENER.
SMTP allows for sending of email to any
Note Control file generated with FOCUS/Dialogue Manager (using -WRITE statements)
IEBGENER - copies sequential dataset from any device to any device. Input step in SYSUT1 - location of Note Control File Output step in SYSUT2 - passes control to SMTP program
Sample Scenario
Want to let Steve Bigwig know when his job
system time & date, and the # of records in a flat file. Also creates our NOTE CONTROL FILE.
Includes a utility I use for creating most of my email related && variables
This code would go AFTER data extract
-* TABLE FILE <whatever> SUM CNT.ACCOUNTS BY CODE -* -*EMLSAMP1: JONATHAN GIBBENS -*FOCEXEC ABOVE DOES EXTRACT FOR STEVE BIGWIG -* END -* ===================================================== -* SET THE SYSTEM TIME VARIABLE -* ===================================================== -SET &STIME = ' '; -SET &STIME = HHMMSS(&STIME); -* -* ===================================================== -* SET UP 3 BODY LINES FOR EMAIL MESSAGE -* DATE/TIME/RECORDS/LINES -* ===================================================== -SET &NEATDATE = EDIT(&YYMD,'9999/99/99'); -SET &BODY1 = ' YOUR EXTRACT RAN ON ' | &NEATDATE | ' AT ' | &STIME; -SET &BODY2 = ' THE NUMBER OF LINES IN YOUR EXTRACT WAS ' | &LINES; -SET &BODY3 = ' THE NUMBER OF RECORDS IN YOUR EXTRACT WAS '| &RECORDS; -* -* ===================================================== -* SET UP THE RECIPIENTS OF THE NOTE, AND THE SUBJECT -* ===================================================== -SET &RCPT1='JONATHAN.GIBBENS@SCHWAB.COM'; -SET &RCPT2='STEVEB@COMPANY.COM'; -SET &SUBJECT = 'FILE EXTRACTS FOR ' | &NEATDATE; -* -*
EMLSAMP1 Focexec
-*********************************************************** -* NOTE CONTROL FILE UTILITY -* JON GIBBENS - PROVISTA SOFTWARE INTL. - JON@PROVISTA.COM -* -* SET UP && VARIABLES FOR CREATION OF NOTE CONTROL FILE -* NOTE: ALL OF THESE -SETS COULD BE INSIDE OF AN INCLUDE -* FILE FOR CONVENIENCE AND CODE PORTABILITY -** -** INPUTS: -** &RCPT1-5 = UP TO FIVE VALID EMAIL ADDRESSES -** &SUBJECT = THE SUBJECT OF THE NOTE -** -** OUTPUTS: ESSENTIAL VARIABLES FOR AN EMAIL MESSAGE -** -** &HELOLINE = 'HELO HOST' - FIRST LINE OF EMAIL MESSAGE -** WHERE HOST IS THE MAIL SUBSYSTEM -** &RCPTLNE1='RCPT TO:<RPCT1>' FIRST RECIPIENT -** &RCPTLNE2='RCPT TO:<RPCT2>' 2ND RECIPIENT -** &RCPTLNE3='RCPT TO:<RPCT3>' 3RD "" -** &RCPTLNE4='RCPT TO:<RPCT4>' 4TH "" -** &RCPTLNE5='RCPT TO:<RPCT5>' 5TH "" -** &SUBLINE = 'SUBJECT: &SUBJECT' -** &TOEND = '>' - THE END OF THE 'TO' LINE -** &DATALINE = 'DATA' - PUT AFTER 'TO' LINE(s) -** &SUBBEG = 'SUBJECT:' - BEGINNING OF SUBJECT LINE -** &SIGLINE1='THANKS! HAVE A NICE DAY!' -** &BLANKLINE = ' ' - SPACES/BLANKS -************************************************************** -**DEFAULT THE ESSENTIAL ELEMENTS*************************************************************** -DEFAULTS &HELOLINE = 'HELO HOST' -DEFAULTS &TOBEG = 'RCPT TO:<' -DEFAULTS &TOEND = '>' -DEFAULTS &DATALINE = 'DATA' -DEFAULTS &SUBBEG = 'SUBJECT: ' -DEFAULTS &RCPT1=' ' -DEFAULTS &RCPT2=' ' -DEFAULTS &RCPT3=' ' -DEFAULTS &RCPT4=' ' -DEFAULTS &RCPT5=' ' -DEFAULTS &SUBJECT = ' ' -DEFAULTS &BLANKLINE = ' ' -RUN
EMLSAMP1 Focexec
-* -* ------------------------------------------------------------* SET UP THE RCPT TO: LINES - UP TO 5 PEOPLE CAN BE SENT THE EMAIL -* READ IN THE &RCPT1,&RCPT2,&RCPT3,&RCPT4,&RCPT5 VARIABLES -* OUTPUT IN THE FORMAT: RCPT TO:<EMAIL ADDRESS> -* ------------------------------------------------------------* -SET &RCPTLNE1 = &TOBEG || &RCPT1 || &TOEND; -SET &RCPTLNE2 = &TOBEG || &RCPT2 || &TOEND; -SET &RCPTLNE3 = &TOBEG || &RCPT3 || &TOEND; -SET &RCPTLNE4 = &TOBEG || &RCPT4 || &TOEND; -SET &RCPTLNE5 = &TOBEG || &RCPT5 || &TOEND; -* -* ------------------------------------------------------------* SET UP THE SUBJECT LINE - READ IN &SUBJECT; -* ------------------------------------------------------------* -SET &SUBLINE = 'SUBJECT: ' | &SUBJECT; ******************************************************************** -**INSTALLATION SPECIFIC VARIABLES -** &FROMLINE - EMAIL ADDRESS FOR THE SENDER (CAN BE ANY EMAIL -** ADDRESS) -** &SIGLINE1 - LINE TO END THE EMAIL ******************************************************************** -* -DEFAULTS &FROMLINE = 'MAIL FROM:<THEBIGMAINFRAME@COMPANY.COM>' -DEFAULTS &SIGLINE1 = 'THANKS! HAVE A NICE DAY!!' -DEFAULTS &SIGLINE2 = 'QUESTIONS/PROBLEMS? EMAIL TECHSUPPORT@COMPANY.COM' ******************************************************************** *** -* -* ---------------------------------------------------------------* WRITE OUT THE NOTE CONTROL FILE: NOTECNTL -* NOTE CONTROL FILE IS A FLAT FILE ALLOCATED AS MOD -* FOR SIMPLE NOTES, IT CAN BE FIXED FORMAT, 80 CHARACTERS, 27920 BLKS
- ---------------------------------------------------------------* -* ===================================================== -* WRITE OUT THE HELOLINE & THE FROM LINE -* ===================================================== -* -WRITE NOTECNTL &HELOLINE -WRITE NOTECNTL &FROMLINE -* -* ===================================================== -* WRITE OUT THE RECIPIENT(S) -* ===================================================== -* -WRITE NOTECNTL &RCPTLNE1 -WRITE NOTECNTL &RCPTLNE2 -* -* ===================================================== -* WRITE OUT THE DATA SEPERATOR & SUBJECT LINE -* ===================================================== -* -WRITE NOTECNTL &DATALINE -WRITE NOTECNTL &SUBLINE -* -* ===================================================== -* WRITE OUT THE BODY OF THE NOTE -* ===================================================== -* -WRITE NOTECNTL &BLANKLINE -WRITE NOTECNTL &BODY1 -WRITE NOTECNTL &BODY2 -WRITE NOTECNTL &BODY3 -WRITE NOTECNTL &BLANKLINE -WRITE NOTECNTL &SIGLINE1 -WRITE NOTECNTL &SIGLINE2 -* -* -* ========================================================= -* END OF JOB EMLSAMP1 -* =========================================================
27 1000
Advanced Usage
URLs - Exchange/Outlook or Netscape mail (other mail clients as well) will read any URLs you include in your note and will activate them
So, if you are doing Intranet type reporting, you can point users to where the reports are.
Can do fancier HTML formatting if include MIME tags and HTML code (example to follow)
Only really works if email client fully supports HTML, or at least, supports the features that YOU need.
WWW Resources
Daves MVS Mail Page http://users.ticnet.com/davea/mvs/mvsmail
Decoding Internet Attachments http://pages.prodigy.net/michael_santovec/decode.htm - To find out more about MIME tags, and different compatibility issues with different email clients
Questions?