MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Finding out the Number of Records on a Tape File

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
theenigma
Beginner


Joined: 09 Jan 2003
Posts: 15
Topics: 6

PostPosted: Wed Feb 12, 2003 1:45 am    Post subject: Finding out the Number of Records on a Tape File Reply with quote

Is there a simple Way of finding the number of records(without the help of eztrieve or cobol). The Tape file contains anywhere between 6 million and 20 million records.

Sort would do, but, i just need the count, having a sortout or having the sortout dummy'ed would not be a good idea.As it takes the same time(few precious mainframe hrs)

Thanks
Enigma
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Wed Feb 12, 2003 6:54 am    Post subject: Reply with quote

theenigma,

I don't think there is any simple way to get the total no: of records without reading the entire file.

But if the file has a trailer record with the no: of records in the file , then we can use file-aid's COPYBACK option to read only the last record of the file.

Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Himesh
CICS Forum Moderator
CICS Forum Moderator


Joined: 20 Dec 2002
Posts: 80
Topics: 21
Location: Chicago

PostPosted: Wed Feb 12, 2003 11:05 pm    Post subject: Reply with quote

theenigma,

maybe the REXX gurus can help.

The file could be opened using a REXX program in BROWSE mode(it's faster that way), then get the line number of the last line.

regards,
Himesh
Back to top
View user's profile Send private message Yahoo Messenger
theenigma
Beginner


Joined: 09 Jan 2003
Posts: 15
Topics: 6

PostPosted: Fri Feb 14, 2003 1:50 am    Post subject: Reply with quote

Himesh,

It would not help, REXX cannot open the File just as we cant, as it is a Tape File.

Everyone,

Iam forced to use an Eztrieve Program and it is taking me almost an hour each time.

Folks, cant there be a simpler way Sad !!!!


Thanks
Enigma
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 699
Topics: 63
Location: USA

PostPosted: Fri Feb 14, 2003 4:43 am    Post subject: Reply with quote

Assuming the worst case, there are no such methods, can it be done that -

1: Bisection method - Try to read the billionth record. If it is EOF then read half billionth billionth record else read two billionth record and repeat till you have reached the last record. I feel, this would be much faster than reading all.

2: As already suggested - Keep a stat record or file which will just tell the number of records in the tape and gets updated whenever the tape is updated.

Dibakar
Back to top
View user's profile Send private message Send e-mail
theenigma
Beginner


Joined: 09 Jan 2003
Posts: 15
Topics: 6

PostPosted: Fri Feb 14, 2003 5:47 am    Post subject: Reply with quote

Dibakar,

What you forgot is, Tapes are Sequentail Devices, and you can reach the billionth record only after reading thru the (billion -1) records in front.

That doesnt help, nor does the second method, the tape is already there and i need to do it now. As i said, i already managed with sort, but is very time consuming!!!

anyway, Thanks for ur help
Enigma
Back to top
View user's profile Send private message
DaveyC
Moderator


Joined: 02 Dec 2002
Posts: 151
Topics: 3
Location: Perth, Western Australia

PostPosted: Fri Feb 14, 2003 9:58 am    Post subject: Reply with quote

I don't know how accurate it is, but you can get the block count from the label of the tape. You can then calculate the records per block and have an approximate count of the amount of records.

If you have a TMS system like CA-1 you can use the online interface to get this information so you don't have to run a batch job. If I remember correctly, you will need to specify BLP in the label keyword of the JCL. Some sites block this facility with RACF.

Himesh, I can't think of a worse language for counting records than REXX. It's not as powerful as it's reputation.
_________________
Dave Crayford
Back to top
View user's profile Send private message Send e-mail
Himesh
CICS Forum Moderator
CICS Forum Moderator


Joined: 20 Dec 2002
Posts: 80
Topics: 21
Location: Chicago

PostPosted: Tue Feb 18, 2003 4:36 am    Post subject: Reply with quote

Dave,

I just took a wild shot.....

Was just interested in knowing
1. If the file could be opened using a REXX program
2. Issue an "M PF8" or "BOT" command
3. Get the line number of the last record.

This sounds easy doesn't it! Laughing

regards,
Himesh
Back to top
View user's profile Send private message Yahoo Messenger
DaveyC
Moderator


Joined: 02 Dec 2002
Posts: 151
Topics: 3
Location: Perth, Western Australia

PostPosted: Tue Feb 18, 2003 6:58 am    Post subject: Reply with quote

Quote:
Is it possible to open a file on Tape in Option 1, 2 or 3.4 of ISPF Primary Menu? Or even using File-Aid?


No...
_________________
Dave Crayford
Back to top
View user's profile Send private message Send e-mail
DaveyC
Moderator


Joined: 02 Dec 2002
Posts: 151
Topics: 3
Location: Perth, Western Australia

PostPosted: Tue Feb 18, 2003 8:14 am    Post subject: Reply with quote

AFAIK, you can use DITTO to display tape records in full screen mode. But that would not solve your problem, as you would still have to read every record on the tape to know the number of records. It would be a very silly thing to do.

Anyway, all this counting records is a bit silly. I would just keep a catalog of the file and how many records were written to it.
_________________
Dave Crayford
Back to top
View user's profile Send private message Send e-mail
Ray D
Beginner


Joined: 19 Feb 2003
Posts: 1
Topics: 0
Location: Monroeville PA

PostPosted: Wed Feb 19, 2003 12:02 pm    Post subject: Reply with quote

I know of no way to get a record count from a tape without reading it and I've been in the business 35 years. What we do at my site is use IDCAMS to repro it to a "DD DUMMY" File. IDCAMS gives you the number of records read.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Wed Feb 19, 2003 12:35 pm    Post subject: Reply with quote

Enigma,

When you say "Sort would do", do you mean you're using a copy to get the count, or a sort to get the count? Copy is much faster than sort, so if you're using a sort, try a copy instead. "Hours" for a copy job doesn't sound right to me. Try this DFSORT/ICETOOL job that just returns the count of the records in TOOLMSG (it does input I/O, but no output I/O):

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...   input file
//TOOLIN DD *
  COUNT FROM(IN)
/*


See if the time is acceptable using DFSORT/ICETOOL that way (if that's not what you're already doing).
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group