Are these hapless managers aware that you are going to start filling their mailboxes with copies of identical messages, so that they can diligently file them in individual employee folders?
Doesn't sound like a good plan to me, but if it is what they want, then OK.
Have you looked at the possibility of using BCC?
If that is no use to you, you're going to have to go back to thinking. There are no loops in JCL. You'll need a program/utility of some sort to build the e-mails.
Plus if you use CC, the employee will see the CC, so you have a self-defeating requirement you need to sort out.
You might want to consider a "mailing list". One mail in, repeated to all recipients. The managers wouldn't know who had individually received the e-mail without some process to check, but I don't believe they'll be ecstatic about automatically-stuffed inboxes from your original solution anyway, so nail-down the requirement first.
But just going ahead of myself...I am just posting two of the many possible solutions here (these are the ones we use in our IT house for automated emails from HOST servers).
--> Possibilities are you will be using some utitlity like MEMOAPI to send ur emails. In that case for multiple emails the JCL has to be invoked multiple number of times. For this you can use a REXX or CLIST to read details from the file and push these details into a CARDLIB member which will be then used as parameters to the utility when the JCL is submitted via the TSO SUBMIT command. See here for further details
--> In case you want to use a REXX/CLIST or a COBOL or PLI program the steps that you should take are
1. Allocate a file which will be routed via the DEST option to the SMTP sever(in COBOL or PLI you would have to use the TSOLNK service routine...for more detail check here). For e.g.
Please note you would have to ask the admin guys to configure the DEST and the SYSOUT class properly.
2. Write the following data into the MAILDS file after substituting the to and bcc with the data read from the input file. The following lines can be used say if you are sending a friendly message like "Have a nice day".
MAIL FROM: email@example.com
RCPT TO: firstname.lastname@example.org
<P><FONT FACE="Arial" COLOR=#000000>
Have a nice day!.<BR>
3. Free the file. Use the command
4. repeat steps 1-3 for all records in input file.
I believe this has some information that will allow you to go forward..
the above is one sol. if ur shop allows INTRDR. But, the above sol. is limited if you have very less no. of employees as this is going to submit the same job until your email file is empty... NOT AN OPTIMAL solution but a SOLUTION...