Focal Point
Character check loop?

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3731078331

June 27, 2005, 07:08 PM
slfmr
Character check loop?
I was just wondering if there is a function that can check characters for duplicates. For example: I have a file with 150 records of ssn's, first name, lastname, address, dog, cat, anut, uncle, salary... and so forth. tons of data.

What I want to do is run through the file and make sure there is only 1 ssn (other wise we would have 2 records exatly the same).

Is there a looping function that can go through each row of a file and check that? Can this be done in a define without the use of a hold file?
June 27, 2005, 07:27 PM
Francis Mariani
Why not count the SSN's by SSN and print a report where the count is greater than one?Here's an example using the CAR file. I am using the SEATS field.
First run the report with the WHERE clause commented, then run it uncommented to see the difference.
TABLE FILE CAR
SUM
CNT.SEATS
BY SEATS
PRINT>COUNTRY
CAR BY SEATS
BY MODEL
*WHERE TOTAL CNT.SEATS GT 5
END

This message has been edited. Last edited by: <Mabel>,
June 27, 2005, 07:40 PM
slfmr
That's not a bad idea. I'm wondering if I can do that in a define.

SSN_CHECK/I9 = CNT.SSN;
SSN_NUM/I9 = If SSN_CHECK GT 1 then ERROR else ' ';

Or something like that... you know?

Thanks for your help. Not sure if my defines will work, but you have pushed me in the right direction.
June 28, 2005, 12:25 AM
Piipster
DEFINES are calculated for each individual row.
If the first DEFINE didn't give you errors the value would always be 1.

Do you want to list all of the SSN's on the report?

If not, then do what Francis advised. The WHERE TOTAL says do the test after you add up the counts. This will list only the SSN's that appear more than once.

SUM CNT.SSN
BY SSN
WHERE TOTAL CNT.SSN GT 1

If you want to see all the SSN's then you don't need to do the WHERE. USe conditional styling to make the ones with dups stand out.
July 08, 2005, 03:41 PM
Kerry
Hi, are those suggestions helpful to you? Is this still an outstanding issue? Did you try the search on Focal Point?

Please check the following document and see if this is related to what you are looking for.

HOW TO LOCATE DUPLICATE RECORDS
http://techsupport.informationbuilders.com/sps/81071020.html

You will need to logon in order to access this document.

Hope this helps. Big Grin

Cheers,

Kerry
July 15, 2005, 06:47 PM
slfmr
Those suggestions are very helpful. I was trying to think of a way to do it in a define, but I am now actually using a whole report to do a count, so I think what was suggested will work. Thanks so much!!