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

Can you explain how the SORT will do internally


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Thu Nov 24, 2005 9:57 pm
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:

Use [URL] BBCode for External Links
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top