DUPKEYS MAX



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

DUPKEYS MAX

Postby Prakash88 » Wed Oct 23, 2013 7:21 pm

Hi,

I need to retrieve MAX records based on two columns.

Please find my input.
Input :
A Date1 30
A Date2 40
A Date2 50
B Date1 10
B Date1 20

//SYSIN DD *
SORT FIELDS=(1,1,CH,A)
DUPKEYS MAX=(3,5,CH,9,2,ZD)
/*

Expected output :
A Date2 50
B Date1 20

It is not allowing me to give two columns in DUPKEYS MAX . Please help me.
Prakash88
 
Posts: 8
Joined: Fri Jun 21, 2013 5:41 pm
Has thanked: 2 times
Been thanked: 0 time

Re: DUPKEYS MAX

Postby NicC » Wed Oct 23, 2013 7:28 pm

You cannot do this with JCL and I presume you actually want to do it using your sort product. If this is so then let us know which sort product do you use and your post will be moved to the appropriate part of the forum.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: DUPKEYS MAX

Postby Akatsukami » Wed Oct 23, 2013 7:30 pm

Why would your output not contain
A Date1 30
?
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: DUPKEYS MAX

Postby Prakash88 » Thu Oct 24, 2013 11:22 am

I am using syncsort.

Why would your output not contain
A Date1 30

Assume date1 is day1. date2 is day2.
I always want to get latest date .
Prakash88
 
Posts: 8
Joined: Fri Jun 21, 2013 5:41 pm
Has thanked: 2 times
Been thanked: 0 time

Re: DUPKEYS MAX

Postby Prakash88 » Thu Oct 24, 2013 11:56 am

A slight change in the example given in my first post.

Input :
A Date1 70
A Date2 40
A Date2 50
B Date1 10
B Date1 20


Output :
A Date2 50
B Date1 10
B Date1 20

Can this be achieved using DUPKEYS command ?
Prakash88
 
Posts: 8
Joined: Fri Jun 21, 2013 5:41 pm
Has thanked: 2 times
Been thanked: 0 time

Re: DUPKEYS MAX

Postby BillyBoyo » Thu Oct 24, 2013 2:16 pm

You need to show the full details of what you tried, including the sysout. In the Code tags, please.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post