data moving from flat file to db2 table

IBM's flagship relational database management system
chinna
Posts: 4
Joined: Tue Dec 11, 2007 4:13 pm
Skillset: cobol,jcl,db2,pl/1,ims,cics
Referer: google

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.

William Thompson
Posts: 81
Joined: Sat Jun 09, 2007 4:24 am
Skillset: Some?
Referer: mcmillan
Location: Tucson AZ

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......

chinna
Posts: 4
Joined: Tue Dec 11, 2007 4:13 pm
Skillset: cobol,jcl,db2,pl/1,ims,cics
Referer: google

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:

William Thompson
Posts: 81
Joined: Sat Jun 09, 2007 4:24 am
Skillset: Some?
Referer: mcmillan
Location: Tucson AZ

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?

the_gautam
Posts: 2
Joined: Thu Jan 03, 2008 11:39 am
Skillset: COBOL, DB2, VSAM
Referer: through friends

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.


  • Similar Topics
    Replies
    Views
    Last post