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
 

 

which is the best method to restart the JOB in DB2?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Gopalakrishnan V

Active User


Joined: 28 Jun 2010
Posts: 102
Location: chennai

PostPosted: Wed Apr 03, 2013 5:42 pm    Post subject: which is the best method to restart the JOB in DB2?
Reply with quote

Hi,

I have a table which having millions of records, that needs to be updated via some process. If suppose any abend happens during update we need to restart from the record which cause abend, not from the first record.

Currenlty we using a restart file which is used to store the record which cause abend based on SQL code. But i hope it wont work when SOC7 or ASRA or any DB2 system problem, during that time we are not able to write the abend record into restart file.

I heard we can use temporary tables, but i am not sure about the performance issue since the table having high volume. Another method, cursor with hold option but i am not sure whether the cursor still open even after SOC7 or DB2 system prob.

Please suggest some method to restart the JCL from the record causing the abend.

Thanks in advance.
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1713
Location: UK

PostPosted: Wed Apr 03, 2013 5:52 pm    Post subject:
Reply with quote

Actually, you do not want to restart the JCL from the reord causing the abend but you want to restart the PROGRAM.

Do a commit every n records. Immediately before doing so insert, somewhere, the current record count. On restart bypass that many records.
Back to top
View user's profile Send private message
Gopalakrishnan V

Active User


Joined: 28 Jun 2010
Posts: 102
Location: chennai

PostPosted: Wed Apr 03, 2013 6:40 pm    Post subject:
Reply with quote

Hi Nic,

Quote:

Actually, you do not want to restart the JCL from the reord causing the abend but you want to restart the PROGRAM.



Yes. I want to restart the program.

Quote:

Do a commit every n records. Immediately before doing so insert, somewhere, the current record count. On restart bypass that many records.


If we update the table in sequence manner or all record then based on the count we can restart. But i don't think this method will work if we update the table based on where clause condition.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Apr 03, 2013 7:24 pm    Post subject:
Reply with quote

Quote:
But i hope it wont work when SOC7 or ASRA or any DB2 system problem, during that time we are not able to write the abend record into restart file.
VGK - What your current restart-logic is doing, how it works? Check-point-restart is not meant only for "user abends", as I infer from your post.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Wed Apr 03, 2013 9:58 pm    Post subject:
Reply with quote

The restart should happen from the last committed point and when even the commit is done you need to store the key data in file or table so on abend u will be able to restart from the next record
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1713
Location: UK

PostPosted: Thu Apr 04, 2013 12:13 am    Post subject:
Reply with quote

Where is your update data coming from - you did not mention. Is it a sequential file, a VSAM file, another table or somewhere else?
Back to top
View user's profile Send private message
Gopalakrishnan V

Active User


Joined: 28 Jun 2010
Posts: 102
Location: chennai

PostPosted: Thu Apr 04, 2013 5:00 pm    Post subject: Reply to: which is the best method to restart the JOB in DB2
Reply with quote

Hi Anuj,

Quote:

VGK - What your current restart-logic is doing, how it works? Check-point-restart is not meant only for "user abends", as I infer from your post.


Currently we are using a flat file which is used to store the record which cause abend based on SQL code while updating the table. But this method wont work when some DB2 system getting down or abnormal abend, because during that time cant able to write the record and system will hang on.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Thu Apr 04, 2013 5:39 pm    Post subject:
Reply with quote

Quote:
Currently we are using a flat file which is used to store the record which cause abend based on SQL code while updating the table


Can you please rephrase?
Back to top
View user's profile Send private message
Gopalakrishnan V

Active User


Joined: 28 Jun 2010
Posts: 102
Location: chennai

PostPosted: Thu Apr 04, 2013 6:41 pm    Post subject:
Reply with quote

Hi Nic,

Quote:

Where is your update data coming from - you did not mention. Is it a sequential file, a VSAM file, another table or somewhere else?


The data coming from vsam file. But Is there any relation between the incoming data and restart process?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1713
Location: UK

PostPosted: Fri Apr 05, 2013 12:04 am    Post subject:
Reply with quote

Read the second line of my first post - stands good for a sequential file but for a VSAM file (is it ESDS or KSDS?) you may have to adapt the solution to store the actual last record processed and on restart keep reading until you reach the record after that one and restart your updating from there.
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Fri Apr 05, 2013 2:02 am    Post subject:
Reply with quote

Hello,

Hopefully, there is already a restart/rerun/recovery proces in place on your system. If there is one, use it.

If not, this is probably not a task to be handled for only 1 process.

How long does the entire process take now?
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 -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Need help with Oracle Dynamic SQL: Me... Anoop Chandran1984 COBOL Programming 1 Sat Feb 13, 2016 7:27 am
No new posts Use ISAM access method in COBOL Chetan Kumar COBOL Programming 18 Tue Oct 13, 2015 10:28 pm
No new posts SEQNUM and RESTART zh_lad DFSORT/ICETOOL 2 Tue Aug 25, 2015 8:17 pm
No new posts Best Method/Utility to modify HEX val... MrExtraordinare JCL & VSAM 6 Mon Mar 09, 2015 10:09 pm
No new posts Restart Logic suraaj DB2 5 Fri Feb 27, 2015 8:47 pm


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