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
 

 

Design : Trigger a txn based on count of records in a table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
kkalra

New User


Joined: 16 Dec 2010
Posts: 2
Location: Delhi NCR

PostPosted: Tue Jul 30, 2013 1:31 am    Post subject: Design : Trigger a txn based on count of records in a table
Reply with quote

Hello,

I have to design something that will send an automatic email if the count of records in a particular table is more than 100 records? Can you please suggest some ways to implement this?

I can think of one; where i can write a batch job that will scan the table for number of records; if the number of records > 100 trigger a new job to send the email to a group (by writing to internal reader). Also, I have to schedule the batch job to run periodically, lets say every 15 mins to monitor the count of records in the table.

Is there an easier way to accomplish this with lesser load on the system? or Avoid Batch job.

All suggestions are welcome.
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Jul 30, 2013 8:09 pm    Post subject:
Reply with quote

Hello and welcome to the forum,

One way to do what you want with very little overhead is to modify the code that adds these rows to check if there are 100 (or more) rows in the table and then send the email.

If all of a sudden 1000 rowsa are inserted, there will be Lots of emails . . .

What will the email accomplish? Maybe there is an alternative.
Back to top
View user's profile Send private message
kkalra

New User


Joined: 16 Dec 2010
Posts: 2
Location: Delhi NCR

PostPosted: Wed Jul 31, 2013 12:46 am    Post subject: Reply to: Design : Trigger a txn based on count of records i
Reply with quote

This is for an order processing system and purpose of this is to automate the monitoring of the system health. incase the order processing server is down, the orders will not be generated. Incase the orders are not generated and the backlog is more than 1000 or 5000 orders , it should send an email to the concerned person so that corrective action can be taken.

I get your point when you say that the count should be verified when the insert happens.

Also, i have a similar concern that there will be so many emails generated. For that i guess i will try to save the timestamp of last sent email - if an email was sent in last 15 mins; do not send a new email.
Back to top
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Wed Jul 31, 2013 12:57 am    Post subject: is this a db2 table
Reply with quote

if this is a DB2 table just set a trigger when the count is greater than 100
, and have a stored procedure sent your email.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Jul 31, 2013 4:12 am    Post subject: Reply to: Design : Trigger a txn based on count of records i
Reply with quote

When you say "Table" is this an in-core Assembler CSECT that accumulates data or is it a storage-table (LINKAGE or WS) in the target program itself?

You could have a separate "Traffic Cop" started task (starts every 30 seconds or so), which interrogates this table and when it has reached or has exceeded 100, start a separate started task (different transid), which builds and submits an IEBGENER Job (via the SPOOL API's), which will notify the e-Mail recipient.

Or, just add code to the program which contains the table and build/submit the IEBGENER Job (via this same started task as just mentioned) when the table count is not less than 100.

But, you really need to explain this "table" concept a little better, so we can provide other scenarios.

A separate started task addressing table-storage of a completely different program can be done, but not easily.

HTH....
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 -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts Display FTP Session Count within TSO Yolanda Harvey TSO/ISPF 3 Fri Mar 10, 2017 10:31 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am


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