View previous topic :: View next topic
|
Author |
Message |
Vamshi Veludandi
New User
Joined: 17 Mar 2009 Posts: 27 Location: Bangalore
|
|
|
|
I have a PS file with huge amount of records in it and I need to get the total number of records using REXX.
I tried using STEM variables, but since it so huge I'm getting Memory allocation error.
Is it possible to get the job done, without using STEM variables and ISREDIT ?
A code snippet for the same would be much helpful.
Regards,
Vamshi |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Yes it would be possible, but EXECIO is not a great way to do it as it is quite inefficient for large data volumes.
You could read the file via IEBGENER or SORT, outputting to a dummy file, and then parse the SYSOUT / SYSPRINT output to get the count.
But why do you need to do this, if the creating programs were written correctly this information should already be known. |
|
Back to top |
|
|
kalyan418
New User
Joined: 03 Jan 2007 Posts: 2 Location: chennai
|
|
|
|
Is there any alternate way to do this reuirement using rexx |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Of course. Call SORT from rexx.
Here is a topic with some sort cards for counting.
Search here or the web for examples of using Sort from rexx. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
You could read one record at a time and count them or read a block of records at a time and accumulate totals. Drop the stem before doing the next read. Still a waste of resource when other utilities can do it much more efficiently. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
I have a PS file with huge amount of records in it and I need to get the total number of records using REXX. |
then REXX is not the best tool for it!
there are novemtrigintillion examples on the forum ( JCL or DFSORT ) on how to do it using <SORT> |
|
Back to top |
|
|
|