View previous topic :: View next topic
|
Author |
Message |
chandu.be
New User
Joined: 17 Jul 2006 Posts: 9 Location: Bagalore
|
|
|
|
Hi,
Can any body explain me how we can implement Commit/Restart logic in CICS programs.
My scenario is as follows:
I have an input and output file. If my program get abends after processing 50 records. How can i make sure that my program will start running after sometime and it will starts processing from 51st record.
Thanks & Regards,
Chandu |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
INPUT file and OUTPUT file? in CICS? are you using TDQ's?
as in batch (where is sounds as if this program belongs), you have to keep track of what you have read and processed AND you have to save this info someplace (a db2 table, vsam file).
Your program needs to check this save area upon program start, and determine where you are in the processing. for example: if record count is zero, you would start at the begining. If the record count > 0 then you need to position your input and then start. |
|
Back to top |
|
|
balaji81_k
Active User
Joined: 29 Jun 2005 Posts: 155
|
|
|
|
We have to posses a variable to count the no of records that are processed succesfully before the program gets abends .Actually the Program logic should start as Program initilzation of all defined
variables (where count variable declared ) and the program logic
should start with READ TDQ and a check . Then move it to the count variable and after each sucessfull process of record we need to write count variable in TDQ and once the program abends when we restart the same program and once it comes for the program logic READ TDQ is executed again and it contains last sucessfull processed record (count) then check for the count variable if it is greater than > 0 then increment the count = count + 1( to avoid the abend) and then logic is same as above will be excuted again. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
You need to review "Dynamic transaction backout" as well as SYNCPOINT API's, UOW (Unit of Work), etc.
These facilities are all documented in the CICS manuals for your given version/release and can be very complicated to explain in a posting.
Bill |
|
Back to top |
|
|
|