Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Email utility in PL/I

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: Email utility in PL/I
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

Site Director


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

PostPosted: Thu Nov 13, 2008 9:17 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Nov 13, 2008 9:46 am    Post subject:
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    Post subject: Reply to: Email utility in PL/I
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

Site Director


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

PostPosted: Thu Nov 13, 2008 10:30 am    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10278
Location: italy

PostPosted: Thu Nov 13, 2008 12:27 pm    Post subject: Reply to: Email utility in PL/I
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

Site Director


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

PostPosted: Thu Nov 13, 2008 2:47 pm    Post subject:
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: 8124
Location: East Dubuque, Illinois, USA

PostPosted: Thu Nov 13, 2008 6:19 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to Use DebugTool CodeCoverage Uti... neo4u IBM Tools 0 Thu Jun 22, 2017 6:38 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts EMAIL using IEBGENER - SMTP parasmalik20 JCL & VSAM 4 Tue May 23, 2017 12:19 am
No new posts DB2 - TERMINATE utility vasanthz DB2 5 Mon May 15, 2017 11:49 pm
No new posts HLIST Utility In Batch Virendra Shambharkar TSO/ISPF 4 Fri Apr 07, 2017 3:38 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us