IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to avoid duplicate entry in my file.


IBM Mainframe Forums -> IMS DB/DC
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
abdulrafi

Active User


Joined: 14 Sep 2009
Posts: 184
Location: Coimbatore

PostPosted: Fri Sep 21, 2012 10:42 pm
Reply with quote

Hi,

A have a doubt regarding the checkpoint restart logic.

I have a program which needs to read every record from a DB2 table and load it into a PS file. I have the checkpoint logic in place. The logic is like for every 10 records fetched a checkpoint is taken. Consider that my file contains 100 records. My pgm has processed 10 records and the first checkpoint has been taken. Later when my pgm processed the next 5 records it got abended. Now totally there are 15 records written
into the file and I have 1 checkpoint in my hand which was taken after 10 records fetched.

Now I am giving the restart-id in the jcl to execute my pgm from the abended spot. When my pgm is executed i don want the records 11 to 15 to be read again which has been already read and updated in
the file. Considering my file is opened in extend mode so as to append the datas one below the other.

Currently it fetches from 11 as my checkpoint point was taken after 10 records were fetched and read. Because of which i am getting duplicate entry in my flat file which is not required.

Please assist me a way to eliminate duplicate record.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Sep 21, 2012 11:10 pm
Reply with quote

abdulrafi wrote:
Hi,

A have a doubt regarding the checkpoint restart logic.

I have a program which needs to read every record from a DB2 table and load it into a PS file. I have the checkpoint logic in place. The logic is like for every 10 records fetched a checkpoint is taken. Consider that my file contains 100 records. My pgm has processed 10 records and the first checkpoint has been taken. Later when my pgm processed the next 5 records it got abended. Now totally there are 15 records written
into the file and I have 1 checkpoint in my hand which was taken after 10 records fetched.

Now I am giving the restart-id in the jcl to execute my pgm from the abended spot. When my pgm is executed i don want the records 11 to 15 to be read again which has been already read and updated in
the file. Considering my file is opened in extend mode so as to append the datas one below the other.

Currently it fetches from 11 as my checkpoint point was taken after 10 records were fetched and read. Because of which i am getting duplicate entry in my flat file which is not required.

Please assist me a way to eliminate duplicate record.


What does this have to do with IMS DB/DC?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Sat Sep 22, 2012 12:00 am
Reply with quote

Hello,

IMS or not, why does someone believe the records from 11 thru 15 should not be reprocessed?

When you issued the checkpoint after 10 iterations, that is your last valid checpoint - the last place from which you can successfully restart.

You need to study the basics of backup/restore checkpoint/restart. It appears you do not have this understanding.

At this late date, i suspect there is no checkpoint/restart needed. Simply backup the data before the update run and if there is an abend, reload from the backup and rerun from the beginning.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Sat Sep 22, 2012 12:07 am
Reply with quote

abdulrafi wrote:
Hi,

A have a doubt regarding the checkpoint restart logic.

I have a program which needs to read every record from a DB2 table and load it into a PS file.


If all you are doing is fetching from a table (note tables have rows not records) and writing to an output file worrying about a restart is a waste of time and resources!
Back to top
View user's profile Send private message
abdulrafi

Active User


Joined: 14 Sep 2009
Posts: 184
Location: Coimbatore

PostPosted: Tue Sep 25, 2012 5:09 pm
Reply with quote

Thanks for your help.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> IMS DB/DC

 


Similar Topics
Topic Forum Replies
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Duplicate transid's declared using CEDA CICS 3
Search our Forums:

Back to Top