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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

checking for duplicates and rewrite

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I am trying to search all hm-ssn-2 for duplicate ssn#'s but I am having problems. It will only search the hm-ssn-2 within each record.


01 NEWMAST-DATA-2.
03 HMFN-ID-2 PIC X(09).
03 HMFN-SS-ID-2 PIC 9(09).
03 FILLER PIC 9(08).
03 HMFN-LNAME-2 PIC X(20).
03 HMFN-FNAME-2 PIC X(14).
03 FILLER PIC X(498).
03 HMFN-MEMBERS-2.
05 HM-MEMBERS-2 OCCURS 23 TIMES.
07 HM-FNAME-2 PIC X(14).
07 HM-LNAME-2 PIC X(20).
07 HM-SSN-2 PIC 9(09).
07 HM-DOB-2 PIC 9(08).
03 FILLER PIC X(317).


 
Deidre,

What are the counts that are displayed?

Tom Morrison
 
tHEY ARE JUST FOR ME-HOW MANY RECORDS WERE READ.
 
[smile2]

Yes, I understand what they are for.

I wanted to know what actual values are displayed. That would be a hint to what might be happening...
Tom Morrison
 
Hi All,

This thread is getting big. It takes a while for me to download it. Probably the source code.

Maybe we should start a Part 2 thread. What do you think?


Hi Deidre,

You wrote:

aCUTALLY IT DID NOT CATCH ALL THE DUPLICATES.

Was this after the IP procedure or the OP?

In you OP procedure, after you read the mast file, I see this:
Code:
             COMPUTE B-IDX = B-IDX + 1
             MOVE B-IDX TO BAD-SSN
             MOVE BAD-SSN TO HM-SSN(SR-OCCURS), 
                             ER-NEW-SSN
It looks like you overlay BAD-SSN with B-IDX. Don't know why you'd move an index to an ssn fld unless you just want to put something/anything into the ssn to replace the bad one. Is that what you had in mind?

Jack
 
iT IS NOT CATCHING ALL THE DUPLICATE SSN#'S-
EXAMPLE I HAVE 20 '123456789' SSN'S BUT ONLY A FEW ARE FOUND.
 
Please see the following thread for a continuation of this discussion:
thread209-225628
Tom Morrison
 
Deidre,

What you're saying is not precise enough. Do you find 20 ssn's of 123456789 in the IP procedure? Or do you "lose" them in the OP procedure?

The code you show in the IP procedure should pick up all the ssn's in the ip file. Does it?

If you're losing them in the OP Proc, I would look into rewriting it. When doing "look ahead" reads, I find it helpful to do a 1st read outside the loop and another read before exiting the loop. Once I know where you're losing the dupes, I'll help you to recode it, if necessary.

Until then: How many IP recs are you using? I would use only 1 or 2 until you get it to work the way you expect. Then add recs to test one additional circumstance at a time. Don't use too many ssn's in the array.

Put this display in after the RELEASE:

DISPLAY SORT-REC

Don't worry about this now, but eventually you'll want to test for no ssn's in the array, then 23 ssn's in the array.

Jack
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top