Not a direct answer: how about doing a RUNSTATS and then looking at the cardinality in the system catalog views?
Regarding the actual question: you need dynamic SQL in the procedure to build the SELECT COUNT(*) queries against the different tables, then execute this query and fetch the result. That's straight-forward SQL. Give it a try and if you get stuck, we can work on the details.