Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cobol duplicate records written in a file not structured for dup

Status
Not open for further replies.

dhelie

Programmer
Apr 30, 2008
5
0
0
US
I have a question of how this is happening. I have a index format8 file that is simple in key structure. Primary key, no duplicates.

I had some problems writing new records to this file and received a file status of 9006 eventhough the file is open for I-O.
When I rebuild the file to a new file, the rebuild command displays duplicate key records in the file and does not write these records to the new file. Using the new file, everything works fine.

Does anyone know how records with duplicate keys can be written to a file that does not duplicate key option?
Oh... This is Micro Focus.... so I am not surprise!
 
You could add something to the key to make it unique, perhaps a three digit number that is normally zero.

You can detect the duplicate file status after the WRITE (presuming that you know how that is done), and ADD 1 to the number, reattempt the WRITE, until you have success.
Oh... This is Micro Focus.... so I am not surprise!
Oh... I see... Hmmm

Tom Morrison
Micro Focus
 
Does anyone know how records with duplicate keys can be written to a file that does not duplicate key option?Oh... This is Micro Focus.... so I am not surprise!
Since this was first posted, i have been completely befuddled (returned a few times to see if i got a different "read") as to why one would be looking for a way to corrupt the data. . .

My preference is that my tools do work as specified. And that they look out for me. . .
 
Well, papadba, I think you misunderstood the question. The op had fond that this was already occuring and wanted to know how it could, in order to fix the problem.
 
Well, papadba, I think you misunderstood the question.
Quite possible<g> But on reflection , i think not.

This is largely due to the MicroFocus blast. I've decided that if this TS seriously posted the MicroFocus bit, looking for a way to get around a rule seemed possible. . .

The op had fond that this was already occuring and wanted to know how it could, in order to fix the problem.
With the very little provided, my quess would be failed i/o that introduced the corruption, rather than exploiting some feature.
 
A corrupted index file would create a situation to get duplicate records in a file that shouldn't accept them. The (any) duplicate-check is done against the index, not the datafile.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top