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

Way to rollback the data written into sequential file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ssivasub

New User


Joined: 14 May 2007
Posts: 4
Location: Chennai, India

PostPosted: Thu May 31, 2007 9:16 pm
Reply with quote

Hi,

Is there any way to rollback the data written into sequential file if the program abends in the middle. If yes, any syntax or in program we have to handle anything in the file declaration.

Can anyone help me out..

Sarav
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu May 31, 2007 9:37 pm
Reply with quote

Hello,

If you are writing to a sequential file and the job abends, a DISP=(NEW,CATLG,DELETE) will cause the "rtollback" as the file will be deleted bacause of the abend.

If this is not what you are looking for, please clarify and we will be able to offer suggestions.
Back to top
View user's profile Send private message
ssivasub

New User


Joined: 14 May 2007
Posts: 4
Location: Chennai, India

PostPosted: Fri Jun 01, 2007 9:54 am
Reply with quote

Hi,

My output file will be declared with DISP=(MOD,CATLG,CATLG) and my program is written with DB2 commit restart logic. For eg:

Suppose there are 10 records in input file. For every record once processing done , it will be written to output file. Once five records processed, it will do DB2 commits and 5th record will be written to restart table.

Now from 6th record onwards it will proceed to write to output file. But suppose if the job abends in the 8th record, then job will be restarted once again to start process from 6th records onwards since in the restart table you have last processed record is 5th record. Here the problem is 6 th and 7th records will be written to output file while 8th record abends. This I need to rollback in o/p file. Is it possible?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jun 01, 2007 7:05 pm
Reply with quote

Hello,

One way to get what you want is to write the "new" data to a separate file. If there is an abend/rollback/restart, the program will have restart logic that tells it where to begin updating the database on the restart. The sequential output is re-created from the beginning during a restart. This is also a way to re-sync counters/reports that were lost during the abend.

When the step completes successfully, the "complete" new sequential file is MOD'ed onto the intended output file.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Jun 01, 2007 7:14 pm
Reply with quote

Yes, I agree with Dick. The output should be written to a new file, and if a restart is required, you will have the option of using something like sort to eliminate any possible duplicates.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to save SYSLOG as text data via P... All Other Mainframe Topics 4
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
Search our Forums:

Back to Top