Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending an Email from a z/OS REXX 1

Status
Not open for further replies.

kevinf2349

Technical User
Sep 12, 2002
367
US
Hi

I have a need to send an email from a z/OS REXX EXEC. I have the USS environment set up and can happily send an email in batch (using PGM=AOPBATCH), however, when I call AOPBATCH in the REXX exec it is failing.

I feel sure I must be close to getting this puppy working but I just can't get that final bit working. The failure implies that -l is an invalid parm but I don't have '-l' coded. I do have 'sh -L' as a parameter list but that is definately upper case and works fine in batch.

Any ideas?
 
Can you post the error message and REXX code (or sample of)? You should be able to call almost anything in batch from a REXX.
 
Kiwi

Thats what I figured. I have got a working solution now using SMTP rather than AOPBATCH but I may tinker with AOPBATCH later. (I hate it when I can't get something working that should work!)

Watch this space
 
I am looking for a REXX sample to send an email from z/os using SMTP. Appreciate any help. Please send reply to g_c@usa.net .
 
Hi kevinf2349

please post the REXX source and the alloc in your USS Profile (STEPLIB)! You have set the STEPLIB in USS?

Gruss
 
This is the code snippet that we use for sending an email in a REXX exec using SMTP:

if QSMFID = "CPU5" then mailserver = "SMTPE"
address TSO "ALLOC FILE(SYSUT2) SYSOUT(J) WRITER("mailserver") REUS"
address TSO "ALLOC F(SYSUT1) DA('"dsname"') REUS SHR"
address TSO "ALLOC F(SYSIN) DUMMY reus"
address TSO "ALLOC F(SYSPRINT) DUMMY reus"
"CALL 'SYS1.LINKLIB(ICEGENER)'" /* could be IEBGENER if needed */
address TSO "FREE FI(SYSUT2)"
address TSO "FREE FI(SYSUT1)"

The "dsname" contains the following"

HELO SMPTE
MAIL FROM:<AutoOps_on_CPU5@anywhere.COM> RCPT TO: <first_dest@anywhere.com>
RCPT TO: <helpdesk@anywhere.com>
RCPT TO: <user@anywhere.comANICO.com>
DATA From:
To: user@anywhere.com
To: helpdesk@anywhere.com
To: first_dest@anywhere.com
Subject: Message issued on CPU
The body of the message goes in here

This all presupposes that the SMTP server name is SMTPE. Your site system programmer should be able to tell you what it is. Remember that SYSIN and SYSPRINT need to be reset too, if you use them for TSO that is. Either that or you could write a simple program for outputing the SMTP stream.

Hope this is useful.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top