Count the number of records on tape file.

Other Mainframe related questions which attracts you and there is no suitable Forum you find for it and related FAQs.
Post Reply
Taran Bhatia
Registered Member
Posts: 15
Joined: Wed Oct 22, 2014 8:51 am

Count the number of records on tape file.

Post 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
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Count the number of records on tape file.

Post 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.
Taran Bhatia
Registered Member
Posts: 15
Joined: Wed Oct 22, 2014 8:51 am

Re: Count the number of records on tape file.

Post 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?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Count the number of records on tape file.

Post by Robert Sample »

SORT (no matter which program) actually reads every block in the tape file, deblocks the records, and proceeds from there.
Taran Bhatia
Registered Member
Posts: 15
Joined: Wed Oct 22, 2014 8:51 am

Re: Count the number of records on tape file.

Post by Taran Bhatia »

What does 'deblocks' mean? Please advise.
Arun Rajput
New Member
Posts: 9
Joined: Tue Jan 20, 2015 8:40 am
India

Re: Count the number of records on tape file.

Post 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.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “Other Mainframe Topics, Off-Topics, FAQs.”