There is a requirement to know the exact numbers of records in a mainframe dataset. In such scenario, IBM sort utility ICETool have a COUNT function that is more opted.
There are some other tips also,
If the file is fixed or fixed block, I would go to ISPF option 3.2, ask for information on the file and divide the space that it takes up by the LRECL
If the file is so large that ISPF is problematical, I use SORT with SYSIN as SORT FIELDS=COPY and SORTOUT going to DUMMY. The record count will be in SYSPRINT


