Code Comments
Programming Forum and web based access to our favorite programming groups."Raya" <lakshmiraya@gmail.com> wrote in message news:1176101204.010928.134730@y66g2000hsf.googlegroups.com... > Hi, > I have a requirement as follows: > > I have a COBOL+DB2 program that inserts data into a DB2 table when an > order is placed. Now, The same data should be inserted into the same > table after every 7 days until a condition is met. This means I need > to insert same data after every 7 days until the order is approved/ > denied. > > Any help would be highly appreciated. > > Thanks, > Raya. > I would use a stored procedure and a trigger (DB2 supports both). Put a trigger on the table so that when COBOL does the insert, a task is automatically scheduled to do it again in 7 days. This is achieved by a stored procedure call to ADMIN_TASK_SCHEDULE. This system stored procedure takes a number of parameters, some of which are when you want it to start and stop, or under what conditions. You can use ADMIN_TASK_SCHEDULE to cause a set of JCL, a JCL procedure or a stored DB procedure to be run, and have the results returned (RC if it is JCL; SQLCODE if it is a stored procedure) and written to a log or whatever at the time it is activated. Have a look at the IBM documentation for DB2 version 9.1 for z/OS. Pete.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.