View previous topic :: View next topic
|
Author |
Message |
karthikr44
Active User
Joined: 25 Aug 2007 Posts: 235 Location: Chennai
|
|
|
|
Hi,
I have some problem with RESTART logic. I will read one input file and if roll number matches with database i will update some amount and if not matches with database i will write to error file.
While running the program after some 100 records program abended.
In that 15 records were error records. I restarted the program and it ran fine. But here the problem is how to retrieve that 15 error records in the previous abend run. The current o/p file after restart run didn't contain the 15 records.
Regards
R KARTHIK |
|
Back to top |
|
|
muthuvel
Active User
Joined: 29 Nov 2005 Posts: 217 Location: Canada
|
|
|
|
In the first run itself ,you should define the error file as =(MOD,CATLG,CATLG) so that it is not deleted even in abends.
Hope this helps. |
|
Back to top |
|
|
karthikr44
Active User
Joined: 25 Aug 2007 Posts: 235 Location: Chennai
|
|
|
|
HI,
My problem is when the program abends the file doesnt even created.
I think only after CLOSE statement the contents from buffer will be written to disk. The program abends before executing CLOSE statement.
Regards
R KARTHIK |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Quote: |
But here the problem is how to retrieve that 15 error records in the previous abend run. The current o/p file after restart run didnt contains that 15 records. |
This depends where do you issue the check point in the program -- if check-point was issued when those 15 records were already written to o/p you'll have them in the output else you don't. |
|
Back to top |
|
|
karthikr44
Active User
Joined: 25 Aug 2007 Posts: 235 Location: Chennai
|
|
|
|
Hi,
Sorry. I didnt get u what u are telling about check point. In my program database abend may happen at many places. So are u saying that we have to use multiple CLOSE statements.
Regards
R KARTHIK |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
I think only after CLOSE statement the contents from buffer will be written to disk |
Not quite true -- if a buffer is filled then it is written and the next buffer starts filling. The LAST buffer being written to won't be written until the file is closed, of course. So the actual behavior will depend upon how many records you are writing to the file as well as what the file buffer (block) size is.
Checkpoint processing allows for recovery when some database records have been written but not all of them. Read up in the language Programming Guide for the language you're using about checkpoint processing and how to implement it. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
In what OS environment are you executing?
what is the cobol version?
are you using qsam as output file?
you could try the write-immediate clause, if it still exists.
what are your
File SELECT statement
File FD statement
I/O statements
DD statement for the file in your JCL? |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi R KARTHIK,
If the error volume isn't too high you might want to define the error file as unblocked and define only one buffer.
The error recs will be physically written immediately and all will be in the file after the ABEND. |
|
Back to top |
|
|
|