Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts JOINKEYS Paired and Unpaired Sort on ... MFwhiz DFSORT/ICETOOL 7 Tue Nov 07, 2017 2:46 am
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us