When I am trying to copy all records less than 03/01/2006 in file aid, the output file is returning only 2 records.
03/01/2004 and 03/01/2005.
I know this can be done through SORT but why is it failing through File Aid. It looks as if the month and day are becoming equal _________________ Cheers!
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Fri Apr 14, 2006 10:51 am Post subject:
You can't compare dates using the dd/mm/yyyy format because it will compare dd, then mm and then yyyy. So the outcome can be determined by the dd values or mm values before even looking at the yyyy values. For example, when you compare 04/12/2005 to 03/01/2006, 04 is greater than 03 so 2005 vs 2006 doesn't matter. You need to use the yyyy/mm/dd format to compare dates correctly. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Joined: 02 Sep 2003 Posts: 101 Topics: 55 Location: India
Posted: Fri Apr 14, 2006 11:23 am Post subject:
Thank You for your reply. However, when I am doing YYYYMMDD, would it still not just check YYYY first and then MM and then DD.
So if I have dates
2004/03/01
2005/06/02
2006/01/01
2006/03/02
and I want dates less than 2006/03/02. it will return only 2004/02/01 and 2005/06/02. Is that not correct. The date 2006/01/01 will still be skipped. _________________ Cheers!
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Fri Apr 14, 2006 12:03 pm Post subject:
It will check yyyy, then mm and then dd. For 2006/01/01 vs 2006/03/02, yyyy is 2006 for both, so it will check mm and find that 01 is less than 03 and keep that record. Why do you think it would skip it?
I tried your yyyy/mm/dd input with this DFSORT statement:
Code:
INCLUDE COND=(1,10,CH,LT,C'2006/03/02')
and the output was:
2004/03/01
2005/06/02
2006/01/01
I assume FileAid would do the compares this way (the correct way) as well. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum