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

emailing different records of a file to different destinatio


IBM Mainframe Forums -> HomeWorks & Requests
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
hac

New User


Joined: 18 Jan 2008
Posts: 30
Location: mumbai

PostPosted: Fri Nov 14, 2008 6:18 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Nov 14, 2008 6:21 pm
Reply with quote

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
View user's profile Send private message
ankitbahuguna

New User


Joined: 25 Feb 2008
Posts: 12
Location: Mumbai

PostPosted: Fri Nov 14, 2008 7:12 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Nov 14, 2008 7:22 pm
Reply with quote

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
View user's profile Send private message
ankitbahuguna

New User


Joined: 25 Feb 2008
Posts: 12
Location: Mumbai

PostPosted: Fri Nov 14, 2008 8:15 pm
Reply with quote

ok, sorry for that :-)
But actually the question was mine,as we both are working in same company. icon_cool.gif 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
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Fri Nov 14, 2008 8:20 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Nov 14, 2008 8:23 pm
Reply with quote

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
View user's profile Send private message
ankitbahuguna

New User


Joined: 25 Feb 2008
Posts: 12
Location: Mumbai

PostPosted: Fri Nov 14, 2008 9:10 pm
Reply with quote

Thanks a lot...i will apply this and will let you know.
Back to top
View user's profile Send private message
ankitbahuguna

New User


Joined: 25 Feb 2008
Posts: 12
Location: Mumbai

PostPosted: Fri Nov 14, 2008 9:10 pm
Reply with quote

Thanks to both robert and enrico.
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 -> HomeWorks & Requests

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 4
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top