Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Total records on a tape

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Total records on a tape
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: 7996
Location: Bellevue, IA

PostPosted: Fri Jul 31, 2009 3:08 am    Post subject:
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Fri Jul 31, 2009 7:17 am    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Fri Jul 31, 2009 11:35 am    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us