Sounds right to me, but in REXX, I've always just done the following:

"ALLOC FI(MAIL) SYSOUT(B) WRITER(SMTP) LRECL(80) RECFM(F)"

Then open, write to it, close it, and free it; repeat.

First Horizon Bank
Mainframe Technical Support

-----Original Message-----
From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> On Behalf Of 
Charles Mills
Sent: Friday, May 15, 2020 4:09 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Looking for clarification/guidance on SMTP DD FREE/SPIN

[External Email. Exercise caution when clicking links or opening attachments.]

I am designing a long-running Rexx program that will from time to time generate 
an e-mail via the SMTP server. The idea is to allocate a DD
SYSOUT=(B,SMTP) and write the SMTP commands to it. I've never done that before 
so I have some questions:

- Am I correct in my assumption that I will have to "spin" the dataset before 
the SMTP server will pick it up?
- Assuming Yes to the first question, am I correct (a.) that 
FREE=CLOSE,SPIN=UNALLOC on the DD will get the records over to SMTP on EXECIO 
(FINIS; but that (b.) at that point the DD "no longer exists" -- that I will 
get an error if I try to open it again? (Recall the program is "long-running" 
and needs to generate multiple e-mails "from time to time."
They need to go out more or less as created, not in a big batch later on.)
- Not a huge deal if so, I guess. I can use BPXWDYN to allocate my DD again and 
again rather than JCL. Anyone have any better ideas?

Thanks. Outside-the-above-box suggestions cheerfully considered. I'm pretty 
much set on Rexx, e-mails, and "long-running with multiple e-mails from time to 
time" but will consider other possibilities.

Charles

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to 
lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Confidentiality notice: 
This e-mail message, including any attachments, may contain legally privileged 
and/or confidential information. If you are not the intended recipient(s), or 
the employee or agent responsible for delivery of this message to the intended 
recipient(s), you are hereby notified that any dissemination, distribution, or 
copying of this e-mail message is strictly prohibited. If you have received 
this message in error, please immediately notify the sender and delete this 
e-mail message from your computer.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to