View previous topic :: View next topic
|
Author |
Message |
hac
New User
Joined: 18 Jan 2008 Posts: 30 Location: mumbai
|
|
|
|
How to email different records of a file to different destinations...
Say i have a file with 5 records, and each record needs to be sent to different destinations...how is it possible? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
write a program,
or the control cards for SORT (dfsort, or syncsort)
You would have to provide anyway also all the infrastructure records |
|
Back to top |
|
|
ankitbahuguna
New User
Joined: 25 Feb 2008 Posts: 12 Location: Mumbai
|
|
|
|
Its not that easy... question is something like this:
Suppose we have a job in which a file is getting created with 10 records.Now the next step has to read 1st record and then write a file for 1st record and then 3rd step will send the mail to the user1.
likewise,job has to read 2nd record and then write a file for 2nd record and then 3rd step will send the mail to the user2. likewise all 10 users should get the different mail. mail lines are same, just one information(which is the input record) will be different for different users.
like records are 1234 2222 3456 5567 8888
now mail will be like
hello user,ur no. is 1234(and will be sent to user1, user1 we can get from the program)
hello user,ur no. is 2222
hello user, ur no. is 3456
and like that.
and for this either job has to run in loop from that step or else from the program itself a jcl should be fired....
now mods, pls tell how we can do this. If i m correct we can use If in jcls... |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
ankitbahuguna!
let' s keep a bit of good manners around here, please
no stepping in with questions on somebody else topics
it makes things more complicated for the original poster
if You have issues start a new topic
for this time here is the logic....
Code: |
open input
open output ( mail )
do until end of file
read one data record
prepare the header records and write each of them to the output
write the data record
prepare the trailer records and write each of them to the output
end
close output
close input
|
at the end the output dataset will contain all the emails to send
nobody prevents from having multiple emails in one file |
|
Back to top |
|
|
ankitbahuguna
New User
Joined: 25 Feb 2008 Posts: 12 Location: Mumbai
|
|
|
|
ok, sorry for that :-)
But actually the question was mine,as we both are working in same company. I explained it more clearly for other ppl. Nyways thanx for ur reply.
I understood what you explained. It was good but please understand it like this. ...
Now the output file will be having different 10 mails and we are sending this file to all those 10 users correct?
But we need one file for 1 user, 2nd file for 2nd user ...., some private information is there which other users shouldnot see!! Thats why we can't do like this.means either we need to create 10 different files or hide rest of 9 files from 1st user. how we will be doing this so? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Google and read IETF RFC 2821. If your data stream being passed to SMTP consists of the HELO string and continues as a complete email through the ending period, it is then processed. The next line with the HELO string starts a new email which is handled separately by SMTP. Nobody will be seeing the first email except the recipients, because once it ends it is gone. Ditto with each of the following emails. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
You will create one output file with the emails,
but each user will receive only his email ( if the program has been properly written)
something on the style
Code: |
HELO
MAIL FROM: <Your_company_email_id>
RCPT TO: <Your_company_email_id>
DATA
FROM: COMPANY ABC
TO: <Adresse_one>
SUBJECT: PROBLEM IN STORE NUMBER ..
...... mail text for adresse one
HELO
MAIL FROM: <Your_company_email_id>
RCPT TO: <Your_company_email_id>
DATA
FROM: COMPANY ABC
TO: <Adresse_two>
SUBJECT: PROBLEM IN STORE NUMBER ..
...... mail text for adresse two
HELO
......
HELO
.....
and so on and so on
|
|
|
Back to top |
|
|
ankitbahuguna
New User
Joined: 25 Feb 2008 Posts: 12 Location: Mumbai
|
|
|
|
Thanks a lot...i will apply this and will let you know. |
|
Back to top |
|
|
ankitbahuguna
New User
Joined: 25 Feb 2008 Posts: 12 Location: Mumbai
|
|
|
|
Thanks to both robert and enrico. |
|
Back to top |
|
|
|