Page 1 of 1
Count the number of records on tape file.
Posted: Tue Dec 06, 2022 12:45 pm
by Taran Bhatia
Hi,
Can we find out the number of records on a tape file, the condition is not to write a program in cobol or any other language. Tape file is huge and can contain up to 25 million records.
I have looked at SORT example, but I just need the count. I used sortout as dummy on a small file, but will it be a good idea for the huge file too, in terms of CPU usage.
Thanks
Re: Count the number of records on tape file.
Posted: Wed Dec 07, 2022 7:19 am
by Robert Sample
Does your site use a tape management system? If so, check to see if the tape management system can give you the number of blocks for the file? If so, simple arithmetic will give you a pretty close estimate of the records: block size divided by record length gives records per block times the number of blocks gives you an upper bound on the number of records. That would be adequate for almost any requirement for the record count.
Re: Count the number of records on tape file.
Posted: Fri Dec 09, 2022 5:59 pm
by Taran Bhatia
Yes, we use CA-Tape management tool. I have never used it as such but will try to find out what you have said.
Another thing, when a program reads the tape-file, does that do the same calculation as you've suggested, I mean like a SORT utility?
Re: Count the number of records on tape file.
Posted: Fri Dec 09, 2022 10:30 pm
by Robert Sample
SORT (no matter which program) actually reads every block in the tape file, deblocks the records, and proceeds from there.
Re: Count the number of records on tape file.
Posted: Sat Dec 10, 2022 12:02 pm
by Taran Bhatia
What does 'deblocks' mean? Please advise.
Re: Count the number of records on tape file.
Posted: Tue Dec 13, 2022 12:06 pm
by Arun Rajput
CA Tape management can give you the number of records, but I doubt you can use that number in a program. It's like using a tool=panel and looking at that number.