View previous topic :: View next topic
|
Author |
Message |
arul joseph
New User
Joined: 02 Feb 2010 Posts: 2 Location: chennai
|
|
|
|
hi,
please let me know if there is any specific keyword in Rexx to sort or to remove duplicates from a stem variable without going for any loop. if not then send me a sample code to do it using loop. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
Quote: |
if not then send me a sample code to do it using loop. |
what time do You want breakfast served in bed sir |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
if not then send me a sample code to do it using loop. |
The usual response is to quote a daily rate since the people who respond on this board are paid for their professional work product, which is what you are asking for. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Why not just invoke the sort product via REXX |
|
Back to top |
|
|
arul joseph
New User
Joined: 02 Feb 2010 Posts: 2 Location: chennai
|
|
|
|
hi Expat,
here my primary purpose is to remove duplicates from my stem variable. Also I'm not sorting the records directly from file.After getting some specific records into a stem variable i want to remove duplicates. So i thought this could be done only after sorting within stem and that's why I didn't want to invoke any JCL utility here. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
what happened when You googled for rexx stem sorting |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1744 Location: Tirupur, India
|
|
|
|
Quote: |
Why not just invoke the sort product via REXX |
IMHO I think this is the efficient solution. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
Quote: |
IMHO I think this is the efficient solution. |
we do not know enough details to judge...
all depends on the number of stem elements and the sort key |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1744 Location: Tirupur, India
|
|
|
|
I think REXX sort is shop specific and may not be present at all shops.
So invoking a SORT product could be a more reliable soltion. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
it is not that rexx SORT is shop specific, it is not there at all,
but as I pointed before there are many examples on the net on how to sort a stem
using different techniques, all it takes are about 20 lines of coding
but as I said before just asking how to sort a stem is not enough to give a good answer
to invoke the external sort You would need to write the data to a file,invoke sort, reread the data back ... |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1744 Location: Tirupur, India
|
|
|
|
Hi Enrico,
Quote: |
number of stem elements and the sort key |
Could you please let me know how the key length affects program sort and HOST sort ?.
I am aware that Host sort is effecient for large number of records and pgm sort effecient for small number of records.
I may be wrong IDK..
Thanks, |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
not really a performance issue, just a general coding concern
for a stem I would say that the key structure would be simple, the whole variable, or a simple substring of the variable
but again, until the TS does not tell more exactly the environment...
number of entries
structure of the key
everything is just pure speculation |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Sorting a stem .....................
Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaargh
In one instance there were 36,000 records to be sorted, and a user developed REXX code to sort these records was used, It took in excess of nine hours to sort this file by the sort logic employed.
I changed this to write the stem to an external dataset, invoked DFSORT, and then read it back into the same stem. The process took less than 20 seconds. Hence my suggestion to invoke your sort product via REXX.
Again - due to minimal information being made available from the poster we do not know if the file could be sorted or whatever BEFORE even seeing the REXX code.
Why oh why do the posters think that we know exactly what they want when they never tell us anything |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
enrico-sorichetti wrote: |
it is not that rexx SORT is shop specific, it is not there at all |
Not entirely true. You can purchase third-party extensions to the MVS libraries that include it; my shop has one.
Quote: |
but as I pointed before there are many examples on the net on how to sort a stem using different techniques, all it takes are about 20 lines of coding |
That is very true. The Rexx sort function that we have wouldn't be worth buying by itself, but it comes bundled with other, more useful stuff (BPAM and VSAM functions, supervisor services, etc.). |
|
Back to top |
|
|
|