Page 1 of 1

data moving from flat file to db2 table

PostPosted: Tue Dec 11, 2007 5:21 pm
by chinna
Hi,

Can you please give the solution to this problem........

I have one flat file with 1000 records, I am copying from that file to db2 table. But in-between due to some problem job is abend, it move 400 records properly into db2 table. After restart a job, I need to start at 401 record...

what can i do? can you please tell me solution....

With Regards,

chinna.

Re: data moving from flat file to db2 table

PostPosted: Tue Dec 11, 2007 6:54 pm
by William Thompson
chinna wrote:After restart a job, I need to start at 401 record...
what can i do? can you please tell me solution....
It depends on what tools you want to use, a sort copy can provide the means to skip the first 400 records......

Re: data moving from flat file to db2 table

PostPosted: Tue Dec 11, 2007 6:56 pm
by chinna
Thanks for your replay........

I got a solution :idea:

Re: data moving from flat file to db2 table

PostPosted: Tue Dec 11, 2007 6:59 pm
by William Thompson
chinna wrote:I got a solution :idea:
Which was?

Re: data moving from flat file to db2 table

PostPosted: Thu Jan 03, 2008 11:50 am
by the_gautam
you may use the DB2 Restart Logic.

whenever you write a successful record to the DR2 table, you move the primary key field of that record to a temporary dataset. by doing this, you will be storing the key of the last successful insertion into the table. after the job abends and you want to restart the job. you first check that temporary dataset for the key. the last key written in that dataset is the place where the job ended. now you read the source dataset using that key and start processing further.