View previous topic :: View next topic |
Author |
Message |
sateesh_gontla Beginner
Joined: 23 Jan 2004 Posts: 40 Topics: 16 Location: Bangalore
|
Posted: Fri Apr 20, 2007 8:50 am Post subject: Total No of records in a Dataset using REXX |
|
|
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 |
|
 |
expat Intermediate

Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
|
Posted: Fri Apr 20, 2007 9:00 am Post subject: |
|
|
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 |
|
 |
sateesh_gontla Beginner
Joined: 23 Jan 2004 Posts: 40 Topics: 16 Location: Bangalore
|
Posted: Fri Apr 20, 2007 9:04 am Post subject: |
|
|
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 |
|
 |
expat Intermediate

Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
|
Posted: Fri Apr 20, 2007 9:28 am Post subject: |
|
|
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 |
|
 |
sateesh_gontla Beginner
Joined: 23 Jan 2004 Posts: 40 Topics: 16 Location: Bangalore
|
Posted: Fri Apr 20, 2007 9:34 am Post subject: |
|
|
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 |
|
 |
expat Intermediate

Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
|
Posted: Fri Apr 20, 2007 9:41 am Post subject: |
|
|
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 |
|
 |
superk Advanced

Joined: 19 Dec 2002 Posts: 684 Topics: 5
|
Posted: Fri Apr 20, 2007 9:55 am Post subject: |
|
|
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 |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Fri Apr 20, 2007 10:04 am Post subject: |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Fri Apr 20, 2007 10:26 am Post subject: |
|
|
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 |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Fri Apr 20, 2007 10:47 am Post subject: |
|
|
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 |
|
 |
BarneyBadass Beginner
Joined: 09 Apr 2007 Posts: 10 Topics: 1
|
Posted: Fri Apr 20, 2007 6:35 pm Post subject: |
|
|
/*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 |
|
 |
expat Intermediate

Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
|
Posted: Sat Apr 21, 2007 5:50 am Post subject: |
|
|
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 |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Sat Apr 21, 2007 12:47 pm Post subject: |
|
|
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 |
|
 |
acevedo Beginner

Joined: 03 Dec 2002 Posts: 127 Topics: 0 Location: Europe
|
Posted: Sun Apr 22, 2007 3:40 pm Post subject: |
|
|
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 |
|
 |
BarneyBadass Beginner
Joined: 09 Apr 2007 Posts: 10 Topics: 1
|
Posted: Tue Apr 24, 2007 3:31 pm Post subject: |
|
|
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 |
|
 |
|
|