| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| GeminiK_80 Beginner
 
 
 Joined: 26 Apr 2005
 Posts: 7
 Topics: 3
 
 
 | 
			
				|  Posted: Wed Apr 27, 2005 5:58 pm    Post subject: Kick off a Job using DB2 Trigger |   |  
				| 
 |  
				| Hi! We have a set of DB2 batch Jobs running in production daily.
 
 Now, my requirement is to check the updates on the DB2 tables since yesterday and if there are any updates on it, run the jobs otherwise donot run them.
 
 Is there any way to achieve this?
 
 Thanks in advance.
 _________________
 Thanks,
 Gemini K.
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| kolusu Site Admin
 
  
 
 Joined: 26 Nov 2002
 Posts: 12394
 Topics: 75
 Location: San Jose
 
 | 
			
				|  Posted: Thu Apr 28, 2005 7:31 am    Post subject: |   |  
				| 
 |  
				| Geminik_80, 
 Do you have a date/timestamp field that specifies if an update is performed? if you have then you can unload the table and check for empty file and then trigger your jobs.
 
 If there is nothing to differentiate the update then you may have to maintain a gdg. Unload the table every day and compare it against yesterday's unload. If you found any mismatches then trigger the jobs.
 
 Another alternative is to create a file whenever an update is performed. Now check this file for empty and trigger the jobs if it has atleast 1 record.
 
 Hope this helps...
 
 Cheers
 
 kolusu
 _________________
 Kolusu
 www.linkedin.com/in/kolusu
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| Bithead Advanced
 
  
 Joined: 03 Jan 2003
 Posts: 550
 Topics: 23
 Location: Michigan, USA
 
 | 
			
				|  Posted: Thu Apr 28, 2005 7:55 am    Post subject: |   |  
				| 
 |  
				| The trigger can invoke a strored procedure and that can write out the JCL as a file to a DD that has it's output going to INTRDR. |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  | 
	
		|  |