View previous topic :: View next topic
|
Author |
Message |
manikawnth
New User
Joined: 07 Feb 2007 Posts: 61 Location: Mumbai
|
|
|
|
Hi,
I want to know the total records present on a tape via batch program. Please any one tell if you have sample code for this in assembler? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Assuming you know the LRECL for the file, surely it is not that hard to write the assembler code to open the file, read a record, add 1 to a counter, and continue until you hit end of file. At that point, the counter contains the record count. |
|
Back to top |
|
|
manikawnth
New User
Joined: 07 Feb 2007 Posts: 61 Location: Mumbai
|
|
|
|
Thanks. Actually my mistake not to explain the problem clearly. recently all our physical volumes are moved to virtual tapes. 'Cos of this there are many Datasets (GDGs) which reside on multiple volumes.
DSN volume1 volume2
IBM.G001V00 123456 234567
IBM.G002V00 234567 567890
IBM.G003V00 345678 678901
IBM.G004V00 456789 789012
I know that a record is present in G002V00 DSN. I got the volume serial through LOCATE macro giving the dsn as input. i feed this DSN and Volser to RDJFCB macro and open the GDG and search sequentially for the record in volume1. When the record is not found, the read macro is still continuing reading the lastest generation and back... from G004-G003-G002 which is consuming lot of time. I used EODAD to find out the end of data. But still dint work.
My intention is if i know the record count in a particular volume. i increase the counter stop there and open the next volume.
Now please help me how i need to control the multi volume switching. Or i need to find the number of records during the tape opening itself...
Hope it is clear and thanks in advance. |
|
Back to top |
|
|
manikawnth
New User
Joined: 07 Feb 2007 Posts: 61 Location: Mumbai
|
|
|
|
Please tell me how to handle End of File (actually End of Volume) for this in assembler. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Suggest you speak with your tape management people. V-tapes are managed by the tape management system (i.e. CA-1).
If you really want to waste the resources to actually count records, suggest you use the sort product in use on your system - it will perform better than anything written as a training exercise. . . |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
As Dick has said, talk to your storage management people who will be able to give you a reasonable guesstimate for FB files, and not quite so reasonable for VB files. |
|
Back to top |
|
|
Bill Dennis
Active Member
Joined: 17 Aug 2007 Posts: 562 Location: Iowa, USA
|
|
|
|
Is your problem that you only want to read only G0002V00 dsn but all four generations are being read? |
|
Back to top |
|
|
manikawnth
New User
Joined: 07 Feb 2007 Posts: 61 Location: Mumbai
|
|
|
|
Yes Bill!!! THats the thing exactly what i need... |
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
If the DSNs are cataloged you should only need to allocate DSN=IBM.G0002V00,DISP=SHR When you read it you will get only that 1 generation. If you had allocated DSN=IBM,DISP=SHR without the generation you would get all generations of the GDG. |
|
Back to top |
|
|
Bill Dennis
Active Member
Joined: 17 Aug 2007 Posts: 562 Location: Iowa, USA
|
|
|
|
If you're going to modify the JFCB, be sure the JCL doesn't allocate a concatenation. As Douglas said, use a full, specific DSN not the GDG base name. |
|
Back to top |
|
|
manikawnth
New User
Joined: 07 Feb 2007 Posts: 61 Location: Mumbai
|
|
|
|
Thanks everyone,
But my requirement is that i have to search some records which are spread across the GDGs. I know the record key and the GDG name.
So for searching each record i am opening that particular GDG by modifying the VOLSER and DSN in JFCB.
I have to use the base GDG, 'coz if not i need to submit the job dynamically modifying the DSNs as per the search records.
Please let me know if you have any solution for this and once again thanks to everyone. |
|
Back to top |
|
|
|