MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Total No of records in a Dataset using REXX
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
sateesh_gontla
Beginner


Joined: 23 Jan 2004
Posts: 40
Topics: 16
Location: Bangalore

PostPosted: Fri Apr 20, 2007 8:50 am    Post subject: Total No of records in a Dataset using REXX Reply with quote

Hi,

I need total no of records in a dataset by typing some command infront of the dataset using REXX. Is it possible ?


Thanks.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Fri Apr 20, 2007 9:00 am    Post subject: Reply with quote

It is, but using SORT or ICECOPY is far more efficient and faster.

And, these can be invoked by REXX.
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
sateesh_gontla
Beginner


Joined: 23 Jan 2004
Posts: 40
Topics: 16
Location: Bangalore

PostPosted: Fri Apr 20, 2007 9:04 am    Post subject: Reply with quote

expat,

We need a solution like this ....when you type S infront of Dataset it gives you the details of the Dataset right.... like that we need to have some sort of handy command to do that ....may behind we might run some REXX scripts ....any idea of that ....
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Fri Apr 20, 2007 9:28 am    Post subject: Reply with quote

It is possible, using REXX will use a lot more resource than SORT or ICEGENER. I have not got the time to even think about it too much now.

Why do you need to know the number of records ?
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
sateesh_gontla
Beginner


Joined: 23 Jan 2004
Posts: 40
Topics: 16
Location: Bangalore

PostPosted: Fri Apr 20, 2007 9:34 am    Post subject: Reply with quote

expat,

If you have a solution, please help in this. I think your question "Why do you need to know the number of records ? " doesn't make any sense for me...

Thanks.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Fri Apr 20, 2007 9:41 am    Post subject: Reply with quote

What is the reason that you need to know the number of records in a dataset.
Or - do you just need to know if the dataset is empty or not ?
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Fri Apr 20, 2007 9:55 am    Post subject: Reply with quote

Jeez, what a snotty attitude of the O/P!

I concur with expat. You don't want to use REXX to read and count records one-by-one. Call SORT and just read the resulting ouput. It's much more efficient.
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Fri Apr 20, 2007 10:04 am    Post subject: Reply with quote

Sounds like you want to create a new TSO command. I was skimming the book by AS Rudd yesterday and there are examples in there. I guess if it is in there then the information is in the manuals as well.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Apr 20, 2007 10:26 am    Post subject: Reply with quote

sateesh_gontla wrote:
expat,

If you have a solution, please help in this. I think your question "Why do you need to know the number of records ? " doesn't make any sense for me...

Thanks.


sateesh_gontla,

The people are trying to help and for very good reasons REXX is NOT the idle tool for counting lines in a file. For small files it is ok , but for huge files you will have problems. Also you will have problems with GDG's and Tape files. That's the exact reason as to why they are stressing and you seem to be a hot head and picking a fight who are really trying to help you. Keep this up and you will find no one answer to your queries.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Fri Apr 20, 2007 10:47 am    Post subject: Reply with quote

sateesh_gontla,

you are the second person in as many days that has not been satisfied by the answer and had a tantrum.

if you had explained your situation in detail (which you still have not done!!!) you could receive some specific answers. Your wish needs to be better defined. Is this for test or production? pgmrs or operations staff? even though you may not care, those of us with a little experience know that differing environments require different solutions.

If this is for operations staff and/or for production requirements, then more resource intensive methods could be employed. the reverse is true, also: if this is for programmers and or the test environment - the least resource intensive solution would be implemented by a professional.

obviously, we are not talking about pds's.

are these VSAM or QSAM?
If QSAM, are they all fixed length?

VSAM, after a reorg, maintains the record count in the catelogue.
The number of QSAM fixed length can be calculated based on the file attributes - again in the catelogue.
QSAM variable length obviously must be counted.


since file size only changes during processing of the file, (CICS only deals with VSAM, not qsam):

any JCL that would invoke processes that would change the record count , could have a STEP inserted which would count the records and post to a centralized file. So, you could then have a centralized file (db, table, anything) which would contain the 'record count' of any/all files processed.

Now, when you entered your magic 'Record Count' command, instead of invoking a potentially intensive process you would access your centralized file containing all of your statistics.

see, that's not too hard. Derivatives of the above process are running on the production side of many shops that I know. used it to build dynamic estimated size parms for sort.

you don't need real-time solutions to everything. If the record count for a file has not changed in three hours, why count it every time somebody needs this valuable info?

I see kolusu was quicker than I. But I decided to leave this post for the benefit of others; not as a solution, but as a philosophy. Do what needs to be done, but just do it once!

And, you do have the magic command - BROWSE - then look to the upper right and see how many lines.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
BarneyBadass
Beginner


Joined: 09 Apr 2007
Posts: 10
Topics: 1

PostPosted: Fri Apr 20, 2007 6:35 pm    Post subject: Reply with quote

/*rexx*/
parse arg src_in
if src_in = '' then src_in ='some_dataset''

stem.0 = 0

"alloc fi(in) da('"src_in"') shr reu "
/* "alloc fi(in) shr reu " */
"EXECIO * DISKR in (STEM some_stem. FINIS"
"free fi (in)"
say
say 'there are 'some_stem.0' records dsn: 'src_in
say
exit
Back to top
View user's profile Send private message
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Sat Apr 21, 2007 5:50 am    Post subject: Reply with quote

Code:

/*rexx*/
parse arg src_in
if src_in = '' then src_in ='some_dataset''

stem.0 = 0

"alloc fi(in) da('"src_in"') shr reu "
/* "alloc fi(in) shr reu " */
"EXECIO * DISKR in (STEM some_stem. FINIS"
"free fi (in)"
say
say 'there are 'some_stem.0' records dsn: 'src_in
say
exit

And what if the file contains millions and millions of records ?

This is exactly why ICEGENER and SORT were suggested.
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Sat Apr 21, 2007 12:47 pm    Post subject: Reply with quote

instead of a SAY, which would interrupt the panel display with a native TSO screen, why not use SETMSG and stay within the PANEL?

Code:

zedmsg = some_stem.0
zedlmsg = 'Num Records in: ' src_in
ISPEXEC SETMSG MSG(ISRZ000)

_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
acevedo
Beginner


Joined: 03 Dec 2002
Posts: 127
Topics: 0
Location: Europe

PostPosted: Sun Apr 22, 2007 3:40 pm    Post subject: Reply with quote

sateesh_gontla wrote:
expat,

If you have a solution, please help in this. I think your question "Why do you need to know the number of records ? " doesn't make any sense for me...

Thanks.


so your question...does NOT make sense for us


for me, the big problem, as Kolusu said, is the case of big/huge files...and as expat said this is why sort (or any other tools) is recommended.
Back to top
View user's profile Send private message
BarneyBadass
Beginner


Joined: 09 Apr 2007
Posts: 10
Topics: 1

PostPosted: Tue Apr 24, 2007 3:31 pm    Post subject: Reply with quote

I agree; it's not perfect; but it did answer the question about how many records are in a dataset ... within reason of course.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group