Is there a way to exclude records that are "marked for delete" in a physical file from my SQL COUNT(*)? The following SQL results in a count of 7 million. I would expect the 16 million number but that is not happening. I believe this is because the physical file is reusing deleted records (REUSEDLT). I have tried IS NOT NULL and other field comparisons, but always get the same number.
SELECT COUNT(*) FROM GANCMFILES/CCEKCPP
WHERE RRN(CCEKCPP) >= 1 AND RRN(CCEKCPP) <= 16164260
SELECT COUNT(*) FROM GANCMFILES/CCEKCPP
WHERE RRN(CCEKCPP) >= 1 AND RRN(CCEKCPP) <= 16164260
Comment