Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : programming pearls - Good judgement comes from experience, and experience comes from bad judgement.

Google
 
Web mainframegurukul.com


Visit mainframe jobs page to search mainframes jobs on top job websites.


How to start fetching the rows from the abended row in DB2?

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DB2 SQL - DB2 PROGRAMMING
  View previous topic :: View next topic  
Author Message
thamodharan
Member


Joined: 21 Oct 2008
Posts: 14
Location: chennai

PostPosted: Wed Feb 03, 2010 7:20 pm    Post subject: How to start fetching the rows from the abended row in DB2? Reply with quote

Hi All,

I have a program which is fetching 2000 rows from a table. I encountered an abend after fetching 1000 rows and written into the output file. So, I need to start fetching the rows from 1000, instead of starting from Row1.

Can anyone suggest me how to start fetching the records like I mentioned above?

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

Natarajan
Moderator


Joined: 10 Oct 2008
Posts: 427
Location: chennai

PostPosted: Thu Feb 04, 2010 2:39 pm    Post subject: Reply with quote

You may need to modify the code for this.
You better write a logic to skip first 1000 records and start writing from 1001th
record into file. You can implement this small logic after fetch.

But one thing remember, you need to make sure, when we run the program again
cursor should get the rows in the same order of its first run. otherwise we may end up missing some records.

DB2 provides the FETCH FIRST clause to fetch first few records. I am not sure
whethere we have any thing like FETCH FROM <ROWn> to <ROWnnn>.
_________________
Natarajan
Chennai
Back to top
View user's profile Send private message Visit poster's website
anv2010
Member


Joined: 05 Feb 2010
Posts: 5
Location: New Jersey, US

PostPosted: Fri Feb 05, 2010 12:17 am    Post subject: Reply with quote

You'd have to implement basic RESTART into your application, e.g. add WHERE clause to your DECLARE cursor statement. Then, make sure to save (INSERT) the corresponding working-storage fields into a DB2 table, etc...

Please note, that there's also an issue of repositioning your "output file."

Alternatively, you can opt-in for an external to your application checkpoint/RESTART product like Smart/RESTART: http://www.relarc.com/smartrestart/
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DB2 SQL - DB2 PROGRAMMING All times are GMT + 5 Hours
Page 1 of 1



 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts Announcement: DB2 QUICK START - E-Book Release - only for $2 6 Krishna 3910 Tue May 19, 2009 11:22 am
Vamsi99 View latest post
No new posts IMS start up 5 madhureddygs 1416 Sun Jan 10, 2010 2:37 pm
Anuj Dhawan View latest post
No new posts When you do a START, what will the value of EIBCALEN? 1 Krishna 377 Sun Jul 19, 2009 8:57 pm
Krishna View latest post
No new posts I have done a START BROWSE on a VSAM dataset. 1 Krishna 319 Sun Jul 19, 2009 8:54 pm
Krishna View latest post
No new posts START with Alt Index Key 1 jay 1036 Thu Jul 03, 2008 8:20 pm
laxmi_maha2000 View latest post
 



This widget requires Flash Player 9 or better








Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB