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

Rollback and commit If I got any abend


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

New User


Joined: 02 Jun 2005
Posts: 24
Location: PUNE

PostPosted: Tue Nov 28, 2006 10:53 pm
Reply with quote

Hi

I have a question.

I am using three tables for updating in my program.

I have to update these tables only if everything is OK means if the program successfully completes.

If I got any abend (after first update query or 2nd update querys or all 3rd update query) it has to roll back all these updates.

Can anybnody give ur suggestion how to do it?
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Nov 28, 2006 11:14 pm
Reply with quote

Hi kumar,

When your program abends, (if it truly abends), the system will automatically 'rollback' (backout) all of your updates to the last 'commit', or in the absence of a 'commit', to the beginning of your program.

If your program does not, in truth, abend, you can do

EXEC SQL
ROLLBACK
END-EXEC

And all of your updates will be rolled back as if your program abended.

How many rows are you updating and would want rolled back?

Dave
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 Synchpoint Rollback CICS 1
No new posts ISAM and abend S03B JCL & VSAM 10
No new posts Abend S0C4 11 (Page Translation Excep... PL/I & Assembler 16
No new posts WER999A - UNSUCCESSFUL SORT 8ED U Ab... SYNCSORT 5
No new posts the system or user abend SF0F R=NULL COBOL Programming 0
Search our Forums:

Back to Top