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
 

 

How to get the number of records in a file with out opening

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
sai.dara

New User


Joined: 24 Aug 2007
Posts: 12
Location: Hyderabad

PostPosted: Tue Mar 24, 2009 12:26 pm    Post subject: How to get the number of records in a file with out opening
Reply with quote

Hi Friends,

Good Morning!

I am in need of getting the number of records in a file. But I do not have access to open the file. Can I get the exact count using REXX or IBM SYS tables or VTOC data.

I could retrieve the Block size, space used, space allocated using REXX.

In the same way can I get the exact record count ?

Thanks in advance,

thanks and Regards,
sai
Back to top
View user's profile Send private message

Succor

New User


Joined: 20 Feb 2009
Posts: 96
Location: Bangalore :)

PostPosted: Tue Mar 24, 2009 12:48 pm    Post subject: Reply to: How to get the number of records in a file with ou
Reply with quote

Sai,I dont think you would be able to achieve it without opening and reading the file.
Go through this link ,it might help:
http://www.ibmmainframes.com/post-36072.html

WTF
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue Mar 24, 2009 1:17 pm    Post subject:
Reply with quote

You can write an algorithm to calculate the number of records in a sequential dataset based on it's attributes: LRECL, BLKSIZE, %USED etc. However, this won't work for all cases, and it's pretty complex to achieve.

O.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Mar 24, 2009 2:25 pm    Post subject:
Reply with quote

if you don't have authority to access the file, why are you doing record counts?
Back to top
View user's profile Send private message
diwa_thilak

Active User


Joined: 13 Jul 2006
Posts: 205
Location: At my desk

PostPosted: Wed Mar 25, 2009 2:07 am    Post subject:
Reply with quote

Sai,

You can check the below links

Count number of Lines in a file
Finding number of records

if the file is of high volume i would not recommend to use REXX/CLIST.

Please use the search button in the forum, you will find similar posts answered earlier.
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 401
Location: Mumbai

PostPosted: Wed Mar 25, 2009 9:39 am    Post subject:
Reply with quote

in 99.999+% of the cases, there is no way to do this accurately without reading the data sets. You might be able to do this for fixed block standard (FBS) data sets if you can be assured that there are no short blocks, but the last block is almost always short. DS1LSTAR (part of the DSCB) might help with that, but since almost no one uses FBS data sets, I doubt that even matters.
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
This topic is locked: you cannot edit posts or make replies. Natural ADABAS Opening with CTS enikhilk Mainframe Jobs 0 Wed Nov 30, 2016 5:37 pm


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