Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

sorting and removing duplicates from a stem variable

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: sorting and removing duplicates from a stem variable
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Tue Feb 02, 2010 6:10 pm    Post subject: Reply to: sorting and removing duplicates from a stem variab
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: 7904
Location: Bellevue, IA

PostPosted: Tue Feb 02, 2010 6:16 pm    Post subject:
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    Post subject:
Reply with quote

http://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: 8593
Location: Back in jolly old England

PostPosted: Tue Feb 02, 2010 6:42 pm    Post subject:
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    Post subject: Reply to: sorting and removing duplicates from a stem variab
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Tue Feb 02, 2010 7:17 pm    Post subject: Reply to: sorting and removing duplicates from a stem variab
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: 1445
Location: Azeroth

PostPosted: Tue Feb 02, 2010 8:07 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Tue Feb 02, 2010 8:14 pm    Post subject: Reply to: sorting and removing duplicates from a stem variab
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: 1445
Location: Azeroth

PostPosted: Tue Feb 02, 2010 8:18 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Tue Feb 02, 2010 8:22 pm    Post subject: Reply to: sorting and removing duplicates from a stem variab
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: 1445
Location: Azeroth

PostPosted: Tue Feb 02, 2010 8:24 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Tue Feb 02, 2010 8:31 pm    Post subject: Reply to: sorting and removing duplicates from a stem variab
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: 8593
Location: Back in jolly old England

PostPosted: Tue Feb 02, 2010 10:02 pm    Post subject:
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: 1738
Location: Bloomington, IL

PostPosted: Tue Feb 02, 2010 11:28 pm    Post subject: Re: Reply to: sorting and removing duplicates from a stem va
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Updating the counters after eliminati... PANDU1 DFSORT/ICETOOL 12 Mon Nov 21, 2016 9:47 am
No new posts Efficient sorting chandracdac DFSORT/ICETOOL 5 Sat Oct 22, 2016 3:23 am
No new posts Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm
No new posts Stripping and Sorting of VB file G SRINIVASA RAO SYNCSORT 5 Wed Sep 14, 2016 1:34 pm
No new posts Removing Extra Spaces in a comma sepa... Puspojit DFSORT/ICETOOL 3 Tue Sep 13, 2016 7:46 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us