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

Can a DB2 insert trigger execution of a Batch Job


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
TS70363

New User


Joined: 07 Apr 2010
Posts: 94
Location: Bangalore, India

PostPosted: Tue Nov 24, 2015 10:44 pm
Reply with quote

Hi,

I have inserted a record into a table.
Can it in a way trigger a batch job?

Something similar to DSN trigger batch jobs for CA7 schedule


Thanks.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2567
Location: NYC,USA

PostPosted: Wed Nov 25, 2015 12:59 am
Reply with quote

I think Yes, You can first create a DB2 SP which gets triggered on a INSERT and then in that you can submit INTRDR. Talk to DBA's too first.
But why do you want such thing to happen?
Back to top
View user's profile Send private message
TS70363

New User


Joined: 07 Apr 2010
Posts: 94
Location: Bangalore, India

PostPosted: Wed Nov 25, 2015 3:44 am
Reply with quote

Thank you..

Can you please throw more light on the option that you have provided


My requirement is:

A process will load 100000+ rows in a table A multiple times during a day. Simultaneously the same process will insert an identifying record for the batch in another table B.
As soon as the process inserts the identifying record in Table B, it needs to trigger subsequent batch process to make use of the records loaded in Table A.

Table B is just a thought.

Any other suggestions are welcomed.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2567
Location: NYC,USA

PostPosted: Wed Nov 25, 2015 4:03 am
Reply with quote

Option-1
Quote:
Can you please throw more light on the option that you have provided

It should have some answers for you.
ibmmainframes.com/post-155574.html
Option-2
You have not provided much info hence the answers will be limited
Quote:
As soon as the process inserts the identifying record in Table B

Whatever process you have, can it do a FTP of dummy file at the end? if yes then You can use CA7, to start a job with the successful ftp of a dataset-- Talk to scheduling Team in your shop and discard the earlier approach.
Quote:
Any other suggestions are welcomed.

Option-3
Another approach is to have a job scheduled hourly ( or whatever) which will pick up the data in table A and process whatsoever inserted by that time.

In all of these processes make sure you don't delete/update/insert in batch process and it is just a SELECT with UR as this has strong chances of contention.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1565
Location: Andromeda Galaxy

PostPosted: Sun Nov 29, 2015 6:46 pm
Reply with quote

Just a thought if you want something to happen in realtime why do you need to choose a batch method?
Back to top
View user's profile Send private message
TS70363

New User


Joined: 07 Apr 2010
Posts: 94
Location: Bangalore, India

PostPosted: Sun Nov 29, 2015 10:47 pm
Reply with quote

Thank you Rohit.. I had thought of Option 3 but was rejected by a senior.

I have discussed and made him agreed for option 3.

For Pandora Box
I need to process several batches (100000+ records) on a daily basis..once the batches are ready for processing, the previous process would notify us by inserting an identifying record in another table. My process would then read this table to check if any batch is available to process.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2567
Location: NYC,USA

PostPosted: Mon Nov 30, 2015 9:18 pm
Reply with quote

Quote:
I have discussed and made him agreed for option 3

Good!!
6 years back working with one of the Bank on Trading platform where if any orders are cancelled through CICS Screens during the business hours (Back Door) then allocated money used to get Credited back by EoD which made user short of money so we introduced option 3 where every 30 Minutes a DB2 Batch will keep check for cancelled orders and CR back the money. icon_wink.gif
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts File-aid batch how to repeat a line... Compuware & Other Tools 2
No new posts How to pass arguments in a ISPSTART c... CLIST & REXX 6
No new posts Can we Insert duplicates in Primary U... DB2 2
No new posts How to define transaction that trigge... CICS 2
No new posts current batch plan DB2 3
Search our Forums:

Back to Top