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?
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 ENDThis message has been edited. Last edited by: <Mabel>,
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.
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.
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.
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
You will need to logon in order to access this document.
Hope this helps.
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!!
|Powered by Social Strata|