using Compare Data tool

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
vanndy
Posts: 30
Joined: May 10th, 2012, 10:45 pm

using Compare Data tool

Post by vanndy »

Hello,

in Compare Data tool, it shows the different data between 2data files that were compared.
How can we count the case that have different data and the same data?

Best regards,

Vanndy
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: using Compare Data tool

Post by Gregory Martin »

There is no way to determine this information directly from the Compare Data tool, but you can process the Compare Data listing file and count the number of cases that had errors. You can identify these cases by searching for the [ bracket that begins a section of differences. Here is how, with a batch application, you could process this listing file:
PROC GLOBAL

file listingFile;

alpha (300) str;

PROC READCSDIFFLISTING_FF

preproc

    
numeric numDiffCases;

    
do while fileread(listingFile,str)
    
        
if pos("[",str) = 1 then // listing a new ID where there were differences
            inc(numDiffCases);
        
endif;
    
    
enddo;
    
    
errmsg("There were %d cases with differences.",numDiffCases);
If you wanted to count the cases, you could add your dictionary file as an external dictionary to this batch application and count the cases, like this:
    // count the number of cases in one of the files
    
    
numeric numCases;
    
    
while loadcase(CEN2000) do
        
inc(numCases);
    
enddo;
    
    
    
errmsg("There were %d cases (of %d) with differences, or %d%.",numDiffCases,numCases,100 * numDiffCases / numCases);
See attached for this application.
Attachments
readCSDiffListing.zip
(9.74 KiB) Downloaded 377 times
Post Reply