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

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


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
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:
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: 2358
Location: Israel

PostPosted: Tue Mar 24, 2009 1:17 pm
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
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
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: 400
Location: Mumbai

PostPosted: Wed Mar 25, 2009 9:39 am
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 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 FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top