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
 

 

Can you explain how the SORT will do internally

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
k_kirru
Currently Banned

New User


Joined: 14 Sep 2005
Posts: 16

PostPosted: Thu Nov 24, 2005 4:19 pm    Post subject: Can you explain how the SORT will do internally
Reply with quote

Hi,
I am using the following sysntax to eliminate the duplicates.
SORT FILEDS=(1,6,A),FORMAT=BI
SORT FIELDS=NONE

The I/P file is

111111 1
111112 1
111113 1
111114 1
111115 1
111111 2
111112 2
111113 2
111114 2
111115 2
111111 3
111112 3
111113 3
111114 3
111115 3

The O/P file i got is

111111 1
111112 2
111113 1
111114 2
111115 1

Here my problem is how the sort technique is doing internally because the
customers 11111,111113 and 111115 have selected from first sequence and remaining two cusomers are selected from next seq.
Really i couldnt understand how the SORT will do internally.
Here my problem is i am having all the customers in one file for 12 months, so here some times customer no's are duplicate. so i need to select latest customer.
Can anyone help out how to sort this prob.
Thanks in advance.

Regards,
Kiran
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Nov 24, 2005 9:57 pm    Post subject:
Reply with quote

When EQUALS is in effect with SUM FIELDS=NONE, DFSORT selects the first record of each set of duplicates. When EQUALS is not in effect with SUM FIELDS=NONE, DFSORT can select any record of each set of duplicates. So if you add:

Code:

    OPTION EQUALS


you'll get the first record of each set of duplicates.

Quote:
so i need to select latest customer.


If by the "latest" customer, you mean the last record of each set of duplicates, you can use a DFSORT/ICETOOL job like this:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...  input file
//OUT DD DSN=...  output file
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,6,BI) LAST
/*


For your example, OUT will have:

Code:

111111 3 
111112 3 
111113 3 
111114 3 
111115 3 


If that's not what you want, then you need to explain clearly what you do want and show an example of the input records and what you want for output.

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
Back to top
View user's profile Send private message
k_kirru
Currently Banned

New User


Joined: 14 Sep 2005
Posts: 16

PostPosted: Fri Nov 25, 2005 12:03 pm    Post subject: Re: Can you explain how the SORT will do internally
Reply with quote

Hi Frank Yaeger,

Very much Thanks for your suggestion, my problem has got solved from your code .
Once again thank you very much.

Regards,
kiran.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm


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