View previous topic :: View next topic
|
Author |
Message |
somapradeep1
New User
Joined: 07 Sep 2010 Posts: 22 Location: hyderabad
|
|
|
|
Hello,
I have a input file like below.
15972014-12-17-14.10.00.000000
15972014-12-17-15.10.00.000000
15972014-12-18-14.10.28.000000
15002014-12-18-14.10.28.000000
15002014-12-18-14.10.20.000000
15002014-12-19-14.10.20.000000
Here 1-4 position is my key. Based on my key value, need to pull ONE record which is having latest time stamp.
Output file:
15972014-12-18-14.10.28.000000
15002014-12-19-14.10.20.000000
Please help me how to achieve this by using SORT |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Step 1 - Sort on the entire date/timestamp descending
Step 2 - Sort on positions 1-4 descending using equals and sum fields=none
Check the manual for syntax if needed. |
|
Back to top |
|
|
somapradeep1
New User
Joined: 07 Sep 2010 Posts: 22 Location: hyderabad
|
|
|
|
Running two steps on same data makes performance issue on huge data. So trying to make it in a single step |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
How huge are you taking? One million records, two million?
I do not know of anyway of doing it in a single step.
Good luck. |
|
Back to top |
|
|
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
Did you, by any slightest of a chance, make an effort to read the DFSORT manual?
This shouldn't take much time if you read WHEN=GROUP and use a KEYBEGIN (even if you are reading it for the first time).
Please Read the Manual, Try it and then post here what you tried and failed to get.
. |
|
Back to top |
|
|
|