IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Email utility in PL/I


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Suja K

New User


Joined: 03 Mar 2008
Posts: 16
Location: Hyderabad

PostPosted: Thu Nov 13, 2008 9:07 am
Reply with quote

Hi,
I want to know whether there is any utility in Pl/I using which we can send email. The requirement is as follows.

There is a PL/I program from which a mass number of mails has to be sent to different persons. I know we can use JCL for that. But in order to avoid overheads and increase performance, i would like to use some utility in PL/I itself so that we can call from the program itself instead of passing it to a JCL. Is there anything like that. Could anyone please advise me on this concern?

-----------------------
Thanks in advance,
Suja
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Nov 13, 2008 9:17 am
Reply with quote

Hello,

Quote:
But in order to avoid overheads and increase performance,
What overhead would you believe you could avoid? Which performance might you increase?

Quote:
mass number of mails
What is considered thus?

Before embarking on a plan that "floods" the system, you should talk with the people who support the sending of e-mail from your mianframe.

You will most likely want to create the jcl and run the batch jobs (there are multiple examples posted in the forum).
Back to top
View user's profile Send private message
Suja K

New User


Joined: 03 Mar 2008
Posts: 16
Location: Hyderabad

PostPosted: Thu Nov 13, 2008 9:24 am
Reply with quote

Instead of doing it using JCL I want to do it with PL/I itself. I want to know if there is a way out.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Nov 13, 2008 9:46 am
Reply with quote

Hello,

Are you at all familiar wth sending an e-mail from the mainframe? It may help if you look at some of the examples already posted in the forum. Notice that there is no e-mail utility - most just use IEBGENER and copy the e-mail control statements to some DD.

The following is what causes e-mail to be "sent" on many mainframes. What is written to this dd is up to the developer (it may or may not be sysut2 and the "b" class is site-determined)
Code:
//SYSUT2 DD SYSOUT=(B,SMTP)


Unless you plan on replacing jes functionality with your own code, you will use a dd similar to that one.

Quote:
I want to know if there is a way out
I still do not understand what you want a way out of. . . icon_confused.gif
Back to top
View user's profile Send private message
Suja K

New User


Joined: 03 Mar 2008
Posts: 16
Location: Hyderabad

PostPosted: Thu Nov 13, 2008 10:01 am
Reply with quote

We need to run a batch job sending emails to different users and the id of these users are obtained after a db2 call in the PL/I - DB2 program. It will be as if statements in a loop will be performed n number of times and for each time a db2 call is performed and we need to sent mail to the id/s got from the call. For that if we are using JCL, will we have to call the JCL from the Pl/I porgram n number of times itself? Or is there any method for facilitating that?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Nov 13, 2008 10:30 am
Reply with quote

Hello,

Quote:
will we have to call the JCL from the Pl/I porgram n number of times itself?
JCL is not "called" from a program pl/i, cobol, or otherwise. To do what you want to do, you could code your program so that for each db2 iteration you would create a collection that consisted of the JCL, the control info and the list of recipients , it would write a JOB statement, an EXEC, and whatever DD statements followed by the necessary e-mail control statements thru the internal reader (if you are not familiar with the internal reader, there are multiple topics in the forum).

Each of these collections would be a separate job. When these internal reader jobs execute, they will be just like the ones shown in the forum and will send the e-mail.

As i mentioned earlier, i'd strongly recommend that you talk with the people responsible for e-mail to make sure that this volume does not cause system problems.

For initial testing, i's suggest doing a test on a very small scale - sending an e-mail to yourself. Once you have the basics working, expand the main code to handle a "real" iteration. Until this is comfortable, you might submit jobs on HOLD and release them iindividually - might be ugly of some loop went awry and 10,000 jobs were submitted icon_wink.gif

While you are testing, post any questions or problems here and we will be able to help.

To review: the pl/i code will write an e-mail copy job thru the internal reader. The submitted job will "send": the e-mail.

Good luck icon_smile.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Nov 13, 2008 12:27 pm
Reply with quote

Why go thru the hassle of a double jump..
the samples given in the forum all use IEBGENER with the logic of reading from cards and writing to the subsystem datatset for mail

current IEBGENER approach
Code:
//SEND   EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN    DD DUMMY
//SYSUT1   DD *
//SUSUT2   DD SYSOUT=(M,SMTP)
...
... mail control statements
...


user program approach ... ALMOST THE SAME
Code:
//SEND   EXEC PGM=userprog
...
... other ddnames
...
//mail_ddname   DD SYSOUT=(M,SMTP)


the user program can do all the processing needed,
condition to send mail is to writhe the mail control statements
and the mail text to a file defined with lrecl 80 and
assigned to the ddname witch pints to the SMTP subsystem dataset

the SMTP subsystem does not care who feeds it
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Nov 13, 2008 2:47 pm
Reply with quote

Hello,

The reason i suggest stacking these via the internal reader was so that there could be some control on when they were released rather than being one, possibly unmanageable, large burst. If each iteration thru the database submitted a new job that was HELD, it would offer at least some chance to control the impact on the smtp system.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Nov 13, 2008 6:19 pm
Reply with quote

If you're already doing this with JCL and just moving the processing to PL/1, you can use PL/1 commands to write to a DD name pointing to the SMTP queue.

If you're setting up a new application, I strongly urge you to take Dick's advice and discuss the application with your site systems support person who handles TCP/IP and SMTP as this type of system can have a major impact on mail processing. And submitting jobs to process some number of emails would be better than dumping a huge chunk of email into the system all at once. Your site may have some standards for this already, which is another reason to talk to the support person.

Finally, if you haven't read RFC 2821 on SMTP formats, do yourself a favor and get familiar with it. It'll save you some headaches down the line.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts REASON 00D70014 in load utility DB2 6
No new posts ISRSUPC search utility - using high l... TSO/ISPF 2
No new posts REXX to send an email in Mainframe wi... CLIST & REXX 3
No new posts REXX to send an email in Mainframe CLIST & REXX 4
No new posts Any JCL or VSAM Utility to get number... JCL & VSAM 1
Search our Forums:

Back to Top