View previous topic :: View next topic |
Author |
Message |
theenigma Beginner
Joined: 09 Jan 2003 Posts: 15 Topics: 6
|
Posted: Wed Feb 12, 2003 1:45 am Post subject: Finding out the Number of Records on a Tape File |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12370 Topics: 75 Location: San Jose
|
Posted: Wed Feb 12, 2003 6:54 am Post subject: |
|
|
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 |
|
|
Himesh CICS Forum Moderator
Joined: 20 Dec 2002 Posts: 80 Topics: 21 Location: Chicago
|
Posted: Wed Feb 12, 2003 11:05 pm Post subject: |
|
|
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 |
|
|
theenigma Beginner
Joined: 09 Jan 2003 Posts: 15 Topics: 6
|
Posted: Fri Feb 14, 2003 1:50 am Post subject: |
|
|
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 !!!!
Thanks
Enigma |
|
Back to top |
|
|
Dibakar Advanced
Joined: 02 Dec 2002 Posts: 699 Topics: 63 Location: USA
|
Posted: Fri Feb 14, 2003 4:43 am Post subject: |
|
|
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 |
|
|
theenigma Beginner
Joined: 09 Jan 2003 Posts: 15 Topics: 6
|
Posted: Fri Feb 14, 2003 5:47 am Post subject: |
|
|
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 |
|
|
DaveyC Moderator
Joined: 02 Dec 2002 Posts: 151 Topics: 3 Location: Perth, Western Australia
|
Posted: Fri Feb 14, 2003 9:58 am Post subject: |
|
|
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 |
|
|
Himesh CICS Forum Moderator
Joined: 20 Dec 2002 Posts: 80 Topics: 21 Location: Chicago
|
Posted: Tue Feb 18, 2003 4:36 am Post subject: |
|
|
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!
regards,
Himesh |
|
Back to top |
|
|
DaveyC Moderator
Joined: 02 Dec 2002 Posts: 151 Topics: 3 Location: Perth, Western Australia
|
Posted: Tue Feb 18, 2003 6:58 am Post subject: |
|
|
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 |
|
|
DaveyC Moderator
Joined: 02 Dec 2002 Posts: 151 Topics: 3 Location: Perth, Western Australia
|
Posted: Tue Feb 18, 2003 8:14 am Post subject: |
|
|
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 |
|
|
Ray D Beginner
Joined: 19 Feb 2003 Posts: 1 Topics: 0 Location: Monroeville PA
|
Posted: Wed Feb 19, 2003 12:02 pm Post subject: |
|
|
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 |
|
|
Frank Yaeger Sort Forum Moderator
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Wed Feb 19, 2003 12:35 pm Post subject: |
|
|
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 |
|
|
|
|