MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Date Comparisions in File-aid.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
abracadabra
Beginner


Joined: 02 Sep 2003
Posts: 101
Topics: 55
Location: India

PostPosted: Fri Apr 14, 2006 10:19 am    Post subject: Date Comparisions in File-aid. Reply with quote

Hi,

I have the following field values in a FB sequential file.

03/11/2003
04/12/2006
04/12/2005
03/01/2006
03/01/2004
03/01/2005
03/11/2003

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!
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Apr 14, 2006 10:51 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
abracadabra
Beginner


Joined: 02 Sep 2003
Posts: 101
Topics: 55
Location: India

PostPosted: Fri Apr 14, 2006 11:23 am    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Apr 14, 2006 12:03 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group