data moving from flat file to db2 table



IBM's flagship relational database management system

data moving from flat file to db2 table

Postby chinna » Tue Dec 11, 2007 5:21 pm

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.
chinna
 
Posts: 4
Joined: Tue Dec 11, 2007 4:13 pm
Has thanked: 0 time
Been thanked: 0 time

Re: data moving from flat file to db2 table

Postby William Thompson » Tue Dec 11, 2007 6:54 pm

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......
William Thompson
 
Posts: 81
Joined: Sat Jun 09, 2007 4:24 am
Location: Tucson AZ
Has thanked: 0 time
Been thanked: 1 time

Re: data moving from flat file to db2 table

Postby chinna » Tue Dec 11, 2007 6:56 pm

Thanks for your replay........

I got a solution :idea:
chinna
 
Posts: 4
Joined: Tue Dec 11, 2007 4:13 pm
Has thanked: 0 time
Been thanked: 0 time

Re: data moving from flat file to db2 table

Postby William Thompson » Tue Dec 11, 2007 6:59 pm

chinna wrote:I got a solution :idea:
Which was?
William Thompson
 
Posts: 81
Joined: Sat Jun 09, 2007 4:24 am
Location: Tucson AZ
Has thanked: 0 time
Been thanked: 1 time

Re: data moving from flat file to db2 table

Postby the_gautam » Thu Jan 03, 2008 11:50 am

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.
the_gautam
 
Posts: 2
Joined: Thu Jan 03, 2008 11:39 am
Has thanked: 0 time
Been thanked: 0 time


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post