Steve,
There's just one fly in the ointment that I'd like to point out ...
If you create *one* file containing *multiple* email messages and send it to
SYSOUT=(B,SMTP) ... I mean, yes, it'll work, but it'll tie up the SMTP task
and cause performance problems if your SMTP task is busy with other emails,
too.
The SMTP task is a "single-minded" process. It performs only one action at a
time. 
While busy reading a file from SPOOL, SMTP will take this file apart and
store each email message that it contains on disk in 2 files (1 address book
and 1 message contents file). Only after all email messages contained in
this one SPOOL file are stored, will SMTP continue with its other duties,
such as listening on the network for incoming emails, or sending one of the
stored emails).

In my experience with a relatively busy M/F site posting hundreds of
individual emails per day (some of them time-critical pager event
notifications), liberally sprinkled with "mass-mails" (single SPOOL files
containing anywhere from 10 up to 3,000 email messages), I have to say that
SMTP performance was greatly improved once I broke those mass-mails into
individual SPOOL files containing only one email per file. A mass-mail SPOOL
file containing 3,000 emails took several hours to be read in and stored as
disk files on the busy M/F. Meanwhile, nothing else happened in SMTP ... not
a single stored email was sent, no emails were received, pager notifications
did not go out in a timely manner, Operators got calls from users, Operators
called me saying "SMTP is hung or worse, cancelled SMTP ... it was a mess.
With one email message per SPOOL file, SMTP could process the emails in the
way it was designed to do, in a round-robin fashion: read 1 email from SPOOL
and store it, send one or more stored emails, receive incoming emails and
store them, and so on.

Additional improvements could be realized when I stored those mass-mail
SPOOL files with a lower JES2 queue priority, thus allowing individual
emails to go right ahead, in and out of the system in a few minutes without
being delayed too much by the lower importance mass mail traffic.

I urge you to change your process and use BPXWDYN to dynamically allocate
and free one SPOOL file for each individual email message. Your SMTP mail
task and your user community will thank you for that (or at least you won't
have any complaints :-).

Regards,
Ulrich Krueger

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf
Of Steve Comstock
Sent: Tuesday, March 17, 2009 09:47
To: [email protected]
Subject: Re: FW: SYSOUT dynamic allocation in COBOL

Steve Comstock wrote:
<snipped>
OK. Today I took some time and tested it. Works like a champ; it
just wasn't clear on the original post that the intent was to go
to SMTP.

So I wrote some code that sends 10 records to each entry in
a table of email addresses. The essential logic is:

open mailout
write email header records
write 10 data records
   (get input data record,
    format
    write it out) - 10 times
write email trailer records
close mailout

repeat that in a loop for each email addressee you have.

No need for dynamic allocation. Happy to send the code to
anyone who requests it.

----------------------------------------------------------------------
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