To do that sort of thing the old way, you would put the actual record count logic in a separate .p and then pass the file name as a command line argument, i.e., not in parentheses. Then, it does a compile on the fly and binds in the file name as you intended.
But, with any remotely modern version of ABL, you would do this with a dynamic query.
But then, if you care about how fast you get the answer, use dbanalysis!