Page 1 of 1

Dates comparision between two dates problem

Posted: Tue Feb 15, 2005 7:22 am
by b_boby
Guys,
How to compare date1( non key) from file1 to check in Between two dates i.e date2A and date2B ( both non keys) on file2. There is no common key between these two files to use hash file(server) or look up(PX). I can move this data to DB and use join there I completely lost performance and don't have space on system. Can you halp me in this? Thanks for your help.

Bobby Smith

Posted: Tue Feb 15, 2005 7:29 am
by Sainath.Srinivasan
There are 2 methods
1.) create an hash-file with all individual date values between the date range and define it to be the key. Thus if you want to lookup an inbetween date, it will be in the hash-file.
2.) Use a cross product (outer) join of both files with some dummy key and use the constraint of file1.datevalue >= file2.startdate and file1.datevalue <= file2.enddate.

Obviously the resource constraint will apply in these cases.

Alternatively you can code your own BASIC language program to scan through the entire file (file2) for each record in source file (file1).