IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Total records on a tape


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
manikawnth

New User


Joined: 07 Feb 2007
Posts: 61
Location: Mumbai

PostPosted: Fri Jul 31, 2009 2:23 am
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Fri Jul 31, 2009 3:08 am
Reply with quote

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
View user's profile Send private message
manikawnth

New User


Joined: 07 Feb 2007
Posts: 61
Location: Mumbai

PostPosted: Fri Jul 31, 2009 4:48 am
Reply with quote

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
View user's profile Send private message
manikawnth

New User


Joined: 07 Feb 2007
Posts: 61
Location: Mumbai

PostPosted: Fri Jul 31, 2009 4:50 am
Reply with quote

Please tell me how to handle End of File (actually End of Volume) for this in assembler.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jul 31, 2009 7:17 am
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Jul 31, 2009 11:35 am
Reply with quote

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
View user's profile Send private message
Bill Dennis

Active Member


Joined: 17 Aug 2007
Posts: 562
Location: Iowa, USA

PostPosted: Fri Jul 31, 2009 7:21 pm
Reply with quote

Is your problem that you only want to read only G0002V00 dsn but all four generations are being read?
Back to top
View user's profile Send private message
manikawnth

New User


Joined: 07 Feb 2007
Posts: 61
Location: Mumbai

PostPosted: Fri Jul 31, 2009 9:14 pm
Reply with quote

Yes Bill!!! THats the thing exactly what i need...
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Fri Jul 31, 2009 9:25 pm
Reply with quote

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
View user's profile Send private message
Bill Dennis

Active Member


Joined: 17 Aug 2007
Posts: 562
Location: Iowa, USA

PostPosted: Fri Jul 31, 2009 11:30 pm
Reply with quote

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
View user's profile Send private message
manikawnth

New User


Joined: 07 Feb 2007
Posts: 61
Location: Mumbai

PostPosted: Fri Jul 31, 2009 11:50 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Deleting a Tape file JCL & VSAM 14
Search our Forums:

Back to Top