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

Commit/Restart logic in CICS programs


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
chandu.be

New User


Joined: 17 Jul 2006
Posts: 9
Location: Bagalore

PostPosted: Wed Jun 18, 2008 5:26 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jun 18, 2008 5:40 pm
Reply with quote

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
View user's profile Send private message
balaji81_k

Active User


Joined: 29 Jun 2005
Posts: 155

PostPosted: Wed Jun 18, 2008 7:40 pm
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Wed Jun 18, 2008 10:39 pm
Reply with quote

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
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 -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts Calling an Open C library function in... CICS 1
No new posts How to 'Ping' a CICS region in JCL CICS 2
No new posts Parallelization in CICS to reduce res... CICS 4
No new posts Fetch data from programs execute (dat... DB2 3
Search our Forums:

Back to Top