View previous topic :: View next topic
|
Author |
Message |
Tunaj
New User
Joined: 23 Oct 2009 Posts: 4 Location: Hyderabad
|
|
|
|
Suppose one of my program is reading a file which contains 10,000 records and writing to another output file,it got abend after processing 500 records.I need to restart the program so that it will start processing of records from 501 records not from the begening.So what would be my code insite the program so that it will process the record from 501 record.
Thanks
Pratap |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
The restartability of any program depends entirely on what it is doing, what it has done up to and including the point of abend.
So without a heck of a lot more details from you the question is impossible to answer. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Unless your program was written from scratch to handle this type of restart scenario, you most likely cannot do so now. The program has to have a way to identify which record to restart from, read and ignore that many input records, and so forth. The logic is not complicated but unless the program was written this way it is usually not worth the effort to go back and add the logic.
Furthermore, most sites have decided the cost of rerunning the entire job (especially for such a small record count) doesn't justify adding restart logic into the code these days. |
|
Back to top |
|
|
Tunaj
New User
Joined: 23 Oct 2009 Posts: 4 Location: Hyderabad
|
|
|
|
How I will write the logic(Code in cobol) in the program so that it will read and bypass the 500 record and start processing from 501 record.I am not geting any idea how to code.if someone will help me in code it will be great. |
|
Back to top |
|
|
Kjeld
Active User
Joined: 15 Dec 2009 Posts: 365 Location: Denmark
|
|
|
|
You should definitely not write your own logic for rolling back changes since last commit point, and positioning into datasets at restart.
If your site has IMS, you could use IMS checkpoint/restart to handle this. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
if You cannot by Yourself discover/imagine that You need to initialize a counter, read one record, increment the counter, keep reading until the counter is equal to the <restart> record (*)
You do not have a place in IT!
(*) a PERFORM might be another approach... but I do not speak COBOLESE, and I might be wrong |
|
Back to top |
|
|
vadim vashchenko
New User
Joined: 21 Mar 2011 Posts: 13 Location: usa
|
|
|
|
Tunaj wrote: |
How I will write the logic(Code in cobol) in the program so that it will read and bypass the 500 record and start processing from 501 record.I am not geting any idea how to code.if someone will help me in code it will be great. |
I am getting old - I can not understand your problem. Rewrite a "restart" dataset with every processed record and re-start updating from the saved record. You also can save a count. The "restart" dataset could be anything: a flat, DB2 table and so on. :) |
|
Back to top |
|
|
Kjeld
Active User
Joined: 15 Dec 2009 Posts: 365 Location: Denmark
|
|
|
|
Checkpoint/restart is not a simple task. You have to control writing to sequential output files so that you are able to roll back changes done since last checkpoint if an abend occurs. Likewise, database updates should be syncronised, committed in checkpoints.
Positioning your input dataset is just one of these challenges. Usually, relative block address (RBA) is used to track position in a sequential dataset. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
If its just a situation like this :
old master + updates = new master (old master in the following run) :
then make a copy with for example of your update file skipping the first 500 records, and do a rerun with your new update file.
And yes this kind of nonsense worked around 40 years ago when nobody had heard about any kind of totals to check if the update process was valid.
And kjeld ims has nothing to do with this, i didnt see anything related to ims. Restart logic for normal batch update programs is quite another story. |
|
Back to top |
|
|
Kjeld
Active User
Joined: 15 Dec 2009 Posts: 365 Location: Denmark
|
|
|
|
PeterHolland wrote: |
And kjeld ims has nothing to do with this, i didnt see anything related to ims. Restart logic for normal batch update programs is quite another story. |
Just for info, we have been using IMS BMPs and DBBs for many years at my installation for their checkpoint/restart facilities, even though TP nowadays is handled by CICS. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
Back to top |
|
|
Peter Nancollis
New User
Joined: 15 Mar 2011 Posts: 47 Location: UK
|
|
|
|
Guys the question asked was
"I need to restart the program so that it will start processing of records from 501 records not from the begening"
enrico hit the mark ....
Outputs havent even been considered
Too simplistic for words |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
Back to top |
|
|
|