DUPKEYS MAX

Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL
Prakash88
Posts: 8
Joined: Fri Jun 21, 2013 5:41 pm
Skillset: MF JCL COBOL DB2
Referer: Internet

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.

NicC
Global moderator
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Skillset: JCL, PL/1, Rexx, Utilities and to a lesser extent (i.e. I have programmed using them) COBOL,DB2,IMS
Referer: Google
Location: Pushing up the daisies (almost)

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

User avatar
Akatsukami
Global moderator
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Skillset: Rexx, JCL, DB2/SQL, TSO/ISPF, PL/I
Referer: ibmmainframes
Location: Bloomington, IL
Contact:

Re: DUPKEYS MAX

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

Why would your output not contain

Code: Select all

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

Prakash88
Posts: 8
Joined: Fri Jun 21, 2013 5:41 pm
Skillset: MF JCL COBOL DB2
Referer: Internet

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
Skillset: MF JCL COBOL DB2
Referer: Internet

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 ?

BillyBoyo
Global moderator
Posts: 3805
Joined: Tue Jan 25, 2011 12:02 am
Skillset: Easytrieve Plus, Cobol, Utilities, that sort of stuff
Referer: Google

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.