For VSAM/ or IAM files a LISTCAT will give you this although it’s only accurate when the file is closed properly. Other catalog scanning tools like FDREPORT or Catalog Solutions will also provide this information. You can also use IDCAMS PRINT, EXAMINE and perhaps something like SAS or REXX tools to scan the files and provide a count.
For QSAM you have to literally scan the files with the likes of IDCAMS PRINT, EXAMINE and perhaps something like SAS or REXX tools to scan the files and provide a count. For a very basic approach you could calculate the files size in bytes (56664 x trks allocated to it) and divide by the LRECL, but this won’t be accurate for compressed files.
This is entirely dependant on the application requirements. However these days with Extended Format you can have up to 59*123 extents so as long as you have a reasonable sized secondary allocation it’s not so crucial. Note that multi-volume files do incur an overhead on the TIOT of around 4k per volume. Essentially normal practice would be to make the primary large enough to contain the expected number of records, and secondary should cater for expected growth up to the maximum. If you’re using compression Dataclases though you can usually fairly safely assume a minimum 30% reduction in the size requirement. You can experiment with some example data in test…sometimes compressions can be over 90% depending on the data format.
Tape datasets to DASD.
Multiply the tape dataset LRECL by the record count and divide by 56664 for number of tracks, or divide by 1048576 for megabytes. The tape info is usually available the tape management product like CA1 or TLMS, not sure about others like RMM. Often tape datasets are very large so ensure their DASD equivalent gets a Dataclas providing a) Space Constraint Relief to add further volumes as required, and b) provide compression if the overhead from this acceptable.