I have been told to write a cobol progrm for this requirement:
1st i need to check in a table if two fields(i.e Handler_name and Email_alert_field) have some value then we need to send a mail to Handler.
And this program should run after every five minutes. So basiclly i need a Delay of 5minutes after every run and how to send mail thru use of cobol program.
Please give some suggestion on the topic.
There are many examples on this forum on how to send emails using SMTP -- search on SMTP for example. COBOL can write the email lines directly to a DD statement pointing to the appropriate SYSOUT class and started task name.
However, if you're planning on having a batch job do this, then delay for five minutes and so forth -- do not do this. Batch processes do not work well with delays and you can find many, many, many suggestions to avoid doing so on this forum.
Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
And this program should run after every five minutes.
Suggest you talk with the people responsible for scheduling jobs on your system and have this scheduled as appropriate.
Then the process can be a simple 2-step job that runs the cobol program that writes the data to be e-mailed and sets a return-code depending on whether to send the e-mail or not. The second step would conditionally execute to send the e-mail when needed.