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.
DUPKEYS MAX
-
- 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
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
Regards
Nic
- 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
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
Re: DUPKEYS MAX
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 .
Why would your output not contain
A Date1 30
Assume date1 is day1. date2 is day2.
I always want to get latest date .
Re: DUPKEYS MAX
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 ?
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 ?
-
- 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
You need to show the full details of what you tried, including the sysout. In the Code tags, please.