> -----Original Message-----
> From: IBM Mainframe Discussion List [mailto:ibm-m...@bama.ua.edu] On
> Behalf Of Steve Comstock
> Sent: Tuesday, March 17, 2009 9:47 AM
> To: IBM-MAIN@bama.ua.edu
> Subject: Re: FW: SYSOUT dynamic allocation in COBOL
> 
> Steve Comstock wrote:
> > Bill Klein wrote:
> >> I may be missing something, but if you know at compile-time (when
> you can
> >> set an environment variable) that you want the "output" to go to
> >> SYSOUT, why
> >> are you using "files" (with OPEN, WRITE, etc) and not just doing a
> >> DISPLAY
> >> statement?  Either that or call CEEMSG.
> >>
> >> I think those are "more normal" ways in COBOL to send output to
> SYSOUT.
> >>
> >> "David Speake" <david.spe...@bcbssc.com> wrote in message
> >> news:<listserv%200903152048381559.0...@bama.ua.edu>...
> >>> I have used dynamic allocation via the environmental variables in
> COBOL.
> >>> Thanks to Steve Comstock and others for getting me started.
> >>> But I see nothing about SYSOUT and it says a DSN is required.
> >>> My need is for a //X DD SYSOUT=(B,SMTP)
> >
> > Bill,
> >
> > He's not really sending things to a true SYSOUT file, but to an
> > email server. However, you could do such a thing by hardcoding
> > the DD name and opening the file, writing, then closing, and
> > then re-opening; each file should be sent separately.
> >
> > Just leave a single DD statement, //MAILOUT  DD  SYSOUT=(B,SMTP)
> > if you like. No need for dynamic allocation at all.
> >
> >
> > Don't have time to test right now. I will if I get a chance later.
> 
> 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.
> 

   Actually, I don't think you even need to close the file. The correct
"Incantation" in the header or trailer (I don't remember the specifics)
will allow multiple messages to multiple destinations. The gotcha is
that if you hit SMTP with a large multi* file, since its simple minded
and single threaded, a fair sized backlog can build up while it
processes your large file.

Dave Gibney
Information Technology Services
Washington State University

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

Reply via email to