Hey Sam, nice OPS REXX. However, I couldn't resist posting the NetView code to do the exact same thing. Mine is somewhat shorter I have to say, plus it only gets invoked once for the WTO or MLWTO where yours is actually getting invoked for each line of a MLWTO.

AT trap (3 lines):

IF MSGID = 'HZS' . THEN EXEC(CMD('AUTOMAIL [EMAIL PROTECTED]') ROUTE(ONE *));

The AUTOMAIL REXX code is straight from the sample comments at the top of the NetView distributed REXX EZLESSMT but I'm posting it here below for comparison.

/* START of AUTOMAIL Example...                                  @D2A*/

/*********************************************************************/

/* AUTOMAIL - This clist is called from the automation table to send */

/*            the message being automated to an email ID.            */

/*                                                                   */

/*            The email ID must be passed to this clist as the 1st   */

/*            argument.                                              */

/*                                                                   */

/* * Sample automation table statement                               */

/*                                                                   */

/* IF MSGID='xxxxxxx' THEN                                           */

/*    EXEC(CMD('AUTOMAIL [EMAIL PROTECTED]'));                   */

/*                                                                   */

/* * Where xxxxxxxx is the message to automate and to email          */

/* *       [EMAIL PROTECTED] is the email ID                     */

/*                                                                   */

/*                                                                   */

/*********************************************************************/

/*                                                                   */

parse arg email_id
/*                                                                   */

wvar.1="helo SMTP" wvar.2="mail from:<"opid()"@"cursys()">" wvar.3="rcpt to:<"email_id">" wvar.4="data" wvar.5="Date: "date('n')" "time()" LCL" wvar.6="From: "opid()" - NetView Domain "domain()" - "cursys() wvar.7="To: "email_id wvar.8="Subject: Automation E-Mail" wvar.9="This message has been sent to you from the NetView" wvar.10="automation table (please do not Reply to this e-mail):" wvar.11=" " wvar.0=11
/*                                                                   */

/* Append automation message into the email message                  */

'pipe safe * | stem wvar. append'
/*                                                                   */

/* Terminate Message Body with period                                */

'pipe lit /./ | stem wvar. append'
/*                                                                   */

/* Append SMTP QUIT command to stem                                  */

'pipe lit /QUIT/ | stem wvar. append'
/*                                                                   */

/* Create a SAFE from stem variable                                  */

'pipe stem wvar. | safe SMTPSAFE'
/*                                                                   */

/* Call EZLESSMT to send the Email                                   */

'EZLESSMT SMTPSAFE RTRNSAFE'
/*                                                                   */

/* Check return code, if not zero display message in RTRNSAFE        */

if rc <> 0 then 'pipe safe RTRNSAFE | collect | console'
/*                                                                   */

/* END OF AUTOMAIL Example....                                   @D2A*/


Knutson, Sam wrote:
This might be useful if you are trying to do automation on the Health
Checker for z/OS messages using CA-OPSMVS.

The cool little in-line routine #mlwto to do the gathering up of the
multiple lines was something Vic Michels built inspired from a more
complicated sample to perform a similar task.

At a minimum you would need to change the line that invokes the email
function (you would have to supply your own) to process the contents of
variable message.

The Health Checker is one of those things that should be on everyone's
to-do list.  The price is right.

Best Regards, Sam Knutson, GEICO Performance and Availability Management mailto:[EMAIL PROTECTED] (office) 301.986.3574 "Think big, act bold, start simple, grow fast..."
--
------------------------------------------------------------------------

Andrew McIntyre - Senior I/T Specialist - certified
zSeries Software Technical Sales
SMPO (Software Migration Project Office)
TMT (Tivoli Migration Team)
404-487-2477 or tie 546-2477
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>

------------------------------------------------------------------------

SMPO
 http://www.ibm.com/software/solutions/softwaremigration
NetView for z/OS
 http://www.ibm.com/tivoli/products/netview-zos/resources/nv390-update.html
System Automation for z/OS
 http://www.s390.ibm.com/sa

------------------------------------------------------------------------

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to