Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Restart the file from abended records not from the begening

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Tunaj

New User


Joined: 23 Oct 2009
Posts: 4
Location: Hyderabad

PostPosted: Mon Mar 28, 2011 2:59 pm    Post subject: Restart the file from abended records not from the begening
Reply with quote

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

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Mar 28, 2011 3:10 pm    Post subject:
Reply with quote

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

Global Moderator


Joined: 06 Jun 2008
Posts: 7908
Location: Bellevue, IA

PostPosted: Mon Mar 28, 2011 3:15 pm    Post subject:
Reply with quote

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

New User


Joined: 23 Oct 2009
Posts: 4
Location: Hyderabad

PostPosted: Mon Mar 28, 2011 3:43 pm    Post subject:
Reply with quote

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

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Mon Mar 28, 2011 3:46 pm    Post subject:
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Mar 28, 2011 3:52 pm    Post subject: Reply to: Restart the file from abended records not from the
Reply with quote

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

New User


Joined: 21 Mar 2011
Posts: 13
Location: usa

PostPosted: Mon Mar 28, 2011 5:39 pm    Post subject:
Reply with quote

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

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Mon Mar 28, 2011 6:16 pm    Post subject:
Reply with quote

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

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Mon Mar 28, 2011 10:21 pm    Post subject:
Reply with quote

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

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Tue Mar 29, 2011 4:11 am    Post subject:
Reply with quote

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

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Tue Mar 29, 2011 1:44 pm    Post subject:
Reply with quote

This link could help :

http://publib.boulder.ibm.com/infocenter/ratdevz/v7r6/index.jsp?topic=/com.ibm.ent.cbl.zos.doc/topics/PGandLR/concepts/cpchk02.htm
Back to top
View user's profile Send private message
Peter Nancollis

New User


Joined: 15 Mar 2011
Posts: 47
Location: UK

PostPosted: Wed Mar 30, 2011 5:07 am    Post subject:
Reply with quote

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

Global Moderator


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

PostPosted: Wed Mar 30, 2011 10:27 am    Post subject:
Reply with quote

do a right click and save this pdf and then read it:
pdf with restart logic
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us