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
using Compare Data tool
-
- Posts: 1808
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: using Compare Data tool
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: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);
// 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.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);
- Attachments
-
- readCSDiffListing.zip
- (9.74 KiB) Downloaded 388 times