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
 

 

emailing different records of a file to different destinatio

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> HomeWorks & Requests
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    Post subject: emailing different records of a file to different destinatio
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10232
Location: italy

PostPosted: Fri Nov 14, 2008 6:21 pm    Post subject: Reply to: emailing different records of a file to different
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    Post subject: Its like this
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10232
Location: italy

PostPosted: Fri Nov 14, 2008 7:22 pm    Post subject: Reply to: emailing different records of a file to different
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    Post subject:
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: 7997
Location: Bellevue, IA

PostPosted: Fri Nov 14, 2008 8:20 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10232
Location: italy

PostPosted: Fri Nov 14, 2008 8:23 pm    Post subject: Reply to: emailing different records of a file to different
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> HomeWorks & Requests All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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