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

sorting and removing duplicates from a stem variable


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
arul joseph

New User


Joined: 02 Feb 2010
Posts: 2
Location: chennai

PostPosted: Tue Feb 02, 2010 6:00 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Feb 02, 2010 6:10 pm
Reply with quote

Quote:
if not then send me a sample code to do it using loop.

what time do You want breakfast served in bed sir icon_question.gif icon_evil.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Feb 02, 2010 6:16 pm
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Feb 02, 2010 6:23 pm
Reply with quote

www.ibmmainframes.com/viewtopic.php?t=36461&highlight=sort+stem+variable
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Feb 02, 2010 6:42 pm
Reply with quote

Why not just invoke the sort product via REXX
Back to top
View user's profile Send private message
arul joseph

New User


Joined: 02 Feb 2010
Posts: 2
Location: chennai

PostPosted: Tue Feb 02, 2010 7:13 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Feb 02, 2010 7:17 pm
Reply with quote

what happened when You googled for rexx stem sorting
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Tue Feb 02, 2010 8:07 pm
Reply with quote

Quote:
Why not just invoke the sort product via REXX


IMHO I think this is the efficient solution.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Feb 02, 2010 8:14 pm
Reply with quote

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
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Tue Feb 02, 2010 8:18 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Feb 02, 2010 8:22 pm
Reply with quote

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
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Tue Feb 02, 2010 8:24 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Feb 02, 2010 8:31 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Feb 02, 2010 10:02 pm
Reply with quote

Sorting a stem .....................

Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaargh icon_eek.gif

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 icon_cry.gif
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Tue Feb 02, 2010 11:28 pm
Reply with quote

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
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
No new posts parsing variable length/position data... DFSORT/ICETOOL 5
Search our Forums:

Back to Top